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

Small changes found when testing with Inner Range SIFER reader #77

Closed nathan-simpson closed 2 years ago

nathan-simpson commented 2 years ago

This particular device would not respond to CMD_ID without first issuing CMD_POLL Adding CMD_POLL to OSDP_CP_STATE_INIT fixed this.

The device also replies to CMD_POLL with REPLY_ISTATR on occasion which dropped the connection. Ignoring this reply and logging a warning fixes this.

Also fixed incorrect logging of CMD_CAP where it should have been CMD_ID

sidcha commented 2 years ago

@nathan-simpson, I pushed some changes that would allow you to ignore unknown, unsolicited commands by setting a new flag OSDP_FLAG_IGN_UNSOLICITED in pd_info (or by using the new osdp_cp_modify_flags() API). Let me know if it doesn't work as you expect.