Data Structures | |
struct | serial_handler_common_opcode_to_fp_map_t |
Structure for mapping a command opcode to the command processing function. More... | |
Typedefs | |
typedef void(* | serial_handler_common_cmd_cb_t) (const serial_packet_t *p_cmd) |
Command processing function call back dedicated to a specific command. More... | |
Functions | |
void | serial_handler_common_cmd_rsp_nodata_on_error (uint8_t opcode, uint32_t status, const uint8_t *p_data, uint16_t length) |
Send command response with the given data if the status is NRF_SUCCESS , otherwise sends NULL. More... | |
void | serial_handler_common_rx (const serial_packet_t *p_cmd, const serial_handler_common_opcode_to_fp_map_t *p_cmd_handlers, uint32_t no_handlers) |
RX handler pattern for serial packets. More... | |
typedef void(* serial_handler_common_cmd_cb_t) (const serial_packet_t *p_cmd) |
Command processing function call back dedicated to a specific command.
[in] | p_cmd | The serial command received |
Definition at line 62 of file serial_handler_common.h.
void serial_handler_common_cmd_rsp_nodata_on_error | ( | uint8_t | opcode, |
uint32_t | status, | ||
const uint8_t * | p_data, | ||
uint16_t | length | ||
) |
Send command response with the given data if the status is NRF_SUCCESS
, otherwise sends NULL.
[in] | opcode | The opcode of the command. |
[in] | status | Status as defined by NRF_ERROR_H__ |
[in] | p_data | The pointer to the data to be sent. Can be NULL if length is 0. |
[in] | length | The length of the p_data in bytes. |
void serial_handler_common_rx | ( | const serial_packet_t * | p_cmd, |
const serial_handler_common_opcode_to_fp_map_t * | p_cmd_handlers, | ||
uint32_t | no_handlers | ||
) |
RX handler pattern for serial packets.
[in] | p_cmd | The serial command received |
[in] | p_cmd_handlers | A populated array of command handlers. |
[in] | no_handlers | Number of handler in p_cmd_handlers . |