PD Info

osdp_pd_info_t is a user provided structure which describes how the PD has to be setup. In CP mode, the app described the PDs it would like to communicate with using an array of osdp_pd_info_t structures.

struct osdp_pd_info_t

OSDP PD Information. This struct is used to describe a PD to LibOSDP.

Public Members

const char *name

User provided name for this PD (log messages include this name)

int baud_rate

Can be one of 9600/19200/38400/57600/115200/230400

int address

7 bit PD address. the rest of the bits are ignored. The special address 0x7F is used for broadcast. So there can be 2^7-1 devices on a multi-drop channel

int flags

Used to modify the way the context is setup. See OSDP_FLAG_* macros.

struct osdp_pd_id id

Static information that the PD reports to the CP when it received a CMD_ID. These information must be populated by a PD application.

const struct osdp_pd_cap *cap

This is a pointer to an array of structures containing the PD’ capabilities. Use { -1, 0, 0 } to terminate the array. This is used only PD mode of operation

struct osdp_channel channel

Communication channel ops structure, containing send/recv function pointers

const uint8_t *scbk

Pointer to 16 bytes of Secure Channel Base Key for the PD. If non-null, this is used to set-up the secure channel.

Setup Flags

OSDP setup in CP or PD mode can be infulenced by the following flags (set in osdp_pd_info_t::flags). Some of them are effective only in CP or PD mode; see individual flag documentation below.

OSDP_FLAG_ENFORCE_SECURE

OSDP setup flags. See osdp_pd_info_t::flags.

ENFORCE_SECURE: Make security conscious assumptions (see below) where possible. Fail where these assumptions don’t hold.

  • Don’t allow use of SCBK-D.

  • Assume that a KEYSET was successful at an earlier time.

Note

This flag is recommended in production use.

OSDP_FLAG_INSTALL_MODE

When set, the PD would allow one session of secure channel to be setup with SCBK-D.

Note

In this mode, the PD is in a vulnerable state, the application is responsible for making sure that the device enters this mode only during controlled/provisioning-time environments.

OSDP_FLAG_IGN_UNSOLICITED

When set, CP will not error and fail when the PD sends an unknown, unsolicited response (in response to osdp_POLL command).

Note

In PD mode this flag has no use.

OSDP_FLAG_ENABLE_NOTIFICATION

Enable LibOSDP notification events - osdp_event_notification - to be reported using the event callback method registered by the application.

Note

These events, unlike others, are not generated by the PD.

Note

This is a CP mode only flag; in PD mode this flag has no use.

OSDP_FLAG_CAPTURE_PACKETS

Capture raw osdp packets as seen by this device to a pcap file. LibOSDP must be built with CONFIG_OSDP_PACKET_TRACE or CONFIG_OSDP_DATA_TRACE for this flag to be in effect.

Note

The app must call osdp_{cp,pd}_teardown() before existing for the capture file to be finalized and written to the disk.

OSDP_FLAG_ALLOW_EMPTY_ENCRYPTED_DATA_BLOCK

Allow an empty encrypted data block(SCS_17 and SCS_18 packets). This is non-conforming to the standard. If there is no data to be transferred, the CP should instead use the SCS_15/SCS_16 messages. Some OSDP implementations are buggy and send a 0-length data block with the SCS_17 and SCS_18 messages, this flag accepts that buggy behavior.

Note

this is a PD mode only flag