Debugging and Diagnostics

void osdp_logger_init(int log_level, osdp_log_fn_t log_fn)

Configure OSDP Logging.

  • log_level – OSDP log level of the range 0 to 7.

  • log_fn – A printf-like function that will be invoked to write the log buffer. Can be handy if you want to log to file on a UART device without putchar redirection.

const char *osdp_get_version()

Get LibOSDP version as a const char *. Used in diagnostics.

Returns version


const char *osdp_get_source_info()

Get LibOSDP source identifier as a const char *. This string has info about the source tree from which this version of LibOSDP was built. Used in diagnostics.

Returns source

identifier string


uint32_t osdp_get_status_mask(osdp_t *ctx)

Get a bit mask of number of PD that are online currently.

Returns Bit-Mask

(max 32 PDs)

uint32_t osdp_get_sc_status_mask(osdp_t *ctx)

Get a bit mask of number of PD that are online and have an active secure channel currently.

Returns Bit-Mask

(max 32 PDs)

void osdp_set_command_complete_callback(osdp_t *ctx, osdp_command_complete_callback_t cb)

Set osdp_command_complete_callback_t to susbscibe to osdp command or event completion events. This can be used to perform post command actions such as changing the baud rate of the underlying channel after a COMSET command was acknowledged/issued by a peer.