Documentation

Application Commands

LibOSDP exposes the following structures through osdp.h. The following unionwrapper is used for all commands:

struct osdp_cmd {
    enum osdp_cmd_e id; // Command ID. Used to select specific command 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 structures for each command type.

LED Command

structosdp_cmd_led_params

LED params sub-structure. Part of LED command. See osdp_cmd_led.

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).
structosdp_cmd_led

Sent from CP to PD to control the behaviour of it's on-board LEDs.

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.

Buzzer Command

structosdp_cmd_buzzer

Sent from CP to control the behaviour of a buzzer in the PD.

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.

Text Command

structosdp_cmd_text

Command to manipulate any display units that the PD supports.

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
The string to display

Output Command

structosdp_cmd_output

Command sent from CP to Control digital output of PD.

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

Comset Command

structosdp_cmd_comset

Sent in response to a COMSET command. Set communication parameters to PD. Must be stored in PD non-volatile memory.

Members
uint8_t address
Unit ID to which this PD will respond after the change takes effect.
uint32_t baud_rate
Baud rate. Valid values: 9600, 19200, 38400, 115200, 230400.

Keyset Command

structosdp_cmd_keyset

This command transfers an encryption key from the CP to a PD.

Members
uint8_t type
Type of keys:- 0x01 – Secure Channel Base Key
uint8_t length
Number of bytes of key data - (Key Length in bits + 7) / 8
uint8_t data
Key data

Manufacturer Specific Command

structosdp_cmd_mfg

Manufacturer Specific Commands.

Members
uint32_t vendor_code
3-byte IEEE assigned OUI. Most Significant 8-bits are unused
uint8_t data
Command data
uint8_t length
Length of the data (internal use)

File Transfer Command

structosdp_cmd_file_tx

File transfer start command.

Members
int id
Pre-agreed file ID between CP and PD
uint32_t flags
Reserved and set to zero by OSDP spec. Note: : The upper bits are used by libosdp internally (IOW, not sent over the OSDP bus). Currently the following flags are defined: - OSDP_CMD_FILE_TX_FLAG_CANCEL

Status Report Command

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.