Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
Open Supervised Device Protocol (OSDP) public API header file. More...
Go to the source code of this file.
Data Structures | |
struct | osdp_cmd_output |
Command sent from CP to Control digital output of PD. More... | |
struct | osdp_cmd_led_params |
LED params sub-structure. More... | |
struct | osdp_cmd_led |
Sent from CP to PD to control the behaviour of it's on-board LEDs. More... | |
struct | osdp_cmd_buzzer |
Sent from CP to control the behaviour of a buzzer in the PD. More... | |
struct | osdp_cmd_text |
Command to manipulate any display units that the PD supports. More... | |
struct | osdp_cmd_comset |
Sent in response to a COMSET command. More... | |
struct | osdp_cmd_keyset |
This command transfers an encryption key from the CP to a PD. More... | |
struct | osdp_cmd |
OSDP Command Structure. More... | |
struct | osdp_event_cardread |
OSDP event cardread. More... | |
struct | osdp_event_keypress |
OSDP Event Keypad. More... | |
struct | osdp_event |
OSDP Event structure. More... | |
Macros | |
#define | OSDP_CMD_TEXT_MAX_LEN 32 |
Max length of text for text command. | |
#define | OSDP_CMD_KEYSET_KEY_MAX_LEN 32 |
Max length of key data for keyset command. | |
#define | OSDP_EVENT_MAX_DATALEN 64 |
Max length of event data. | |
Typedefs | |
typedef int(* | pd_command_callback_t) (void *arg, struct osdp_cmd *cmd) |
Callback for PD command notifications. | |
typedef int(* | cp_event_callback_t) (void *arg, int pd, struct osdp_event *ev) |
Callback for CP event notifications. | |
Enumerations | |
enum | osdp_led_color_e { OSDP_LED_COLOR_NONE , OSDP_LED_COLOR_RED , OSDP_LED_COLOR_GREEN , OSDP_LED_COLOR_AMBER , OSDP_LED_COLOR_BLUE , OSDP_LED_COLOR_SENTINEL } |
LED Colors as specified in OSDP for the on_color/off_color parameters. More... | |
enum | osdp_cmd_e { OSDP_CMD_OUTPUT = 1 , OSDP_CMD_LED , OSDP_CMD_BUZZER , OSDP_CMD_TEXT , OSDP_CMD_KEYSET , OSDP_CMD_COMSET , OSDP_CMD_SENTINEL } |
OSDP application exposed commands. More... | |
enum | osdp_event_cardread_format_e { OSDP_CARD_FMT_RAW_UNSPECIFIED , OSDP_CARD_FMT_RAW_WIEGAND , OSDP_CARD_FMT_ASCII , OSDP_CARD_FMT_SENTINEL } |
Various card formats that a PD can support. More... | |
enum | osdp_event_type { OSDP_EVENT_CARDREAD , OSDP_EVENT_KEYPRESS , OSDP_EVENT_SENTINEL } |
OSDP PD Events. More... | |
Functions | |
Peripheral Device mode APIs | |
| |
void | osdp_pd_set_command_callback (pd_command_callback_t cb, void *arg) |
Set callback method for PD command notification. | |
int | osdp_pd_notify_event (const struct osdp_event *event) |
API to notify PD events to CP. | |
OSDP Secure Channel APIs | |
| |
uint32_t | osdp_get_sc_status_mask (void) |
Get the current SC status mask. | |
Open Supervised Device Protocol (OSDP) public API header file.
#define OSDP_CMD_KEYSET_KEY_MAX_LEN 32 |
Max length of key data for keyset command.
#define OSDP_CMD_TEXT_MAX_LEN 32 |
Max length of text for text command.
#define OSDP_EVENT_MAX_DATALEN 64 |
Max length of event data.
typedef int(* cp_event_callback_t) (void *arg, int pd, struct osdp_event *ev) |
Callback for CP event notifications.
After it has been registered with osdp_cp_set_event_callback
, this method is invoked when the CP receives an event from the PD.
arg | Opaque pointer provided by the application during callback registration. |
pd | the offset (0-indexed) of this PD in kconfig OSDP_PD_ADDRESS_LIST |
ev | pointer to osdp_event struct (filled by libosdp). |
0 | on handling the event successfully. |
-ve | on errors. |
Callback for PD command notifications.
After it has been registered with osdp_pd_set_command_callback
, this method is invoked when the PD receives a command from the CP.
arg | pointer that will was passed to the arg param of osdp_pd_set_command_callback . |
cmd | pointer to the received command. |
0 | if LibOSDP must send a osdp_ACK response |
-ve | if LibOSDP must send a osdp_NAK response |
+ve | and modify the passed struct osdp_cmd *cmd if LibOSDP must send a specific response. This is useful for sending manufacturer specific reply osdp_MFGREP . |
enum osdp_cmd_e |
OSDP application exposed commands.
enum osdp_event_type |
enum osdp_led_color_e |
uint32_t osdp_get_sc_status_mask | ( | void | ) |
Get the current SC status mask.
int osdp_pd_notify_event | ( | const struct osdp_event * | event | ) |
API to notify PD events to CP.
These events are sent to the CP as an alternate response to a POLL command.
event | pointer to event struct. Must be filled by application. |
0 | on success |
-1 | on failure |
void osdp_pd_set_command_callback | ( | pd_command_callback_t | cb, |
void * | arg | ||
) |
Set callback method for PD command notification.
This callback is invoked when the PD receives a command from the CP.
cb | The callback function's pointer |
arg | A pointer that will be passed as the first argument of cb |