Documentation
Application Events
LibOSDP exposes the following structures through osdp.h. The following unionwrapper is used for all events:
struct osdp_event {
enum osdp_event_type type; // Used to select specific event in union
union {
struct osdp_event_keypress keypress;
struct osdp_event_cardread cardread;
struct osdp_event_mfgrep mfgrep;
struct osdp_status_report status;
};
};
Below are the structures for each event type.
Key Press Event
structosdp_event_keypress
OSDP Event Keypad.
Members
int reader_noReader number in context of sub-readers attached to current PD; this number indicates the number of that reader. This is not supported by LibOSDP.
int lengthLength of keypress data in bytes
uint8_t dataKeypress data of length bytes
Card Read Event
structosdp_event_cardread
OSDP event cardread.
Members
int reader_noReader number. 0 = First Reader, 1 = Second Reader, etc.
enum osdp_event_cardread_format_e formatFormat of the card being read.
int directionDirection of data in data array.- 0 - Forward- 1 - Backward
int lengthLength of card data in bits
uint8_t dataCard data of length bytes or bits bits depending on format
Manufacturer Specific Reply Event
structosdp_event_mfgrep
OSDP Event Manufacturer Specific Command.
Members
uint32_t vendor_code3-bytes IEEE assigned OUI of manufacturer
uint8_t lengthLength of manufacturer data in bytes (optional)
uint8_t dataManufacturer data of length bytes (optional)
Status Report Request Event
structosdp_status_report
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.
Members
enum osdp_status_report_type typeThe kind of event to report see enum osdp_event_status_type_e
int nr_entriesNumber of valid bits in status
uint8_t reportStatus report
enumosdp_status_report_type
OSDP Status report types.
Values
OSDP_STATUS_REPORT_INPUTStatus report of the inputs attached the PD.
OSDP_STATUS_REPORT_OUTPUTStatus report of the output attached the PD.
OSDP_STATUS_REPORT_LOCALLocal tamper and power status report.
OSDP_STATUS_REPORT_REMOTERemote tamper and power status report.