Application Events
LibOSDP exposes the following structures thought osdp.h
. This document
attempts to document each of its members. The following structure is used as a
wrapper for all the events for convenience.
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 structure of each of the event structures.
Key press Event
-
struct osdp_event_keypress
OSDP Event Keypad.
Card read Event
-
struct osdp_event_cardread
OSDP event cardread.
Public 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[OSDP_EVENT_CARDREAD_MAX_DATALEN]
Card data of length bytes or bits bits depending on format
-
int reader_no
Manufacture specific reply Event
-
struct osdp_event_mfgrep
OSDP Event Manufacturer Specific Command.
Note
OSDP spec v2.2 makes this structure fixed at 4 bytes (3-byte vendor code and 1-byte data). LibOSDP allows for some additional data to be passed in this command using the data and length fields while using the 1-byte data (as specified in the specification) as command. To be fully compliant with the specification, you can set length to 0.
Status report request Event
-
struct osdp_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.
This can is used by the PD to indicate various status change reports. Upto a maximum of 32 statuses can be reported using this API.
Public 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
-
uint32_t mask
Status bit mask
-
enum osdp_status_report_type type
-
enum osdp_status_report_type
OSDP Status report types.
Values:
-
enumerator OSDP_STATUS_REPORT_INPUT
Status report of the inputs attached the PD.
-
enumerator OSDP_STATUS_REPORT_OUTPUT
Status report of the output attached the PD.
-
enumerator OSDP_STATUS_REPORT_LOCAL
Local tamper and power status report.
Bit-0: tamper Bit-1: power
-
enumerator OSDP_STATUS_REPORT_REMOTE
Remote tamper and power status report.
Bit-0: tamper Bit-1: power
-
enumerator OSDP_STATUS_REPORT_INPUT