nRF5 SDK for Mesh v5.0.0
Data Structures | Typedefs | Functions
Common serial handler functions

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...
 

Detailed Description

Typedef Documentation

◆ serial_handler_common_cmd_cb_t

typedef void(* serial_handler_common_cmd_cb_t) (const serial_packet_t *p_cmd)

Command processing function call back dedicated to a specific command.

Parameters
[in]p_cmdThe serial command received

Definition at line 62 of file serial_handler_common.h.

Function Documentation

◆ serial_handler_common_cmd_rsp_nodata_on_error()

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.

Parameters
[in]opcodeThe opcode of the command.
[in]statusStatus as defined by NRF_ERROR_H__
[in]p_dataThe pointer to the data to be sent. Can be NULL if length is 0.
[in]lengthThe length of the p_data in bytes.

◆ serial_handler_common_rx()

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.

Parameters
[in]p_cmdThe serial command received
[in]p_cmd_handlersA populated array of command handlers.
[in]no_handlersNumber of handler in p_cmd_handlers.

Documentation feedback | Developer Zone | Subscribe | Updated