goToMain / libosdp

Implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol); provides a C library with support for C++, Rust and Python3
https://libosdp.sidcha.dev
Apache License 2.0
134 stars 71 forks source link

OSDP_EVENT_FILE_TX missing implementation #74

Closed laszlopataki closed 2 years ago

laszlopataki commented 2 years ago

Hi, thank you for the great lib

Describe the bug I am implementing a PD firmware update. I transfer the image and the signature via multiple FILETRANSFER commands. After this, the PD reboots and does a self-check. Finally, PD would report back to CP with OSDP_EVENT_FILE_TX.

Expected behavior I am able to use OSDP_EVENT_FILE_TX to report the result of the firmware update to CP.

Observed behavior PD prints "Unknown event type 3"

Additional context I am using v2.0.0 release. I purchased the standard document. I was wondering what OSDP_EVENT_FILE_TX is equivalent in SIA-OSDP-2.2-FINAL-120720.pdf

sidcha commented 2 years ago

Hey @laszlopataki, OSDP_EVENT_FILE_TX should not exits, it was part of another design I was considering at the time and missed to remove it fully. :)

According to the spec, the CP has to send a EOF packet with the offset set to file_size and length set to 0. When the PD receives and acknowledges it, both parties know that the transmission session has ended so there is no need to send an explicit notification to the CP.