MeshX 0.3
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.
|
Header file for Generic Server Models in MeshX BLE Mesh. More...
Go to the source code of this file.
Typedefs | |
typedef struct meshx_gen_srv_cb_param | meshx_gen_srv_cb_param_t |
typedef control_task_msg_handle_t | meshx_server_cb |
Functions | |
meshx_err_t | meshx_plat_on_off_gen_srv_create (void *p_model, void **p_pub, void **p_onoff_srv) |
Creates a Generic OnOff Server model and its publication context. | |
meshx_err_t | meshx_plat_gen_srv_delete (void **p_pub, void **p_srv) |
Deletes the Generic OnOff Server model and its associated resources. | |
meshx_err_t | meshx_plat_set_gen_srv_state (void *p_model, uint8_t on_off_state) |
Set the state of a generic server model. | |
meshx_err_t | meshx_plat_gen_srv_init (void) |
Initialize the generic server model platform. | |
meshx_err_t | meshx_plat_gen_on_off_srv_restore (void *p_model, uint8_t state) |
Restores the state of the Generic OnOff Server model. | |
meshx_err_t | meshx_plat_gen_srv_send_status (meshx_model_t *p_model, meshx_ctx_t *p_ctx, meshx_ptr_t p_data, uint32_t data_len) |
Send a status message from the Generic Server model. | |
Header file for Generic Server Models in MeshX BLE Mesh.
Copyright (c) 2024 - 2025 MeshX
This file defines the structures, types, and APIs for implementing Generic Server Models in the MeshX BLE Mesh stack. It includes definitions for various state change events, server callbacks, and functions to create, delete, and manage the state of Generic Server Models.
Definition in file meshx_ble_mesh_gen_srv.h.
typedef struct meshx_gen_srv_cb_param meshx_gen_srv_cb_param_t |
Definition at line 146 of file meshx_ble_mesh_gen_srv.h.
meshx_err_t meshx_plat_gen_on_off_srv_restore | ( | void * | p_model, |
uint8_t | state ) |
Restores the state of the Generic OnOff Server model.
This function sets the user data of the specified model to the given state. It checks if the model pointer is valid before proceeding with the operation.
[in] | p_model | Pointer to the model structure. |
[in] | state | The state to be restored in the model. |
Definition at line 247 of file esp_gen_srv_model.c.
meshx_err_t meshx_plat_gen_srv_delete | ( | void ** | p_pub, |
void ** | p_srv ) |
Deletes the Generic OnOff Server model and its associated resources.
This function frees the memory allocated for the Generic OnOff Server and sets the pointer to NULL. It also deletes the model publication resources associated with the server.
[in,out] | p_pub | Pointer to the publication structure to be deleted. |
[in,out] | p_srv | Pointer to the Generic Server structure to be freed. |
Definition at line 236 of file esp_gen_srv_model.c.
meshx_err_t meshx_plat_gen_srv_init | ( | void | ) |
Initialize the generic server model platform.
Initialize the generic server model platform.
This function sets up the necessary configurations and initializes the meshxuction generic server for the BLE mesh node.
Definition at line 210 of file esp_gen_srv_model.c.
meshx_err_t meshx_plat_gen_srv_send_status | ( | meshx_model_t * | p_model, |
meshx_ctx_t * | p_ctx, | ||
meshx_ptr_t | p_data, | ||
uint32_t | data_len ) |
Send a status message from the Generic Server model.
This function sends a status message to the specified context with the provided data.
[in] | p_model | Pointer to the model instance. |
[in] | p_ctx | Pointer to the context structure containing destination address and other parameters. |
[in] | p_data | Pointer to the data to be sent. |
[in] | data_len | Length of the data to be sent. |
Definition at line 142 of file esp_gen_srv_model.c.
meshx_err_t meshx_plat_on_off_gen_srv_create | ( | void * | p_model, |
void ** | p_pub, | ||
void ** | p_onoff_srv ) |
Creates a Generic OnOff Server model and its publication context.
This function initializes the Generic OnOff Server model, its publication context, and allocates memory for the server instance. It checks for invalid arguments and handles memory allocation failures.
[out] | p_model | Pointer to the model structure to be created. |
[out] | p_pub | Pointer to the publication context to be created. |
[out] | p_onoff_srv | Pointer to the OnOff server instance to be allocated. |
Definition at line 224 of file esp_gen_srv_model.c.
meshx_err_t meshx_plat_set_gen_srv_state | ( | void * | p_model, |
uint8_t | on_off_state ) |
Set the state of a generic server model.
This function updates the on/off state of a specified generic server model.
[in] | p_model | Pointer to the model whose state is to be set. |
[in] | on_off_state | The desired on/off state to set for the model. |
Definition at line 187 of file esp_gen_srv_model.c.