Miscellaneous

Debugging and Diagnostics

void osdp_logger_init(int log_level, osdp_log_fn_t log_fn)

Configure OSDP Logging.

Parameters
  • log_level – OSDP log levels of type enum osdp_log_level_e. Default is LOG_INFO.

  • 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 – string

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

Status

void osdp_get_status_mask(osdp_t *ctx, uint8_t *bitmask)

Get a bit mask of number of PD that are online currently. bitmask must be as large as (num_pds + 7 / 8).

void osdp_get_sc_status_mask(osdp_t *ctx, uint8_t *bitmask)

Get a bit mask of number of PD that are online and have an active secure channel currently. bitmask must be as large as (num_pds + 7 / 8).

void osdp_set_command_complete_callback(osdp_t *ctx, osdp_command_complete_callback_t cb)

Set osdp_command_complete_callback_t to subscribe 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.