#include <meshx_base_model_class.hpp>
◆ base_server_model_cb_reg_t
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| using meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::base_server_model_cb_reg_t |
|
private |
Initial value:struct base_server_model_cb_reg
{
}
uint32_t model_id
Definition meshx_base_model_class.hpp:52
meshx_ptr_t p_plat_model
Definition meshx_base_model_class.hpp:202
meshXBaseServerModel()=delete
std::function< meshx_err_t(dev_struct_t *, control_task_msg_evt_t, meshx_ptr_t)> control_msg_cb
Definition meshx_base_model_class.hpp:32
void * meshx_ptr_t
Definition meshx_ble_mesh_cmn_def.h:636
194 {
199 };
Definition meshx_base_model_class.hpp:189
◆ meshXBaseServerModel() [1/2]
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::meshXBaseServerModel |
( |
| ) |
|
|
delete |
◆ ~meshXBaseServerModel()
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
◆ meshXBaseServerModel() [2/2]
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::meshXBaseServerModel |
( |
uint32_t | model_id, |
|
|
meshx_ptr_t | p_plat_model, |
|
|
const control_msg_cb & | from_ble_cb ) |
Constructor for the meshXBaseServerModel class.
This constructor initializes the meshXBaseServerModel class with the given model ID and callback function.
- Parameters
-
| [in] | model_id | The unique identifier of the generic server model. |
| [in] | p_plat_model | Pointer to the platform-specific model structure. |
| [in] | from_ble_cb | The callback function to be registered for the model. |
154{
157 {
160 return;
161 }
162
165}
meshx_err_t status
Definition meshx_base_model_class.hpp:55
control_task_msg_handle_t from_ble_cb
Definition meshx_base_model_class.hpp:54
static std::forward_list< base_server_model_cb_reg_t > base_server_model_cb_list
Definition meshx_base_model_class.hpp:204
static meshx_err_t base_from_ble_msg_handle(dev_struct_t *pdev, control_task_msg_evt_t evt, meshx_ptr_t params)
Sends a BLE message from a server model.
Definition meshx_base_model_class.cpp:176
#define MESHX_LOGE(module_id, format,...)
Definition meshx_log.h:114
◆ base_from_ble_msg_handle()
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
Sends a BLE message from a server model.
- Parameters
-
| [in] | pdev | Pointer to the device structure. |
| [in] | evt | The event type associated with the message. |
| [in] | params | Pointer to the parameters of the message. |
- Returns
- meshx_err_t Returns an error code indicating the result of the send operation.
178{
181
184
187 {
189 {
190
192 {
193 continue;
194 }
195
197 {
200 }
201 }
202 }
203
205 {
207 }
208
210}
#define MESHX_LOGW(module_id, format,...)
Definition meshx_log.h:120
◆ from_ble_dereg_cb()
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| meshx_err_t meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::from_ble_dereg_cb |
( |
void | | ) |
const |
|
overridevirtual |
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 from meshXBaseModel< ble_mesh_send_msg_params_t >.
214{
215
217
218
221 });
222
224}
struct base_server_model_cb_reg { uint16_t model_id; meshx_ptr_t p_plat_model; control_msg_cb cb; meshXBaseServerModel *instance; } base_server_model_cb_reg_t
Definition meshx_base_model_class.hpp:193
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
◆ server_state_restore()
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| virtual meshx_err_t meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::server_state_restore |
( |
ble_mesh_plat_restore_params_t * | param | ) |
|
|
pure virtual |
◆ set_plat_model_ptr()
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| void meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::set_plat_model_ptr |
( |
meshx_ptr_t | p_model | ) |
|
Set the platform model pointer and update the registration list.
- Parameters
-
| [in] | p_model | Pointer to the platform model instance. |
228{
231 {
232 if (
node.instance ==
this)
233 {
235 break;
236 }
237 }
238}
◆ validate_server_status_opcode()
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| virtual meshx_err_t meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::validate_server_status_opcode |
( |
uint16_t | opcode | ) |
|
|
protectedpure virtual |
◆ base_server_model_cb_list
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
◆ p_plat_model
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| meshx_ptr_t meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::p_plat_model |
|
protected |
◆ plat_server_init_flag
template<typename baseServerModelDerived_t, typename ble_mesh_send_msg_params_t, typename ble_mesh_plat_restore_params_t, typename ble_mesh_plat_cb_params_t>
| std::once_flag meshXBaseServerModel< baseServerModelDerived_t, ble_mesh_send_msg_params_t, ble_mesh_plat_restore_params_t, ble_mesh_plat_cb_params_t >::plat_server_init_flag |
|
staticprotected |
The documentation for this class was generated from the following files: