|
MeshX 0.4
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
|
| meshXClientModel< meshxBaseClientModel_t, meshx_send_packet_params_t >::meshXClientModel | ( | MESHX_MODEL * | p_plat_model, |
| uint32_t | model_id, | ||
| meshXElementIF * | parent_element = nullptr, | ||
| meshx_ptr_t | parent_element_state = nullptr, | ||
| uint16_t | model_func_id = 0 ) |
Construct a new meshXClientModel.
Constructs a new meshXClientModel instance.
| [in] | p_plat_model | Platform model instance |
| [in] | model_id | Model identifier |
| [in] | parent_element | Parent element interface (optional) |
| [in] | parent_element_state | Parent element state pointer (optional) |
| [in] | model_func_id | Model function ID within the element (optional) |
| meshXModel< meshxBaseModel_t, meshx_send_packet_params_t >::meshXModel | ( | MESHX_MODEL * | p_plat_model, |
| uint32_t | model_id, | ||
| meshXElementIF * | parent_element = nullptr, | ||
| uint16_t | model_func_id = 0 ) |
Constructs a new meshXModel instance.
This constructor initializes a meshXModel object with the given platform model, model ID, and optional parent element. It sets up the base model and model interface for BLE mesh communication.
| [in] | p_plat_model | Pointer to the platform model instance |
| [in] | model_id | Unique identifier for this model |
| [in] | parent_element | Optional pointer to the parent element |
| [in] | model_func_id | Optional model function ID within the element |
| meshXServerModel< meshxBaseServerModel_t, meshx_send_packet_params_t >::meshXServerModel | ( | MESHX_MODEL * | p_plat_model, |
| uint32_t | model_id, | ||
| meshXElementIF * | parent_element = nullptr, | ||
| meshx_ptr_t | parent_element_state = nullptr, | ||
| uint16_t | model_func_id = 0 ) |
Construct a new Server Model.
Constructs a new meshXServerModel instance.
| [in] | p_plat_model | Platform-specific model instance |
| [in] | model_id | Unique identifier for this model |
| [in] | parent_element | Parent element interface (optional) |
| [in] | parent_element_state | Parent element state pointer (optional) |
| [in] | model_func_id | Model function ID within the element (optional) |
Initializes a server model with platform-specific implementation and associates it with an optional parent element
| meshx_err_t meshXModel< meshxBaseModel_t, meshx_send_packet_params_t >::model_handle_from_ble_cb | ( | dev_struct_t * | p_dev, |
| evt_model_id_t | evt_model_id, | ||
| meshx_ptr_t | params ) |
Handle upstream BLE Mesh events.
Callback function invoked when a BLE event is received for the model.
Static callback function that routes messages and events coming from the BLE Mesh network to the appropriate model instance. This function extracts the model instance from the device structure and invokes the instance's model_from_ble_cb method.
| [in] | p_dev | Device structure containing sender information |
| [in] | evt_model_id | Event type indicating the nature of the message |
| [in] | params | Event-specific data payload |
|
finalprivatevirtual |
Create platform-specific client model instance.
Creates and initializes a client model instance.
Final implementation of the model creation process for client models. This function handles the initialization of client-specific features and cannot be overridden by derived classes.
This function handles the platform-specific model creation process for client models. It initializes client-specific features and cannot be overridden by derived classes.
| MESHX_MODEL | Platform-specific model type |
| meshxBaseModel_t | Base model implementation type |
| meshx_send_packet_params_t | Type for send packet parameters |
Implements meshXModelIF.
|
finalprivatevirtual |
Delete platform-specific client model instance.
Deletes the client model instance.
Final implementation of the model deletion process for client models. This function handles the cleanup of client-specific resources and cannot be overridden by derived classes.
This function is responsible for deleting the client model instance and releasing any associated resources.
Implements meshXModelIF.
| meshx_err_t meshXModel< meshxBaseModel_t, meshx_send_packet_params_t >::send_to_parent_element | ( | meshx_ptr_t | msg_ptr, |
| size_t | msg_size ) |
Send message to parent element.
Common implementation for sending messages to the parent element. This handles the common pattern of checking parent element, calling element_state_change_handle(), and calling on_model_cb(). Type-specific header casting is delegated to update_element_state_change_header().
| [in] | msg_ptr | Pointer to the message structure |
| [in] | msg_size | Size of the message structure |
Common implementation to send a message to the parent element.
|
overridevirtual |
Set the platform-specific model instance.
| [in] | p_model | Pointer to the platform model instance |
Reimplemented from meshXModelIF.
|
overrideprotectedvirtual |
Update element_state_change field in client message header.
Overrides base class implementation to handle client-specific header structure (meshx_cli_model_send_param_header_t) which includes err_code and ctx fields.
| [in] | element_state_change | Result from element_state_change_handle() |
| [in] | msg_ptr | Pointer to the message structure |
Implements meshXModel< meshxBaseClientModel_t, meshx_send_packet_params_t >.
|
overrideprotectedvirtual |
Update element_state_change field in server message header.
Overrides base class implementation to handle server-specific header structure (meshx_srv_model_send_param_header_t) which doesn't include err_code and ctx.
| [in] | element_state_change | Result from element_state_change_handle() |
| [in] | msg_ptr | Pointer to the message structure |
Implements meshXModel< meshxBaseServerModel_t, meshx_send_packet_params_t >.
|
virtual |
Destructor for meshXModel.
Virtual destructor to ensure proper cleanup of derived classes and the base_model member.