SerialAPI#

Modules#

cmd_handler_map_t

_transport_t

comm_interface_frame_ptr

Enumerations#

enum
TRANSPORT_TYPE_UART
TRANSPORT_TYPE_SPI
TRANSPORT_TYPE_ETHERNET
TRANSPORT_TYPE_UART
TRANSPORT_TYPE_SPI
TRANSPORT_TYPE_ETHERNET
}
enum
PARSE_IDLE
PARSE_FRAME_RECEIVED
PARSE_FRAME_SENT
PARSE_FRAME_ERROR
PARSE_RX_TIMEOUT
PARSE_TX_TIMEOUT
PARSE_IDLE
PARSE_FRAME_RECEIVED
PARSE_FRAME_SENT
PARSE_FRAME_ERROR
PARSE_RX_TIMEOUT
PARSE_TX_TIMEOUT
}

Typedefs#

typedef void(*
cmd_handler_t)(const comm_interface_frame_ptr)
typedef void *
typedef bool(*
cmd_foreach_callback_t)(cmd_handler_map_t const *const p_cmd_entry, cmd_context_t context)
typedef void *
typedef void(*
transmit_done_cb_t)(transport_handle_t transport)

Functions#

bool
invoke_cmd_handler(const comm_interface_frame_ptr frame)

Invoke command handler.

void
cmd_foreach(cmd_foreach_callback_t callback, cmd_context_t context)

Invokes callback for each registered command.

uint8_t
frame_payload_len(const comm_interface_frame_ptr frame)
void
comm_interface_transmit_frame(uint8_t cmd, uint8_t type, const uint8_t *payload, uint8_t len, transmit_done_cb_t cb)

Macros#

#define
CMD_HANDLER_SECTION "_cmd_handlers"
#define
#define
FRAME_LENGTH_MAX RECEIVE_BUFFER_SIZE

Enumeration Documentation#

transport_type_t#

transport_type_t
Enumerator
TRANSPORT_TYPE_UART
TRANSPORT_TYPE_SPI
TRANSPORT_TYPE_ETHERNET
TRANSPORT_TYPE_UART
TRANSPORT_TYPE_SPI
TRANSPORT_TYPE_ETHERNET

Definition at line 24 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_parse_result_t#

comm_interface_parse_result_t
Enumerator
PARSE_IDLE
PARSE_FRAME_RECEIVED
PARSE_FRAME_SENT
PARSE_FRAME_ERROR
PARSE_RX_TIMEOUT
PARSE_TX_TIMEOUT
PARSE_IDLE
PARSE_FRAME_RECEIVED
PARSE_FRAME_SENT
PARSE_FRAME_ERROR
PARSE_RX_TIMEOUT
PARSE_TX_TIMEOUT

Definition at line 31 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

Typedef Documentation#

cmd_handler_t#

typedef void(* cmd_handler_t) (const comm_interface_frame_ptr) )(const comm_interface_frame_ptr)

Definition at line 23 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h

cmd_context_t#

typedef void* cmd_context_t

Definition at line 47 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h

cmd_foreach_callback_t#

typedef bool(* cmd_foreach_callback_t) (cmd_handler_map_t const *const p_cmd_entry, cmd_context_t context) )(cmd_handler_map_t const *const p_cmd_entry, cmd_context_t context)

Definition at line 49 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h

transport_handle_t#

typedef void* transport_handle_t

Definition at line 41 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

transmit_done_cb_t#

typedef void(* transmit_done_cb_t) (transport_handle_t transport) )(transport_handle_t transport)

Definition at line 43 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

transport_t#

typedef struct _transport_t transport_t

Definition at line 49 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

Variable Documentation#

serial_frame#

comm_interface_frame_ptr const serial_frame

Definition at line 60 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

Function Documentation#

invoke_cmd_handler#

bool invoke_cmd_handler (const comm_interface_frame_ptr frame)

Invoke command handler.

Parameters
[in]frame

Frame

Returns

  • true if handler for given frame was invoked, false if no handler was found


Definition at line 45 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h

cmd_foreach#

void cmd_foreach (cmd_foreach_callback_t callback, cmd_context_t context)

Invokes callback for each registered command.

Parameters
N/Acallback

Callback function to invoke.

N/Acontext

Context to pass on to the callback function.

Will stop if the callback returns true.


Definition at line 59 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h

frame_payload_len#

static uint8_t frame_payload_len (const comm_interface_frame_ptr frame)
Parameters
N/Aframe

Definition at line 62 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_transmit_frame#

void comm_interface_transmit_frame (uint8_t cmd, uint8_t type, const uint8_t * payload, uint8_t len, transmit_done_cb_t cb)
Parameters
N/Acmd
N/Atype
N/Apayload
N/Alen
N/Acb

Definition at line 67 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_wait_transmit_done#

void comm_interface_wait_transmit_done (void )
Parameters
N/A

Definition at line 68 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_init#

void comm_interface_init (void )
Parameters
N/A

Definition at line 69 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_get_ack_timeout_ms#

uint32_t comm_interface_get_ack_timeout_ms (void )
Parameters
N/A

Definition at line 70 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_set_ack_timeout_ms#

void comm_interface_set_ack_timeout_ms (uint32_t t)
Parameters
N/At

Definition at line 71 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_get_byte_timeout_ms#

uint32_t comm_interface_get_byte_timeout_ms (void )
Parameters
N/A

Definition at line 72 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_set_byte_timeout_ms#

void comm_interface_set_byte_timeout_ms (uint32_t t)
Parameters
N/At

Definition at line 73 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

comm_interface_parse_data#

comm_interface_parse_result_t comm_interface_parse_data (bool ack)
Parameters
N/Aack

Definition at line 74 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

Macro Definition Documentation#

CMD_HANDLER_SECTION#

#define CMD_HANDLER_SECTION
Value:
"_cmd_handlers"

Definition at line 32 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h

ZW_ADD_CMD#

#define ZW_ADD_CMD
Value:
static void cmd_handler_fcn_##cmd(__attribute__((unused)) const comm_interface_frame_ptr frame); /* Prototype */ \
static const cmd_handler_map_t cmd_handler_##cmd __attribute__((__used__, __section__( CMD_HANDLER_SECTION ))) = {cmd,cmd_handler_fcn_##cmd}; \
static void cmd_handler_fcn_##cmd(__attribute__((unused)) const comm_interface_frame_ptr frame)

Definition at line 34 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h

RECEIVE_BUFFER_SIZE#

#define RECEIVE_BUFFER_SIZE
Value:
180

Definition at line 20 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

FRAME_LENGTH_MIN#

#define FRAME_LENGTH_MIN
Value:
3

Definition at line 21 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h

FRAME_LENGTH_MAX#

#define FRAME_LENGTH_MAX
Value:
RECEIVE_BUFFER_SIZE

Definition at line 22 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h