Menu

#74 Printing of the Read property acknowledgement when APDU len is > 255 bytes

v1.0.1
accepted
None
1
2021-01-13
2020-12-28
Unna KB
No

Hi Steve,
First of all, many thanks for this great stack. I am running the stack as a BACnet Client on a Ubuntu Linux VM. Using the demo app (bin/bacrp) for reading the device object property of the demo server (bin/bacserv), the object list doesnt get fully printed on the console.

So in file bacnetstack/src/bacnet/basic/service and in function
void rp_ack_print_data(BACNET_READ_PROPERTY_DATA data)
...
...
/
FIXME: what if application_data_len is bigger than 255? /
/
value? need to loop until all of the len is gone... /
for (;;) {
len = bacapp_decode_application_data(
application_data,
(uint8_t)application_data_len*, &value);
...
...

I changed the line to
len = bacapp_decode_application_data(
application_data, (uint16_t)application_data_len, &value);
to allow application_data_len bigger than 255.

With this change, I am able to print the complete list of objects when reading the property of the device. Hopefully this change would cover the max APDU length of 1500bytes.

Discussion

  • Steve Karg

    Steve Karg - 2021-01-13
    • status: open --> accepted
    • Priority: 9 --> 1
     
  • Steve Karg

    Steve Karg - 2021-01-13

    Thank you for finding the bug. I fixed it by matching the cast with the function data type of unsigned.

                len =
                    bacapp_decode_application_data(application_data,
                    (unsigned)application_data_size, &value);
    
     

Anonymous
Anonymous

Add attachments
Cancel