diff --git a/bacnet-stack/bacdcode.h b/bacnet-stack/bacdcode.h index 6988ad19..f1c6e9dc 100644 --- a/bacnet-stack/bacdcode.h +++ b/bacnet-stack/bacdcode.h @@ -46,6 +46,24 @@ typedef struct BACnet_Bit_String uint8_t value[MAX_BITSTRING_BYTES]; } BACNET_BIT_STRING; +// date +typedef struct BACnet_Date +{ + uint8_t year; + uint8_t month; + uint8_t day; + uint8_t wday; +} BACNET_DATE; + +// time +typedef struct BACnet_Time +{ + uint8_t hour; + uint8_t min; + uint8_t sec; + uint8_t hundredths; +} BACNET_TIME; + // from clause 20.2.1 General Rules for Encoding BACnet Tags // returns the number of apdu bytes consumed int encode_tag(uint8_t * apdu, uint8_t tag_number, bool context_specific, diff --git a/bacnet-stack/wp.h b/bacnet-stack/wp.h index 7430cc5d..c68e604e 100644 --- a/bacnet-stack/wp.h +++ b/bacnet-stack/wp.h @@ -36,6 +36,30 @@ #include #include +#include "bacdcode.h" + +typedef struct BACnet_Write_Property_Value +{ + uint8_t tag; + union tag_value + { + // NULL - not needed as it is encoded in the tag alone + bool Boolean; + unsigned int Unsigned_Int; + int Signed_Int; + float Real; + // Note: if you choose to enable the writing of certain types + // you can uncomment the ones you need. Good Luck! + //double Double; + //uint8_t Octet_String[20]; + //char Character_String[20]; + //BACNET_BIT_STRING Bit_String + unsigned int Enumerated; + BACNET_DATE Date; + BACNET_TIME Time; + uint32_t Object_Identifier; + } +} BACNET_WRITE_PROPERTY_VALUE; typedef struct BACnet_Write_Property_Data {