SerialAPI#
Modules#
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)
typedef struct _transport_t
Variables#
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)
void
void
comm_interface_init(void)
uint32_t
void
comm_interface_set_ack_timeout_ms(uint32_t t)
uint32_t
void
comm_interface_set_byte_timeout_ms(uint32_t t)
Macros#
#define
CMD_HANDLER_SECTION "_cmd_handlers"
#define
ZW_ADD_CMD (cmd)
#define
#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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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/A | callback | Callback function to invoke. |
N/A | context | 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.5ZeoF8fvV/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/A | frame |
Definition at line
62
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/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/A | cmd | |
N/A | type | |
N/A | payload | |
N/A | len | |
N/A | cb |
Definition at line
67
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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.5ZeoF8fvV/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/A | t |
Definition at line
71
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/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.5ZeoF8fvV/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/A | t |
Definition at line
73
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/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/A | ack |
Definition at line
74
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h
Macro Definition Documentation#
CMD_HANDLER_SECTION#
#define CMD_HANDLER_SECTIONValue:
"_cmd_handlers"
Definition at line
32
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h
ZW_ADD_CMD#
#define ZW_ADD_CMDValue:
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.5ZeoF8fvV/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/cmd_handlers.h
RECEIVE_BUFFER_SIZE#
#define RECEIVE_BUFFER_SIZEValue:
180
Definition at line
20
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h
FRAME_LENGTH_MIN#
#define FRAME_LENGTH_MINValue:
3
Definition at line
21
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h
FRAME_LENGTH_MAX#
#define FRAME_LENGTH_MAXValue:
RECEIVE_BUFFER_SIZE
Definition at line
22
of file /mnt/raid/workspaces/ws.5ZeoF8fvV/overlay/gsdk/protocol/z-wave/Apps/zwave_ncp_serial_api/comm_interface.h