Documentation
Application Events
LibOSDP exposes the following structures through osdp.h. All events are carried in a single union wrapper:
OSDP Event structure.
osdp_queue_node_t _nodeenum osdp_event_type typeuint32_t flagsstruct osdp_event_keypress keypressstruct osdp_event_cardread cardreadstruct osdp_event_mfgrep mfgrepstruct osdp_event_mfgstat mfgstatrstruct osdp_event_mfgstat mfgerrrstruct osdp_event_bioreadr bioreadrstruct osdp_event_biomatchr biomatchrstruct osdp_event_piv_reply piv_replystruct osdp_status_report statusstruct osdp_notification notifunion osdp_event::@4 @5The type field selects the active union member and is one of osdp_event_type:
OSDP PD Events.
OSDP_EVENT_CARDREADOSDP_EVENT_KEYPRESSOSDP_EVENT_MFGREPOSDP_EVENT_STATUSOSDP_EVENT_NOTIFICATIONOSDP_EVENT_MFGSTATROSDP_EVENT_MFGERRROSDP_EVENT_BIOREADROSDP_EVENT_BIOMATCHROSDP_EVENT_PIVDATAROSDP_EVENT_GENAUTHROSDP_EVENT_CRAUTHROSDP_EVENT_SENTINELBelow are the structures for each event type. They are delivered to the CP with osdp_pd_submit_event.
Key Press Event
OSDP Event Keypad.
int reader_noint lengthuint8_t data64Max keypress data, in bytes, that a keypad event can carry. One byte per key, so this bounds the number of keys a PD can report in one event.
Card Read Event
OSDP event cardread.
int reader_noenum osdp_event_cardread_format_e formatint directionuint16_t lengthuint8_t dataVarious card formats that a PD can support. This is sent to CP when a PD must report a card read.
OSDP_CARD_FMT_RAW_UNSPECIFIEDOSDP_CARD_FMT_RAW_WIEGANDOSDP_CARD_FMT_ASCIIOSDP_CARD_FMT_SENTINEL64Max card data, in bytes, that a card read event can carry. Note that the event's length field is in bits or bytes depending on the card format, but this bound is always in bytes.
Manufacturer Specific Reply Event
OSDP Event Manufacturer Specific Command.
uint32_t vendor_codeuint8_t lengthuint8_t data128Max vendor defined data, in bytes, that a manufacturer specific reply can carry.
Manufacturer Specific Status Event
OSDP Event Manufacturer Specific Status/Error Reply.
uint8_t lengthuint8_t data128Max vendor defined data, in bytes, that a manufacturer specific status or error reply can carry.
Biometric Events
OSDP Event Scan and Send Biometric Data.
uint8_t readerenum osdp_biometric_status_e statusenum osdp_biometric_type_e typeuint8_t qualityuint16_t lengthuint8_t dataOSDP Event Scan and Match Biometric Template.
uint8_t readerenum osdp_biometric_status_e statusuint8_t score256Max biometric template carried in a BIOREADR reply.
A REPLY_BIOREADR template normally has to fit in one packet. Setting OSDP_FLAG_BIOREADR_MULTIPART on both roles lets LibOSDP split a larger template across fragments — a non-conforming, opt-in extension. See Multi-part Messages.
Status Report Request Event
Status report structure. Used by OSDP_CMD_STATUS and OSDP_EVENT_STATUS. In case of command, it is used to send a query to the PD while in the case of events, the PD responds back with this structure.
enum osdp_status_report_type typeint nr_entriesuint8_t reportOSDP Status report types.
OSDP_STATUS_REPORT_INPUTOSDP_STATUS_REPORT_OUTPUTOSDP_STATUS_REPORT_LOCALOSDP_STATUS_REPORT_READERNotifications
When enabled with OSDP_FLAG_ENABLE_NOTIFICATION, LibOSDP reports internal state changes to the application through these structures.
LibOSDP notification payload.
enum osdp_notification_type typestruct osdp_notification_command commandstruct osdp_notification_sc_status sc_statusstruct osdp_notification_pd_status pd_statusstruct osdp_mp_notification mpstruct osdp_pd_id pd_idunion osdp_notification::@0 @1LibOSDP notification type.
OSDP_NOTIFICATION_COMMANDOSDP_NOTIFICATION_SC_STATUSOSDP_NOTIFICATION_PD_STATUSOSDP_NOTIFICATION_MP_STARTOSDP_NOTIFICATION_MP_PROGRESSOSDP_NOTIFICATION_MP_DONEOSDP_NOTIFICATION_PD_ID