Closed laszlopataki closed 2 years ago
Good catch thanks!
This seems to be one of those changes in v2.2 which was not the case till v2.1.5 of the specification. There, the data filed can be any length as chosen by the vendor. This allowed some flexibility for me to defined some minimal structure to these commands so the whole length prefixed data thing was a LibOSDP specific extension (IMO, this is how they should have defined the struct to begin with).
I think this change doesn't make sense as it is limiting the possibility of what osdp_MFG
and osdp_MFGREP
can achieve. For this reason I'm really reluctant to "fix" this. But.. in the interest of playing nice to those who followed the 2.2 spec, I will make sure LibOSDP supports both formats.
Actually, we are already supporting it both ways :). To be compatible with specification, you just have to set the length field to zero. I'll add comments to clarify this.
Describe the bug
osdp.h:struct osdp_event_mfgrep
conatinslength
field and the data length isOSDP_EVENT_MAX_DATALEN
(64), AccordinglySIA-OSDP-2.2-FINAL-120720.pdf:7.18 Manufacturer Specific Reply (osdp_MFGREP)
the Data field is fixed 1 byte.Expected behavior
osdp.h:struct osdp_event_mfgrep
has 1 bytes Data field.Update: The data field is fine, but it is not identical to the "Data" referenced in the documentation. The Data field in documentation is called a command in the code.