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
138 stars 71 forks source link

Add a in-library post command callback mechanism to perform success/failure actions #62

Closed sidcha closed 1 year ago

sidcha commented 3 years ago

A lot of times, we need to perform some actions based on whether a command succeeded or failed. Since there are 2 level state machines (very messy) in osdp_cp.c, we have no way of performing some post success/failure operations for commands that got queued from the applications.

Note that this is not the same as command_complete_callback that exists today (which is for notifying the application). This issue is to track a in-library notifier. One prominent user case for this handler is when the application wants to set SCBK directly without a master_key; if that succeeds, LibOSDP must set the PD_FLAG_HAD_SCBK on the PD so this key can survive secure channel resets.

sidcha commented 1 year ago

Closing this as it is no longer relevant.