Fix You-Are-Request encoding and decoding to use object-id instead of unsigned. (#1220)
This commit is contained in:
+3
-1
@@ -12,7 +12,7 @@ The git repositories are hosted at the following sites:
|
|||||||
* https://bacnet.sourceforge.net/
|
* https://bacnet.sourceforge.net/
|
||||||
* https://github.com/bacnet-stack/bacnet-stack/
|
* https://github.com/bacnet-stack/bacnet-stack/
|
||||||
|
|
||||||
## [Unreleased] - 2026-02-02
|
## [Unreleased] - 2026-02-05
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
@@ -122,6 +122,8 @@ The git repositories are hosted at the following sites:
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
* Fixed You-Are-Request encoding and decoding to use object-id instead
|
||||||
|
of unsigned. (#1220)
|
||||||
* Fixed handling for abort and reject errors in Write Property service. (#1216)
|
* Fixed handling for abort and reject errors in Write Property service. (#1216)
|
||||||
* Fixed lighting output object lighting-commands for warn-off and
|
* Fixed lighting output object lighting-commands for warn-off and
|
||||||
warn-relinquish when an update at the specified priority slot
|
warn-relinquish when an update at the specified priority slot
|
||||||
|
|||||||
+9
-8
@@ -64,7 +64,7 @@ int you_are_request_encode(
|
|||||||
apdu += len;
|
apdu += len;
|
||||||
}
|
}
|
||||||
if (device_id < BACNET_MAX_INSTANCE) {
|
if (device_id < BACNET_MAX_INSTANCE) {
|
||||||
len = encode_application_unsigned(apdu, device_id);
|
len = encode_application_object_id(apdu, OBJECT_DEVICE, device_id);
|
||||||
apdu_len += len;
|
apdu_len += len;
|
||||||
if (apdu) {
|
if (apdu) {
|
||||||
apdu += len;
|
apdu += len;
|
||||||
@@ -148,6 +148,8 @@ int you_are_request_decode(
|
|||||||
{
|
{
|
||||||
int len = 0, apdu_len = 0;
|
int len = 0, apdu_len = 0;
|
||||||
BACNET_UNSIGNED_INTEGER unsigned_value = 0;
|
BACNET_UNSIGNED_INTEGER unsigned_value = 0;
|
||||||
|
BACNET_OBJECT_TYPE object_type;
|
||||||
|
uint32_t object_instance;
|
||||||
|
|
||||||
if (!apdu) {
|
if (!apdu) {
|
||||||
return BACNET_STATUS_ERROR;
|
return BACNET_STATUS_ERROR;
|
||||||
@@ -183,17 +185,16 @@ int you_are_request_decode(
|
|||||||
} else {
|
} else {
|
||||||
return BACNET_STATUS_ERROR;
|
return BACNET_STATUS_ERROR;
|
||||||
}
|
}
|
||||||
len = bacnet_unsigned_application_decode(
|
len = bacnet_object_id_application_decode(
|
||||||
&apdu[apdu_len], apdu_size - apdu_len, &unsigned_value);
|
&apdu[apdu_len], apdu_size - apdu_len, &object_type, &object_instance);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
apdu_len += len;
|
apdu_len += len;
|
||||||
if (unsigned_value <= UINT32_MAX) {
|
if (object_type != OBJECT_DEVICE) {
|
||||||
if (device_id) {
|
|
||||||
*device_id = (uint32_t)unsigned_value;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return BACNET_STATUS_ERROR;
|
return BACNET_STATUS_ERROR;
|
||||||
}
|
}
|
||||||
|
if (device_id) {
|
||||||
|
*device_id = object_instance;
|
||||||
|
}
|
||||||
} else if (len == 0) {
|
} else if (len == 0) {
|
||||||
/* optional - skip apdu_len increment */
|
/* optional - skip apdu_len increment */
|
||||||
if (device_id) {
|
if (device_id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user