Added defines for each BACAPP datatype so that the developer could only use the ones they need for their WriteProperty applications.
This commit is contained in:
@@ -48,18 +48,42 @@ typedef struct BACnet_Application_Data_Value {
|
||||
uint8_t tag; /* application tag data type */
|
||||
union {
|
||||
/* NULL - not needed as it is encoded in the tag alone */
|
||||
#if defined (BACAPP_BOOLEAN)
|
||||
bool Boolean;
|
||||
#endif
|
||||
#if defined (BACAPP_UNSIGNED)
|
||||
uint32_t Unsigned_Int;
|
||||
#endif
|
||||
#if defined (BACAPP_SIGNED)
|
||||
int32_t Signed_Int;
|
||||
#endif
|
||||
#if defined (BACAPP_REAL)
|
||||
float Real;
|
||||
#endif
|
||||
#if defined (BACAPP_DOUBLE)
|
||||
double Double;
|
||||
#endif
|
||||
#if defined (BACAPP_OCTET_STRING)
|
||||
BACNET_OCTET_STRING Octet_String;
|
||||
#endif
|
||||
#if defined (BACAPP_CHARACTER_STRING)
|
||||
BACNET_CHARACTER_STRING Character_String;
|
||||
#endif
|
||||
#if defined (BACAPP_BIT_STRING)
|
||||
BACNET_BIT_STRING Bit_String;
|
||||
#endif
|
||||
#if defined (BACAPP_ENUMERATED)
|
||||
int Enumerated;
|
||||
#endif
|
||||
#if defined (BACAPP_DATE)
|
||||
BACNET_DATE Date;
|
||||
#endif
|
||||
#if defined (BACAPP_TIME)
|
||||
BACNET_TIME Time;
|
||||
#endif
|
||||
#if defined (BACAPP_OBJECT_ID)
|
||||
BACNET_OBJECT_ID Object_Id;
|
||||
#endif
|
||||
} type;
|
||||
/* simple linked list if needed */
|
||||
struct BACnet_Application_Data_Value *next;
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include "bacdef.h"
|
||||
#include "datetime.h"
|
||||
#include "bacstr.h"
|
||||
#include "bacint.h"
|
||||
#include "bacreal.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -81,7 +81,11 @@ extern "C" {
|
||||
bool bitstring_set_octet(BACNET_BIT_STRING * bit_string, uint8_t index,
|
||||
uint8_t octet);
|
||||
bool bitstring_set_bits_used(BACNET_BIT_STRING * bit_string,
|
||||
uint8_t bytes_used, uint8_t unused_bits);
|
||||
uint8_t bytes_used, uint8_t unused_bits);
|
||||
bool bitstring_copy(
|
||||
BACNET_BIT_STRING * dest,
|
||||
BACNET_BIT_STRING * src);
|
||||
|
||||
|
||||
/* returns false if the string exceeds capacity
|
||||
initialize by using length=0 */
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Define your processor architecture as Big Endian or Little Endian */
|
||||
/* Define your processor architecture as
|
||||
Big Endian (PowerPC,68K,Sparc) or Little Endian (Intel,AVR)
|
||||
ARM and MIPS can be either - what is your setup? */
|
||||
#if !defined(BIG_ENDIAN)
|
||||
#define BIG_ENDIAN 0
|
||||
#endif
|
||||
@@ -63,4 +65,21 @@
|
||||
#define PRINT_ENABLED 0
|
||||
#endif
|
||||
|
||||
/* BACAPP decodes WriteProperty service requests
|
||||
Choose the datatypes that your application supports */
|
||||
#if defined (BACAPP_ALL)
|
||||
#define BACAPP_BOOLEAN
|
||||
#define BACAPP_UNSIGNED
|
||||
#define BACAPP_SIGNED
|
||||
#define BACAPP_REAL
|
||||
/* FIXME: not implemented #define BACAPP_DOUBLE */
|
||||
#define BACAPP_OCTET_STRING
|
||||
#define BACAPP_CHARACTER_STRING
|
||||
#define BACAPP_BIT_STRING
|
||||
#define BACAPP_ENUMERATED
|
||||
#define BACAPP_DATE
|
||||
#define BACAPP_TIME
|
||||
#define BACAPP_OBJECT_ID
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "bacdef.h"
|
||||
#include "bacaddr.h"
|
||||
#include "npdu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user