|
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.
|
Header file for the MeshX BLE Mesh Light Server module. This file defines the data structures, function prototypes, and callback parameters for managing the Light Server models in a BLE Mesh network. It includes support for various lighting models such as Light CTL, HSL, xyL, and LC. More...
Go to the source code of this file.
Typedefs | |
| typedef struct meshx_lighting_server_state | meshx_lighting_server_state_t |
| Lighting Server Model state Used to set/restore the model state values internally. | |
| typedef struct meshx_lighting_server_cb_param | meshx_lighting_server_cb_param_t |
| typedef struct meshx_light_ctl_srv_state | meshx_light_ctl_srv_state_t |
| typedef struct meshx_light_ctl_srv | meshx_light_ctl_srv_t |
| Structure representing the Light CTL Server model. | |
| typedef control_task_msg_handle_t | meshx_lighting_server_cb |
| typedef struct meshx_light_server_send_params | meshx_light_server_send_params_t |
| Light Server send parameters. Used by meshXBaseLightServerModel::plat_send_msg to forward state change events. | |
Functions | |
| meshx_err_t | meshx_plat_light_srv_init (void) |
| Initialize the platform-specific Light Server. | |
| meshx_err_t | meshx_plat_light_srv_restore (meshx_ptr_t p_model, const meshx_lighting_server_state_t *state, uint16_t state_len) |
| Restore the Light Server model state from persistent storage. | |
| meshx_err_t | meshx_plat_light_ctl_setup_srv_create (meshx_ptr_t p_model, meshx_ptr_t *p_pub, meshx_ptr_t *p_ctl_srv) |
| Creates and initializes a Light CTL (Color Temperature Lightness) Setup Server model instance. | |
| meshx_err_t | meshx_plat_get_ctl_setup_srv_model (meshx_ptr_t p_model) |
| meshx_err_t | meshx_get_ctl_setup_srv_model (meshx_ptr_t p_model) |
| meshx_err_t | meshx_plat_light_ctl_srv_create (meshx_ptr_t p_model, meshx_ptr_t *p_pub, meshx_ptr_t *p_ctl_srv) |
| Create a Light CTL Server instance. | |
| meshx_err_t | meshx_plat_light_lightness_srv_create (meshx_ptr_t p_model, meshx_ptr_t *p_pub, meshx_ptr_t *p_lightness_srv) |
| Create a Light Lightness Server instance. | |
| meshx_err_t | meshx_plat_light_hsl_srv_create (meshx_ptr_t p_model, meshx_ptr_t *p_pub, meshx_ptr_t *p_hsl_srv) |
| Create a Light HSL Server instance. | |
| meshx_err_t | meshx_plat_light_xyl_srv_create (meshx_ptr_t p_model, meshx_ptr_t *p_pub, meshx_ptr_t *p_xyl_srv) |
| Create a Light xyL Server instance. | |
| meshx_err_t | meshx_plat_light_lc_srv_create (meshx_ptr_t p_model, meshx_ptr_t *p_pub, meshx_ptr_t *p_lc_srv) |
| Create a Light LC Server instance. | |
| meshx_err_t | meshx_plat_light_srv_delete (meshx_ptr_t *p_pub, meshx_ptr_t *p_ctl_srv) |
| Delete a Light CTL Server instance. | |
| meshx_err_t | meshx_plat_set_light_ctl_srv_state (meshx_ptr_t p_model, uint16_t delta_uv, uint16_t lightness, uint16_t temperature, uint16_t temp_range_max, uint16_t temp_range_min) |
| Set the state of the Light CTL Server. | |
| meshx_err_t | meshx_plat_light_ctl_srv_restore (meshx_ptr_t p_model, uint16_t delta_uv, uint16_t lightness, uint16_t temperature, uint16_t temp_range_max, uint16_t temp_range_min) |
| Restore the state of the Light CTL Server. | |
| meshx_err_t | meshx_plat_gen_light_srv_send_status (const meshx_model_t *p_model, const meshx_ctx_t *p_ctx, const meshx_lighting_server_state_change_t *state_change) |
| Send a status message from the Light Server. This function constructs and sends a status message containing the current state of the Light Server. | |
Header file for the MeshX BLE Mesh Light Server module. This file defines the data structures, function prototypes, and callback parameters for managing the Light Server models in a BLE Mesh network. It includes support for various lighting models such as Light CTL, HSL, xyL, and LC.
Copyright (c) 2024 - 2025 MeshX
| typedef struct meshx_light_ctl_srv_state meshx_light_ctl_srv_state_t |
| typedef struct meshx_light_ctl_srv meshx_light_ctl_srv_t |
Structure representing the Light CTL Server model.
This structure contains the model and state information for the Light CTL Server.
| typedef struct meshx_light_server_send_params meshx_light_server_send_params_t |
Light Server send parameters. Used by meshXBaseLightServerModel::plat_send_msg to forward state change events.
| typedef struct meshx_lighting_server_cb_param meshx_lighting_server_cb_param_t |
Lighting Server Model callback parameters
| typedef struct meshx_lighting_server_state meshx_lighting_server_state_t |
Lighting Server Model state Used to set/restore the model state values internally.
| meshx_err_t meshx_get_ctl_setup_srv_model | ( | meshx_ptr_t | p_model | ) |
| meshx_err_t meshx_plat_gen_light_srv_send_status | ( | const meshx_model_t * | p_model, |
| const meshx_ctx_t * | p_ctx, | ||
| const meshx_lighting_server_state_change_t * | state_change ) |
Send a status message from the Light Server. This function constructs and sends a status message containing the current state of the Light Server.
| [in] | p_model | Pointer to the Light Server model. |
| [in] | p_ctx | Pointer to the context containing message information. |
| [in] | state_change | The state change data to be sent in the status message. |
| meshx_err_t meshx_plat_get_ctl_setup_srv_model | ( | meshx_ptr_t | p_model | ) |
| meshx_err_t meshx_plat_light_ctl_setup_srv_create | ( | meshx_ptr_t | p_model, |
| meshx_ptr_t * | p_pub, | ||
| meshx_ptr_t * | p_ctl_srv ) |
Creates and initializes a Light CTL (Color Temperature Lightness) Setup Server model instance.
This function sets up the Light CTL Setup Server for a given model, configuring publication and server context pointers.
| [in] | p_model | Pointer to the parent model instance. |
| [out] | p_pub | Pointer to the publication context to be initialized. |
| [out] | p_ctl_srv | Pointer to the Light CTL Setup Server context to be initialized. |
| meshx_err_t meshx_plat_light_ctl_srv_create | ( | meshx_ptr_t | p_model, |
| meshx_ptr_t * | p_pub, | ||
| meshx_ptr_t * | p_ctl_srv ) |
Create a Light CTL Server instance.
This function initializes and allocates resources for a Light CTL Server model.
| [in] | p_model | Pointer to the model instance. |
| [out] | p_pub | Pointer to the publication context. |
| [out] | p_ctl_srv | Pointer to the Light CTL Server instance. |
| meshx_err_t meshx_plat_light_ctl_srv_restore | ( | meshx_ptr_t | p_model, |
| uint16_t | delta_uv, | ||
| uint16_t | lightness, | ||
| uint16_t | temperature, | ||
| uint16_t | temp_range_max, | ||
| uint16_t | temp_range_min ) |
Restore the state of the Light CTL Server.
This function restores the state of the Light CTL Server with the provided parameters.
| [in] | p_model | Pointer to the model instance. |
| [in] | delta_uv | Delta UV value. |
| [in] | lightness | Lightness value. |
| [in] | temperature | Temperature value. |
| [in] | temp_range_max | Maximum temperature range. |
| [in] | temp_range_min | Minimum temperature range. |
| meshx_err_t meshx_plat_light_hsl_srv_create | ( | meshx_ptr_t | p_model, |
| meshx_ptr_t * | p_pub, | ||
| meshx_ptr_t * | p_hsl_srv ) |
Create a Light HSL Server instance.
This function initializes and allocates resources for a Light HSL Server model.
| [in] | p_model | Pointer to the model instance. |
| [out] | p_pub | Pointer to the publication context. |
| [out] | p_hsl_srv | Pointer to the Light HSL Server instance. |
| meshx_err_t meshx_plat_light_lc_srv_create | ( | meshx_ptr_t | p_model, |
| meshx_ptr_t * | p_pub, | ||
| meshx_ptr_t * | p_lc_srv ) |
Create a Light LC Server instance.
This function initializes and allocates resources for a Light LC (Light Control) Server model.
| [in] | p_model | Pointer to the model instance. |
| [out] | p_pub | Pointer to the publication context. |
| [out] | p_lc_srv | Pointer to the Light LC Server instance. |
| meshx_err_t meshx_plat_light_lightness_srv_create | ( | meshx_ptr_t | p_model, |
| meshx_ptr_t * | p_pub, | ||
| meshx_ptr_t * | p_lightness_srv ) |
Create a Light Lightness Server instance.
This function initializes and allocates resources for a Light Lightness Server model.
| [in] | p_model | Pointer to the model instance. |
| [out] | p_pub | Pointer to the publication context. |
| [out] | p_lightness_srv | Pointer to the Light Lightness Server instance. |
| meshx_err_t meshx_plat_light_srv_delete | ( | meshx_ptr_t * | p_pub, |
| meshx_ptr_t * | p_ctl_srv ) |
Delete a Light CTL Server instance.
This function releases resources associated with a Light CTL Server model.
| [in,out] | p_pub | Pointer to the publication context to be deleted. |
| [in,out] | p_ctl_srv | Pointer to the Light CTL Server instance to be deleted. |
| meshx_err_t meshx_plat_light_srv_init | ( | void | ) |
Initialize the platform-specific Light Server.
This function sets up the necessary resources for the Light Server.
| meshx_err_t meshx_plat_light_srv_restore | ( | meshx_ptr_t | p_model, |
| const meshx_lighting_server_state_t * | state, | ||
| uint16_t | state_len ) |
Restore the Light Server model state from persistent storage.
This function restores the Light Server model state from persistent storage.
| [in] | p_model | Pointer to the model instance to be restored. |
| [in] | state | Pointer to the state data to be restored. |
| [in] | state_len | Length of the state data in bytes. |
| meshx_err_t meshx_plat_light_xyl_srv_create | ( | meshx_ptr_t | p_model, |
| meshx_ptr_t * | p_pub, | ||
| meshx_ptr_t * | p_xyl_srv ) |
Create a Light xyL Server instance.
This function initializes and allocates resources for a Light xyL Server model.
| [in] | p_model | Pointer to the model instance. |
| [out] | p_pub | Pointer to the publication context. |
| [out] | p_xyl_srv | Pointer to the Light xyL Server instance. |
| meshx_err_t meshx_plat_set_light_ctl_srv_state | ( | meshx_ptr_t | p_model, |
| uint16_t | delta_uv, | ||
| uint16_t | lightness, | ||
| uint16_t | temperature, | ||
| uint16_t | temp_range_max, | ||
| uint16_t | temp_range_min ) |
Set the state of the Light CTL Server.
This function updates the state of the Light CTL Server with the provided parameters.
| [in] | p_model | Pointer to the model instance. |
| [in] | delta_uv | Delta UV value. |
| [in] | lightness | Lightness value. |
| [in] | temperature | Temperature value. |
| [in] | temp_range_max | Maximum temperature range. |
| [in] | temp_range_min | Minimum temperature range. |