Menu

#88 Fail Writing BACnet Timestamp encoded with double context tag

v1.4.1
pending
None
5
2024-11-28
2024-11-21
Andrea
No

Hello,
NOTE: I'm using the 1.3.8 (but in Milestone only 1.3.7 is present).

I've found an error when receiving:
WriteProperty "PROP_TIME_OF_DEVICE_RESTART", that has BACnet_Timestamp type.

Writing fail (not because is read only, I know) because "bacapp_decode_application_data" return -1 and give "ERROR_CODE_VALUE_OUT_OF_RANGE".

I've found the cause (but not the solution):
The Date and Time of "time of device restart" is included in a double Context Tag and this cause the "bacapp_decode_application_data" to fail; this dont' happens on previous 0.8.6.

Format of ADPU seems to be correct and has the same double Context Tag created by library when reading the same property; Attached the capture of this issue.

Thanks and Best Regards,
Andrea.

1 Attachments

Discussion

  • Steve Karg

    Steve Karg - 2024-11-23
    • status: open --> pending
    • assigned_to: Steve Karg
    • Group: v1.3.7 --> v1.3.8
     
  • Steve Karg

    Steve Karg - 2024-11-23

    Thank you for reporting the problem!

    I made a quick test by adding PROP_TIME_OF_DEVICE_RESTART to device object, made and ran the unit test, which failed. I made some changes until the test passed. Then I used the command line tools (bacserv to similulate a device, bacepics and bacrp and bacrpm to read the device property values, and bacwp to write values) to validate the fix and review the encoding using Wireshark.

    See commit cdda52

    • added PROP_TIME_OF_DEVICE_RESTART to the apps/server example Device object for ReadProperty and WriteProperty.
    • changed src/bacnet/bacapp.c module to include BACnetTimeStamp in the decoding of known properties, and encode and parsing used by bacwp to write the value.
    • changed the WriteProperty handler of the Device object to then use bacapp_decode_known_property() instead of bacapp_decode_application_data() function.
     
  • Steve Karg

    Steve Karg - 2024-11-23
    • Group: v1.3.8 --> v1.4.1
     
  • Andrea

    Andrea - 2024-11-28

    Thank you for quick fixing!

    It works as expected.

    Thanks and Best Regards.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB