From fe6a67967ea8bdd54b654493f1c50b77f8e39bfc Mon Sep 17 00:00:00 2001 From: skarg Date: Sun, 13 Mar 2005 12:09:20 +0000 Subject: [PATCH] added BACnet address to be used by npdu encoding and for address cache --- bacnet-stack/bacdef.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bacnet-stack/bacdef.h b/bacnet-stack/bacdef.h index 46a34f31..827809af 100644 --- a/bacnet-stack/bacdef.h +++ b/bacnet-stack/bacdef.h @@ -34,6 +34,27 @@ #ifndef BACDEF_H #define BACDEF_H +#include + +// largest BACnet Instance Number +// Also used as a device instance number wildcard address #define BACNET_MAX_INSTANCE (0x3FFFFF) +// large BACnet Object Type +#define BACNET_MAX_OBJECT (0x3FF) +// Array index 0=size of array, n=array element n, MAX=all array elements +#define BACNET_ARRAY_ALL (~0) + +#define MAX_MAC_LEN 8 +struct BACnet_Device_Address { + // mac_len = 0 if global address + int mac_len; + uint8_t mac[MAX_MAC_LEN]; + // the following are used if the device is behind a router + // net = 0 indicates local + uint16_t net; /* BACnet network number */ + int adr_len; /* length of MAC address */ + uint8_t adr[MAX_MAC_LEN]; /* hwaddr (MAC) address */ +}; +typedef struct BACnet_Device_Address BACNET_ADDRESS; #endif \ No newline at end of file