Fixed BACnetHostNPort known property decoding. (#700)

* Fixed BACnetHostNPort known property decoding.

* Added BDT-Entry and FDT-Entry to BACapp for known property encoding/decoding.
This commit is contained in:
Steve Karg
2024-07-19 16:45:09 -05:00
committed by GitHub
parent fd2f33b522
commit 90714c094c
17 changed files with 1942 additions and 527 deletions
+111
View File
@@ -42,11 +42,43 @@ typedef struct BACnetHostNPort {
uint16_t port;
} BACNET_HOST_N_PORT;
/**
* BACnetBDTEntry ::= SEQUENCE {
* bbmd-address [0] BACnetHostNPort,
* broadcast-mask [1] OCTET STRING OPTIONAL
* -- shall be present if BACnet/IP, and absent for BACnet/IPv6
* }
*/
typedef struct BACnetBDTEntry {
BACNET_HOST_N_PORT bbmd_address;
BACNET_OCTET_STRING broadcast_mask;
} BACNET_BDT_ENTRY;
/**
* BACnetFDTEntry ::= SEQUENCE {
* bacnetip-address [0] OCTET STRING,
* -- the 6-octet B/IP or 18-octet B/IPv6 address of the registrant
* time-to-live [1] Unsigned16,
* -- time to live in seconds at the time of registration
* remaining-time-to-live [2] Unsigned16
* -- remaining time to live in seconds, incl. grace period
* }
*/
typedef struct BACnetFDTEntry {
BACNET_OCTET_STRING bacnetip_address;
uint16_t time_to_live;
uint16_t remaining_time_to_live;
} BACNET_FDT_ENTRY;
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
BACNET_STACK_EXPORT
int host_n_port_address_encode(
uint8_t *apdu,
BACNET_HOST_N_PORT *address);
BACNET_STACK_EXPORT
int host_n_port_encode(
uint8_t * apdu,
BACNET_HOST_N_PORT *address);
@@ -56,6 +88,11 @@ extern "C" {
uint8_t tag_number,
BACNET_HOST_N_PORT *address);
BACNET_STACK_EXPORT
int host_n_port_address_decode(uint8_t *apdu,
uint32_t apdu_size,
BACNET_ERROR_CODE *error_code,
BACNET_HOST_N_PORT *address);
BACNET_STACK_EXPORT
int host_n_port_decode(uint8_t *apdu,
uint32_t apdu_len,
BACNET_ERROR_CODE *error_code,
@@ -79,6 +116,80 @@ extern "C" {
BACNET_HOST_N_PORT *value,
const char *argv);
BACNET_STACK_EXPORT
int bacnet_bdt_entry_encode(
uint8_t * apdu,
BACNET_BDT_ENTRY *entry);
BACNET_STACK_EXPORT
int bacnet_bdt_entry_context_encode(
uint8_t * apdu,
uint8_t tag_number,
BACNET_BDT_ENTRY *entry);
BACNET_STACK_EXPORT
int bacnet_bdt_entry_decode(uint8_t *apdu,
uint32_t apdu_len,
BACNET_ERROR_CODE *error_code,
BACNET_BDT_ENTRY *address);
BACNET_STACK_EXPORT
int bacnet_bdt_entry_context_decode(uint8_t *apdu,
uint32_t apdu_size,
uint8_t tag_number,
BACNET_ERROR_CODE *error_code,
BACNET_BDT_ENTRY *address);
BACNET_STACK_EXPORT
bool bacnet_bdt_entry_copy(
BACNET_BDT_ENTRY * dst,
BACNET_BDT_ENTRY * src);
BACNET_STACK_EXPORT
bool bacnet_bdt_entry_same(
BACNET_BDT_ENTRY * dst,
BACNET_BDT_ENTRY * src);
BACNET_STACK_EXPORT
bool bacnet_bdt_entry_from_ascii(
BACNET_BDT_ENTRY *value,
const char *argv);
BACNET_STACK_EXPORT
int bacnet_bdt_entry_to_ascii(
char *str, size_t str_size,
BACNET_BDT_ENTRY *value);
BACNET_STACK_EXPORT
int bacnet_fdt_entry_encode(
uint8_t * apdu,
BACNET_FDT_ENTRY *entry);
BACNET_STACK_EXPORT
int bacnet_fdt_entry_context_encode(
uint8_t * apdu,
uint8_t tag_number,
BACNET_FDT_ENTRY *entry);
BACNET_STACK_EXPORT
int bacnet_fdt_entry_decode(uint8_t *apdu,
uint32_t apdu_len,
BACNET_ERROR_CODE *error_code,
BACNET_FDT_ENTRY *address);
BACNET_STACK_EXPORT
int bacnet_fdt_entry_context_decode(uint8_t *apdu,
uint32_t apdu_size,
uint8_t tag_number,
BACNET_ERROR_CODE *error_code,
BACNET_FDT_ENTRY *address);
BACNET_STACK_EXPORT
bool bacnet_fdt_entry_copy(
BACNET_FDT_ENTRY * dst,
BACNET_FDT_ENTRY * src);
BACNET_STACK_EXPORT
bool bacnet_fdt_entry_same(
BACNET_FDT_ENTRY * dst,
BACNET_FDT_ENTRY * src);
BACNET_STACK_EXPORT
bool bacnet_fdt_entry_from_ascii(
BACNET_FDT_ENTRY *value,
const char *argv);
BACNET_STACK_EXPORT
int bacnet_fdt_entry_to_ascii(
char *str, size_t str_size,
BACNET_FDT_ENTRY *value);
#ifdef __cplusplus
}
#endif /* __cplusplus */