Refactored address decoding from demo command line function into address library.

This commit is contained in:
skarg
2014-08-15 13:17:46 +00:00
parent 0be5ddce65
commit ccad9165c5
4 changed files with 150 additions and 107 deletions
+9
View File
@@ -96,6 +96,15 @@ extern "C" {
void address_cache_timer(
uint16_t uSeconds);
void address_mac_init(
BACNET_MAC_ADDRESS *mac,
uint8_t *adr,
uint8_t len);
bool address_mac_from_ascii(
BACNET_MAC_ADDRESS *mac,
char *arg);
#ifdef __cplusplus
}
#endif /* __cplusplus */
+6
View File
@@ -134,6 +134,12 @@ struct BACnet_Device_Address {
uint8_t adr[MAX_MAC_LEN]; /* hwaddr (MAC) address */
};
typedef struct BACnet_Device_Address BACNET_ADDRESS;
/* define a MAC address for manipulation */
struct BACnet_MAC_Address {
uint8_t len; /* length of MAC address */
uint8_t adr[MAX_MAC_LEN];
};
typedef struct BACnet_MAC_Address BACNET_MAC_ADDRESS;
/* note: with microprocessors having lots more code space than memory,
it might be better to have a packed encoding with a library to