Bugfix/service request refactor size check (#553)
* refactor service requests from service header * add APDU size checking and length feature * add unit tests to check for length when passing NULL buffer --------- Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
+13
-4
@@ -62,16 +62,25 @@ extern "C" {
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE status,
|
||||
uint16_t minutes);
|
||||
|
||||
/* encode service */
|
||||
BACNET_STACK_EXPORT
|
||||
int dcc_apdu_encode(uint8_t *apdu,
|
||||
uint16_t timeDuration,
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE enable_disable,
|
||||
BACNET_CHARACTER_STRING *password);
|
||||
BACNET_STACK_EXPORT
|
||||
size_t dcc_service_request_encode(uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
uint16_t timeDuration,
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE enable_disable,
|
||||
BACNET_CHARACTER_STRING *password);
|
||||
BACNET_STACK_EXPORT
|
||||
int dcc_encode_apdu(
|
||||
uint8_t * apdu,
|
||||
uint8_t invoke_id,
|
||||
uint16_t timeDuration, /* 0=optional */
|
||||
uint16_t timeDuration,
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE enable_disable,
|
||||
BACNET_CHARACTER_STRING * password); /* NULL=optional */
|
||||
BACNET_CHARACTER_STRING * password);
|
||||
|
||||
/* decode the service request only */
|
||||
BACNET_STACK_EXPORT
|
||||
int dcc_decode_service_request(
|
||||
uint8_t * apdu,
|
||||
|
||||
Reference in New Issue
Block a user