template<typename ble_mesh_send_msg_params_t>
class meshXBaseModel< ble_mesh_send_msg_params_t >
Base class for all mesh models.
This class serves as the foundation for all MeshX models, providing common functionality and interfaces for both client and server models.
- Template Parameters
-
| meshXBaseT | Template parameter for base model customization. This should be a derived class that implements platform-specific behavior. |
| ble_mesh_send_msg_params_t | BLE mesh message parameters type. This type defines the structure used for sending BLE mesh messages. |
- Note
- This is an abstract base class that cannot be instantiated directly. Use meshXBaseServerModel or meshXBaseClientModel instead.
template<typename ble_mesh_send_msg_params_t>
Deregister BLE message callback for this model.
Deregisters a callback function associated with a model ID.
Automatically called during model destruction to remove the callback function that handles BLE messages for this model's ID.
- Returns
- MESHX_SUCCESS if deregistration successful, error code otherwise
This function deregisters the callback function associated with the given model ID, allowing the server to stop handling events or messages related to that model.
- Returns
- meshx_err_t Returns an error code indicating the result of the deregistration. Possible values include success or specific error codes.
Reimplemented in meshXBaseClientModel< baseClientModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_model_cb_params_t >, meshXBaseClientModel< meshXBaseGenericClientModel, meshx_gen_client_send_params_t, meshx_gen_cli_cb_param_t >, meshXBaseClientModel< meshXBaseLightClientModel, meshx_gen_light_client_send_params_t, meshx_gen_light_cli_cb_param_t >, meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >, meshXBaseServerModel< meshXBaseConfigServerModel, meshx_config_server_send_params_t, meshx_config_server_restore_params_t, meshx_config_srv_cb_param_t >, meshXBaseServerModel< meshXBaseGenericServerModel, meshx_gen_server_send_params_t, meshx_gen_server_restore_params_t, meshx_gen_srv_cb_param_t >, meshXBaseServerModel< meshXBaseLightServerModel, meshx_light_server_send_params_t, meshx_light_server_restore_params_t, meshx_lighting_server_cb_param_t >, and meshXBaseServerModel< meshXBaseSensorServerModel, meshx_sensor_server_send_params_t, meshx_sensor_server_restore_params_t, meshx_sensor_server_cb_param_t >.
116{
118 {
120 {
121 if (--
it->count == 0)
122 {
127 }
130 }
131 }
132
134}
static std::forward_list< reg_info > registrations
Definition meshx_base_model_class.hpp:68
meshx_err_t control_task_msg_unsubscribe(control_task_msg_code_t msg_code, control_task_msg_evt_t evt_bmap, control_task_msg_handle_t callback)
Deregister a callback for a specific message code and event bitmap.
Definition meshx_control_task.c:172
#define MESHX_LOGD(module_id, format,...)
Definition meshx_log.h:132
Definition meshx_base_model_class.hpp:67
template<typename ble_mesh_send_msg_params_t>
template<typename ble_mesh_send_msg_params_t>
Send message through the model.
Pure virtual function to be implemented by derived classes for sending messages through the BLE mesh network. The implementation should handle the actual transmission of the message to the BLE stack.
- Template Parameters
-
| meshXBaseT | Derived model type |
| ble_mesh_send_msg_params_t | Type for BLE mesh send message parameters |
- Parameters
-
| [in] | params | Pointer to message parameters structure containing:
- opcode: Message opcode
- msg: Pointer to message data
- len: Length of message data
- dst: Destination address
- app_idx: Application key index
- ttl: Time to live value
|
- Returns
- MESHX_SUCCESS on success, error code otherwise
- Return values
-
| MESHX_SUCCESS | Message sent successfully |
| MESHX_ERR_INVALID_ARG | Invalid parameters |
| MESHX_ERR_NO_MEM | Insufficient memory |
| MESHX_ERR_INTERNAL | Internal error |
Implemented in meshXBaseConfigServerModel, meshXBaseGenericClientModel, meshXBaseGenericServerModel, meshXBaseLightClientModel, meshXBaseLightServerModel, and meshXBaseSensorServerModel.