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_no
Reader 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 length
Length of keypress data in bytes
uint8_t data
Keypress data of length bytes

Card Read Event

structosdp_event_cardread

OSDP event cardread.

Members
int reader_no
Reader number. 0 = First Reader, 1 = Second Reader, etc.
enum osdp_event_cardread_format_e format
Format of the card being read.
int direction
Direction of data in data array.- 0 - Forward- 1 - Backward
int length
Length of card data in bits
uint8_t data
Card 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_code
3-bytes IEEE assigned OUI of manufacturer
uint8_t length
Length of manufacturer data in bytes (optional)
uint8_t data
Manufacturer 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 type
The kind of event to report see enum osdp_event_status_type_e
int nr_entries
Number of valid bits in status
uint8_t report
Status report
enumosdp_status_report_type

OSDP Status report types.

Values
OSDP_STATUS_REPORT_INPUT
Status report of the inputs attached the PD.
OSDP_STATUS_REPORT_OUTPUT
Status report of the output attached the PD.
OSDP_STATUS_REPORT_LOCAL
Local tamper and power status report.
OSDP_STATUS_REPORT_REMOTE
Remote tamper and power status report.