Application Commands
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 commands for convenience.
struct osdp_cmd {
enum osdp_cmd_e id; // Command ID. Used to select specific commands in union
union {
struct osdp_cmd_led led;
struct osdp_cmd_buzzer buzzer;
struct osdp_cmd_text text;
struct osdp_cmd_output output;
struct osdp_cmd_comset comset;
struct osdp_cmd_keyset keyset;
struct osdp_cmd_mfg mfg;
struct osdp_cmd_file_tx file_tx;
struct osdp_status_report status;
};
};
Below are the structure of each of the command structures.
LED command
-
struct osdp_cmd_led_params
LED params sub-structure. Part of LED command. See osdp_cmd_led.
Public Members
-
uint8_t control_code
Control code.
Temporary Control Code:
0 - NOP - do not alter this LED’s temporary settings.
1 - Cancel any temporary operation and display this LED’s permanent state immediately.
2 - Set the temporary state as given and start timer immediately.
Permanent Control Code:
0 - NOP - do not alter this LED’s permanent settings.
1 - Set the permanent state as given.
-
uint8_t on_count
The ON duration of the flash, in units of 100 ms.
-
uint8_t off_count
The OFF duration of the flash, in units of 100 ms.
-
uint8_t on_color
Color to set during the ON timer (see osdp_led_color_e).
-
uint8_t off_color
Color to set during the OFF timer (see osdp_led_color_e).
-
uint16_t timer_count
Time in units of 100 ms (only for temporary mode).
-
uint8_t control_code
-
struct osdp_cmd_led
Sent from CP to PD to control the behaviour of it’s on-board LEDs.
Public Members
-
uint8_t reader
Reader number. 0 = First Reader, 1 = Second Reader, etc.
-
uint8_t led_number
LED number. 0 = first LED, 1 = second LED, etc.
-
struct osdp_cmd_led_params temporary
Ephemeral LED status descriptor.
-
struct osdp_cmd_led_params permanent
Permanent LED status descriptor.
-
uint8_t reader
Buzzer command
-
struct osdp_cmd_buzzer
Sent from CP to control the behaviour of a buzzer in the PD.
Public Members
-
uint8_t reader
Reader number. 0 = First Reader, 1 = Second Reader, etc.
-
uint8_t control_code
Control code.
0 - no tone
1 - off
2 - default tone
3+ - TBD
-
uint8_t on_count
The ON duration of the sound, in units of 100 ms.
-
uint8_t off_count
The OFF duration of the sound, in units of 100 ms.
-
uint8_t rep_count
The number of times to repeat the ON/OFF cycle; 0: forever.
-
uint8_t reader
Text command
-
struct osdp_cmd_text
Command to manipulate any display units that the PD supports.
Public Members
-
uint8_t reader
Reader number. 0 = First Reader, 1 = Second Reader, etc.
-
uint8_t control_code
Control code.
1 - permanent text, no wrap
2 - permanent text, with wrap
3 - temp text, no wrap
4 - temp text, with wrap
-
uint8_t temp_time
Duration to display temporary text, in seconds
-
uint8_t offset_row
Row to display the first character (1-indexed)
-
uint8_t offset_col
Column to display the first character (1-indexed)
-
uint8_t length
Number of characters in the string
-
uint8_t data[OSDP_CMD_TEXT_MAX_LEN]
The string to display
-
uint8_t reader
Output command
-
struct osdp_cmd_output
Command sent from CP to Control digital output of PD.
Public Members
-
uint8_t output_no
0 = First Output, 1 = Second Output, etc.
-
uint8_t control_code
One of the following: 0 - NOP – do not alter this output 1 - set the permanent state to OFF, abort timed operation (if any) 2 - set the permanent state to ON, abort timed operation (if any) 3 - set the permanent state to OFF, allow timed operation to complete 4 - set the permanent state to ON, allow timed operation to complete 5 - set the temporary state to ON, resume perm state on timeout 6 - set the temporary state to OFF, resume permanent state on timeout
-
uint16_t timer_count
Time in units of 100 ms
-
uint8_t output_no
Comset command
-
struct osdp_cmd_comset
Sent in response to a COMSET command. Set communication parameters to PD. Must be stored in PD non-volatile memory.
Keyset command
-
struct osdp_cmd_keyset
This command transfers an encryption key from the CP to a PD.
Manufacture specific command
-
struct osdp_cmd_mfg
Manufacturer Specific Commands.
File transfer command
-
struct osdp_cmd_file_tx
File transfer start command.
Status report command
-
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