Documentation
Miscellaneous
Debugging and Diagnostics
void osdp_logger_init(const char *name, int log_level, osdp_log_puts_fn_t puts_fn)Configure OSDP Logging.
nameA soft name for this module; will appear in all the log lines.log_levelOSDP log levels of type enum osdp_log_level_e. Default is LOG_INFO.puts_fnA puts() 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. See osdp_log_puts_fn_t definition to see the behavioral expectations. When this is set to NULL, LibOSDP will log to stderr.const char * osdp_get_version()Get LibOSDP version as a const char *. Used in diagnostics.
versionstringconst 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.
sourceidentifier stringStatus
void osdp_get_status_mask(const osdp_t *ctx, uint8_t *bitmask)Get a bit mask of number of PD that are online currently.
ctxOSDP contextbitmaskpointer to an array of bytes. must be as large as (num_pds + 7 / 8).void osdp_get_sc_status_mask(const osdp_t *ctx, uint8_t *bitmask)Get a bit mask of number of PD that are online and have an active secure channel currently.
ctxOSDP contextbitmaskpointer to an array of bytes. must be as large as (num_pds + 7 / 8).File Operations
OSDP File operations struct that needs to be filled by the CP/PD application and registered with LibOSDP using osdp_file_register_ops() before a file transfer command can be initiated.
void * argosdp_file_open_fn_t openosdp_file_read_fn_t readosdp_file_write_fn_t writeosdp_file_close_fn_t closeint osdp_file_register_ops(osdp_t *ctx, int pd, const struct osdp_file_ops *ops)Register a global file operations struct with OSDP. Both CP and PD modes should have done so already before CP can sending a OSDP_CMD_FILE_TX.
ctxOSDP contextpdPD number in case of CP. This param is ignored in PD modeopsPopulated file operations struct0on success. -1 on errors.int osdp_get_file_tx_status(const osdp_t *ctx, int pd, int *size, int *offset)Query file transfer status if one is in progress. Calling this method when there is no file transfer progressing will return error.
ctxOSDP contextpdPD number in case of CP. This param is ignored in PD modesizeTotal size of the file (as obtained from file_ops->open())offsetOffset into the file that has been sent/received (CP/PD)0on success. -1 on errors.