nRF5 SDK for Mesh v5.0.0
Data Structures | Typedefs | Functions
Generic model serial handler

Helps implement model specific serial handler functionality. More...

Data Structures

struct  serial_handler_models_info_t
 Information struct for registering a model with the serial handler to make it available over serial. More...
 

Typedefs

typedef uint32_t(* serial_handler_models_model_init_cb_t) (const serial_cmd_model_specific_init_t *p_init_params, access_model_handle_t *p_model_handle)
 Initializer callback prototype used by the serial handler to forward init calls to each model. More...
 
typedef uint32_t(* serial_handler_models_model_command_cb_t) (const serial_cmd_model_specific_command_t *p_command_params, serial_evt_cmd_rsp_data_model_cmd_t *p_cmd_rsp)
 Command callback prototype for processing model specific commands. More...
 

Functions

void serial_handler_models_rx (const serial_packet_t *p_cmd)
 Handle model specific serial commands. More...
 
uint32_t serial_handler_models_register (const serial_handler_models_info_t *p_model_info)
 Registers a model with the serial handler so that the models presence can be seen via serial and commands can be forwarded to the model. More...
 

Detailed Description

Helps implement model specific serial handler functionality.

Typedef Documentation

◆ serial_handler_models_model_init_cb_t

typedef uint32_t(* serial_handler_models_model_init_cb_t) (const serial_cmd_model_specific_init_t *p_init_params, access_model_handle_t *p_model_handle)

Initializer callback prototype used by the serial handler to forward init calls to each model.

Parameters
[in]p_init_paramsThe model initializer parameters
[out]p_model_handleThe pointer to a valid model handle strucure, by which the allocated model handle is returned.
Return values
NRF_SUCCESSCommand executed successfully.

Definition at line 61 of file serial_handler_models.h.

◆ serial_handler_models_model_command_cb_t

typedef uint32_t(* serial_handler_models_model_command_cb_t) (const serial_cmd_model_specific_command_t *p_command_params, serial_evt_cmd_rsp_data_model_cmd_t *p_cmd_rsp)

Command callback prototype for processing model specific commands.

Parameters
[in]p_command_paramsThe command parameters
[out]p_cmd_rspThe pointer to a valid command response strucure, to be filled out by the model handler.
Return values
NRF_SUCCESSCommand executed successfully.

Definition at line 72 of file serial_handler_models.h.

Function Documentation

◆ serial_handler_models_rx()

void serial_handler_models_rx ( const serial_packet_t p_cmd)

Handle model specific serial commands.

Parameters
[in]p_cmdSerial command to handle.

◆ serial_handler_models_register()

uint32_t serial_handler_models_register ( const serial_handler_models_info_t p_model_info)

Registers a model with the serial handler so that the models presence can be seen via serial and commands can be forwarded to the model.

Parameters
[in]p_model_infoThe model information required to register the model with the serial handler.
Return values
NRF_SUCCESSThe model is successfully registered.
NRF_ERROR_NULLThe callbacks must be valid function pointers.

Documentation feedback | Developer Zone | Subscribe | Updated