Documentation
Application Commands
LibOSDP exposes the following structures through osdp.h. All commands are carried in a single union wrapper:
OSDP Command Structure. This is a wrapper for all individual OSDP commands.
osdp_queue_node_t _nodeenum osdp_cmd_e iduint32_t flagsstruct osdp_cmd_led ledstruct osdp_cmd_buzzer buzzerstruct osdp_cmd_text textstruct osdp_cmd_output outputstruct osdp_cmd_comset comsetstruct osdp_cmd_keyset keysetstruct osdp_cmd_mfg mfgstruct osdp_cmd_file_tx file_txstruct osdp_status_report statusstruct osdp_notification notifstruct osdp_cmd_bioread bioreadstruct osdp_cmd_biomatch biomatchstruct osdp_cmd_tdset tdsetstruct osdp_cmd_pivdata pivdatastruct osdp_cmd_auth authunion osdp_cmd::@2 @3The id field selects the active union member and is one of osdp_cmd_e:
OSDP application exposed commands.
OSDP_CMD_OUTPUTOSDP_CMD_LEDOSDP_CMD_BUZZEROSDP_CMD_TEXTOSDP_CMD_KEYSETOSDP_CMD_COMSETOSDP_CMD_MFGOSDP_CMD_FILE_TXOSDP_CMD_STATUSOSDP_CMD_COMSET_DONEOSDP_CMD_NOTIFICATIONOSDP_CMD_BIOREADOSDP_CMD_BIOMATCHOSDP_CMD_TDSETOSDP_CMD_PIVDATAOSDP_CMD_GENAUTHOSDP_CMD_CRAUTHOSDP_CMD_SENTINEL0x000000001When set (struct osdp_cmd::flags), the command is sent out with the OSDP packet broadcast flag to the PD.
Below are the structures for each command type. They are submitted to a PD with osdp_cp_submit_command.
LED Command
LED params sub-structure. Part of LED command. See osdp_cmd_led.
uint8_t control_codeuint8_t on_countuint8_t off_countenum osdp_led_color_e on_colorenum osdp_led_color_e off_coloruint16_t timer_countSent from CP to PD to control the behaviour of it's on-board LEDs.
uint8_t readeruint8_t led_numberstruct osdp_cmd_led_params temporarystruct osdp_cmd_led_params permanentLED Colors as specified in OSDP for the on_color/off_color parameters.
OSDP_LED_COLOR_NONEOSDP_LED_COLOR_REDOSDP_LED_COLOR_GREENOSDP_LED_COLOR_AMBEROSDP_LED_COLOR_BLUEOSDP_LED_COLOR_MAGENTAOSDP_LED_COLOR_CYANOSDP_LED_COLOR_WHITEOSDP_LED_COLOR_SENTINELWhat the temporary block of an LED command does.
OSDP_CMD_LED_TEMPORARY_CC_NOPOSDP_CMD_LED_TEMPORARY_CC_CANCELOSDP_CMD_LED_TEMPORARY_CC_SETOSDP_CMD_LED_TEMPORARY_CC_SENTINELWhat the permanent block of an LED command does.
OSDP_CMD_LED_PERMANENT_CC_NOPOSDP_CMD_LED_PERMANENT_CC_SETOSDP_CMD_LED_PERMANENT_CC_SENTINELBuzzer Command
Sent from CP to control the behaviour of a buzzer in the PD.
uint8_t readerenum osdp_cmd_buzzer_control_code_e control_codeuint8_t on_countuint8_t off_countuint8_t rep_countWhat a buzzer command does.
OSDP_CMD_BUZZER_CC_NO_TONEOSDP_CMD_BUZZER_CC_OFFOSDP_CMD_BUZZER_CC_DEFAULT_TONEOSDP_CMD_BUZZER_CC_SENTINELText Command
Command to manipulate any display units that the PD supports.
uint8_t readerenum osdp_cmd_text_control_code_e control_codeuint8_t temp_timeuint8_t offset_rowuint8_t offset_coluint8_t lengthuint8_t dataHow a text command displays its message.
OSDP_CMD_TEXT_CC_PERMANENT_NO_WRAPOSDP_CMD_TEXT_CC_PERMANENT_WRAPOSDP_CMD_TEXT_CC_TEMPORARY_NO_WRAPOSDP_CMD_TEXT_CC_TEMPORARY_WRAPOSDP_CMD_TEXT_CC_SENTINEL32Max text, in bytes, that a text command can carry to a PD's display.
Output Command
Command sent from CP to Control digital output of PD.
uint8_t output_noenum osdp_cmd_output_control_code_e control_codeuint16_t timer_countWhat an output command does to the output line.
OSDP_CMD_OUTPUT_CC_NOPOSDP_CMD_OUTPUT_CC_PERMANENT_OFFOSDP_CMD_OUTPUT_CC_PERMANENT_ONOSDP_CMD_OUTPUT_CC_PERMANENT_OFF_ALLOW_TIMEDOSDP_CMD_OUTPUT_CC_PERMANENT_ON_ALLOW_TIMEDOSDP_CMD_OUTPUT_CC_TEMPORARY_ONOSDP_CMD_OUTPUT_CC_TEMPORARY_OFFOSDP_CMD_OUTPUT_CC_SENTINELComset Command
Sent in response to a COMSET command. Set communication parameters to PD. Must be stored in PD non-volatile memory.
uint8_t addressuint32_t baud_rateKeyset Command
This command sets the SCBK on a PD; see Secure Channel for how keying and install mode work.
This command transfers an encryption key from the CP to a PD.
uint8_t typeuint8_t lengthuint8_t data32Max key length, in bytes, that a keyset command can carry. Not overridable: it must stay large enough to hold the 16-byte SCBK that secure channel is built on.
Manufacturer Specific Command
Manufacturer Specific Commands.
uint32_t vendor_codeuint8_t datauint8_t length64Max vendor defined data, in bytes, that a manufacturer specific command can carry.
Biometric Commands
Command sent from CP to instruct the PD to perform a biometric scan and return the scan data in an OSDP_EVENT_BIOREADR event.
uint8_t readerenum osdp_biometric_type_e typeenum osdp_biometric_format_e formatuint8_t qualityCommand sent from CP to instruct the PD to perform a biometric scan and match it against data, returning the result in an OSDP_EVENT_BIOMATCHR event.
uint8_t readerenum osdp_biometric_type_e typeenum osdp_biometric_format_e formatuint8_t qualityuint16_t lengthuint8_t data128Max biometric template that fits in a single OSDP packet.
Biometric type; the body part to scan. See OSDP spec Table 24.
OSDP_BIO_TYPE_NOT_SPECIFIEDOSDP_BIO_TYPE_RIGHT_THUMB_PRINTOSDP_BIO_TYPE_RIGHT_INDEX_FINGER_PRINTOSDP_BIO_TYPE_RIGHT_MIDDLE_FINGER_PRINTOSDP_BIO_TYPE_RIGHT_RING_FINGER_PRINTOSDP_BIO_TYPE_RIGHT_LITTLE_FINGER_PRINTOSDP_BIO_TYPE_LEFT_THUMB_PRINTOSDP_BIO_TYPE_LEFT_INDEX_FINGER_PRINTOSDP_BIO_TYPE_LEFT_MIDDLE_FINGER_PRINTOSDP_BIO_TYPE_LEFT_RING_FINGER_PRINTOSDP_BIO_TYPE_LEFT_LITTLE_FINGER_PRINTOSDP_BIO_TYPE_RIGHT_IRIS_SCANOSDP_BIO_TYPE_RIGHT_RETINA_SCANOSDP_BIO_TYPE_LEFT_IRIS_SCANOSDP_BIO_TYPE_LEFT_RETINA_SCANOSDP_BIO_TYPE_FULL_FACE_IMAGEOSDP_BIO_TYPE_RIGHT_HAND_GEOMETRYOSDP_BIO_TYPE_LEFT_HAND_GEOMETRYOSDP_BIO_TYPE_SENTINELBiometric data format. See OSDP spec Table 25.
OSDP_BIO_FMT_NOT_SPECIFIEDOSDP_BIO_FMT_RAW_PGMOSDP_BIO_FMT_ANSI_INCITS_378OSDP_BIO_FMT_SENTINELOutcome of a biometric scan, as reported by the PD.
OSDP_BIO_STATUS_SUCCESSOSDP_BIO_STATUS_TIMEOUTOSDP_BIO_STATUS_UNKNOWN_ERRORFile Transfer Command
File transfer start command.
int iduint32_t flags(1UL << 31)A CP only flag that can be used by the application to cancel an in-flight file transfer.
Status Report Command
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.
enum osdp_status_report_type typeint nr_entriesuint8_t reportOSDP Status report types.
OSDP_STATUS_REPORT_INPUTOSDP_STATUS_REPORT_OUTPUTOSDP_STATUS_REPORT_LOCALOSDP_STATUS_REPORT_READER64Maximum number of status entries an osdp_status_report can carry; i.e., the size of its report[] array. Each entry is one status byte, one per tracked entity (input, output, tamper/power, or reader).
NAK Codes
When a PD declines a command it replies with a NAK carrying one of these reason codes.
OSDP specified NAK codes.
OSDP_PD_NAK_NONEOSDP_PD_NAK_MSG_CHKOSDP_PD_NAK_CMD_LENOSDP_PD_NAK_CMD_UNKNOWNOSDP_PD_NAK_SEQ_NUMOSDP_PD_NAK_SC_UNSUPOSDP_PD_NAK_SC_CONDOSDP_PD_NAK_BIO_TYPEOSDP_PD_NAK_BIO_FMTOSDP_PD_NAK_RECORDOSDP_PD_NAK_SENTINEL