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.
Loading...
Searching...
No Matches
meshx_control_task.h File Reference

Header file for the control task in the BLE mesh node application. More...

#include "stdio.h"
#include "string.h"
#include "meshx_common.h"
#include "interface/rtos/meshx_task.h"
#include "interface/rtos/meshx_msg_q.h"
#include "interface/rtos/meshx_rtos_utils.h"
Include dependency graph for meshx_control_task.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  control_task_msg
 Structure for control task message. More...
 
struct  control_task_evt_cb_reg
 Structure for control task event callback registration. More...
 

Macros

#define CONFIG_CONTROL_TASK_NAME   "meshx_control_task"
 Control task name configuration.
 
#define CONFIG_CONTROL_TASK_PRIO   configTIMER_TASK_PRIORITY + 1
 Control task priority configuration.
 
#define CONFIG_CONTROL_TASK_STACK_SIZE   4096
 Control task stack size configuration.
 
#define CONFIG_CONTROL_TASK_QUEUE_LEN   10
 Control task queue length configuration.
 

Typedefs

typedef enum control_task_msg_code control_task_msg_code_t
 Enumeration for control task message codes.
 
typedef uint32_t control_task_msg_evt_t
 Type definition for control task message event.
 
typedef enum __packed control_task_msg_evt_to_app_meshx control_task_msg_evt_to_app_meshx_t
 Enumeration for control task message events to application.
 
typedef enum __packed control_task_msg_evt_el_state_ch control_task_msg_evt_el_state_ch_t
 Enumeration for control task message events to HAL.
 
typedef enum __packed control_task_msg_evt_to_ble control_task_msg_evt_to_ble_t
 Enumeration for control task message events to BLE.
 
typedef enum __packed control_task_msg_evt_system control_task_msg_evt_system_t
 Enumeration for control task system events.
 
typedef enum __packed control_task_msg_evt_config control_task_msg_evt_config_t
 Enumeration for control task config srv events.
 
typedef enum __packed control_task_msg_evt_provision control_task_msg_evt_provision_t
 Enumeration for control task provisioning events.
 
typedef enum __packed control_task_msg_evt_txcm control_task_msg_evt_txcm_t
 Enumeration for control task TXCM events.
 
typedef meshx_err_t(* control_task_msg_handle_t) (dev_struct_t *pdev, control_task_msg_evt_t evt, void *params)
 Function pointer type for control task message handler.
 
typedef struct control_task_msg control_task_msg_t
 Structure for control task message.
 
typedef struct control_task_evt_cb_reg control_task_evt_cb_reg_t
 Structure for control task event callback registration.
 

Enumerations

enum  control_task_msg_code {
  CONTROL_TASK_MSG_CODE_EL_STATE_CH ,
  CONTROL_TASK_MSG_CODE_SYSTEM ,
  CONTROL_TASK_MSG_CODE_TO_BLE ,
  CONTROL_TASK_MSG_CODE_FRM_BLE ,
  CONTROL_TASK_MSG_CODE_CONFIG ,
  CONTROL_TASK_MSG_CODE_PROVISION ,
  CONTROL_TASK_MSG_CODE_TO_APP ,
  CONTROL_TASK_MSG_CODE_TO_MESHX ,
  CONTROL_TASK_MSG_CODE_TXCM ,
  CONTROL_TASK_MSG_CODE_MAX
}
 Enumeration for control task message codes. More...
 

Functions

meshx_err_t create_control_task (dev_struct_t *pdev)
 Create the control task.
 
meshx_err_t control_task_msg_subscribe (control_task_msg_code_t msg_code, control_task_msg_evt_t evt_bmap, control_task_msg_handle_t callback)
 Subscribe to a control task message.
 
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.
 
meshx_err_t control_task_msg_publish (control_task_msg_code_t msg_code, control_task_msg_evt_t msg_evt, const void *msg_evt_params, size_t sizeof_msg_evt_params)
 Publish a control task message.
 

Variables

enum __packed control_task_msg_evt_to_app_meshx
 Enumeration for control task message events to application.
 
 CONTROL_TASK_MSG_EVT_DATA = MESHX_BIT(0)
 
 CONTROL_TASK_MSG_EVT_CTRL = MESHX_BIT(1)
 
 CONTROL_TASK_MSG_EVT_MAX
 
enum __packed control_task_msg_evt_el_state_ch
 Enumeration for control task message events to HAL.
 
 CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_ON_OFF = MESHX_BIT(0)
 
 CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_CTL = MESHX_BIT(1)
 
 CONTROL_TASK_MSG_EVT_EL_STATE_CH_MAX
 
enum __packed control_task_msg_evt_to_ble
 Enumeration for control task message events to BLE.
 
 CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF = MESHX_BIT(0)
 
 CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL = MESHX_BIT(1)
 
 CONTROL_TASK_MSG_EVT_TO_BLE_SET_LIGHTNESS = MESHX_BIT(2)
 
 CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF_SRV = MESHX_BIT(16)
 
 CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL_SRV = MESHX_BIT(17)
 
enum __packed control_task_msg_evt_system
 Enumeration for control task system events.
 
 CONTROL_TASK_MSG_EVT_SYSTEM_RESTART = MESHX_BIT(0)
 
 CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_ARM = MESHX_BIT(1)
 
 CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_REARM = MESHX_BIT(2)
 
 CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_DISARM = MESHX_BIT(3)
 
 CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_FIRE = MESHX_BIT(4)
 
 CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_PERIOD = MESHX_BIT(5)
 
 CONTROL_TASK_MSG_EVT_SYSTEM_MAX
 
enum __packed control_task_msg_evt_config
 Enumeration for control task config srv events.
 
 CONTROL_TASK_MSG_EVT_APP_KEY_ADD = MESHX_BIT(0)
 
 CONTROL_TASK_MSG_EVT_APP_KEY_DEL = MESHX_BIT(1)
 
 CONTROL_TASK_MSG_EVT_APP_KEY_BIND = MESHX_BIT(2)
 
 CONTROL_TASK_MSG_EVT_APP_KEY_UNBIND = MESHX_BIT(3)
 
 CONTROL_TASK_MSG_EVT_SUB_ADD = MESHX_BIT(4)
 
 CONTROL_TASK_MSG_EVT_SUB_DEL = MESHX_BIT(5)
 
 CONTROL_TASK_MSG_EVT_PUB_ADD = MESHX_BIT(6)
 
 CONTROL_TASK_MSG_EVT_PUB_DEL = MESHX_BIT(7)
 
 CONTROL_TASK_MSG_EVT_NET_KEY_ADD = MESHX_BIT(8)
 
 CONTROL_TASK_MSG_EVT_NET_KEY_DEL = MESHX_BIT(9)
 
 CONTROL_TASK_MSG_EVT_CONFIG_ALL = 0xFF
 
enum __packed control_task_msg_evt_provision
 Enumeration for control task provisioning events.
 
 CONTROL_TASK_MSG_EVT_PROVISION_STOP = MESHX_BIT(1)
 
 CONTROL_TASK_MSG_EVT_IDENTIFY_START = MESHX_BIT(2)
 
 CONTROL_TASK_MSG_EVT_IDENTIFY_STOP = MESHX_BIT(3)
 
 CONTROL_TASK_MSG_EVT_NODE_RESET = MESHX_BIT(4)
 
 CONTROL_TASK_MSG_EVT_PROXY_CONNECT = MESHX_BIT(5)
 
 CONTROL_TASK_MSG_EVT_PROXY_DISCONN = MESHX_BIT(6)
 
 CONTROL_TASK_MSG_EVT_EN_NODE_PROV = MESHX_BIT(7)
 
 CONTROL_TASK_MSG_EVT_SYSTEM_FRESH_BOOT = MESHX_BIT(8)
 
 CONTROL_TASK_MSG_EVT_PROVISION_ALL = 0xFFFF
 
enum __packed control_task_msg_evt_txcm
 Enumeration for control task TXCM events.
 
 CONTROL_TASK_MSG_EVT_TXCM_MSG_TIMEOUT = MESHX_BIT(1)
 

Detailed Description

Header file for the control task in the BLE mesh node application.

Copyright © 2024 - 2025 MeshX

This file contains the definitions and function prototypes for the control task, which handles various control messages and events in the BLE mesh node application.

Author
Pranjal Chanda

Definition in file meshx_control_task.h.

Macro Definition Documentation

◆ CONFIG_CONTROL_TASK_NAME

#define CONFIG_CONTROL_TASK_NAME   "meshx_control_task"

Control task name configuration.

Definition at line 26 of file meshx_control_task.h.

◆ CONFIG_CONTROL_TASK_PRIO

#define CONFIG_CONTROL_TASK_PRIO   configTIMER_TASK_PRIORITY + 1

Control task priority configuration.

Definition at line 32 of file meshx_control_task.h.

◆ CONFIG_CONTROL_TASK_QUEUE_LEN

#define CONFIG_CONTROL_TASK_QUEUE_LEN   10

Control task queue length configuration.

Definition at line 46 of file meshx_control_task.h.

◆ CONFIG_CONTROL_TASK_STACK_SIZE

#define CONFIG_CONTROL_TASK_STACK_SIZE   4096

Control task stack size configuration.

Definition at line 39 of file meshx_control_task.h.

Typedef Documentation

◆ control_task_evt_cb_reg_t

Structure for control task event callback registration.

◆ control_task_msg_code_t

Enumeration for control task message codes.

◆ control_task_msg_evt_config_t

Enumeration for control task config srv events.

◆ control_task_msg_evt_el_state_ch_t

Enumeration for control task message events to HAL.

◆ control_task_msg_evt_provision_t

Enumeration for control task provisioning events.

◆ control_task_msg_evt_system_t

Enumeration for control task system events.

◆ control_task_msg_evt_t

typedef uint32_t control_task_msg_evt_t

Type definition for control task message event.

Definition at line 69 of file meshx_control_task.h.

◆ control_task_msg_evt_to_app_meshx_t

Enumeration for control task message events to application.

◆ control_task_msg_evt_to_ble_t

Enumeration for control task message events to BLE.

◆ control_task_msg_evt_txcm_t

Enumeration for control task TXCM events.

◆ control_task_msg_handle_t

typedef meshx_err_t(* control_task_msg_handle_t) (dev_struct_t *pdev, control_task_msg_evt_t evt, void *params)

Function pointer type for control task message handler.

Parameters
pdevPointer to the device structure.
evtEvent code.
paramsPointer to the event parameters.
Returns
MESHX_SUCCESS on success, or an error code on failure.

Definition at line 171 of file meshx_control_task.h.

◆ control_task_msg_t

Structure for control task message.

Enumeration Type Documentation

◆ control_task_msg_code

Enumeration for control task message codes.

Enumerator
CONTROL_TASK_MSG_CODE_EL_STATE_CH 

Message code for Element state change

CONTROL_TASK_MSG_CODE_SYSTEM 

Message code for system events.

CONTROL_TASK_MSG_CODE_TO_BLE 

Message code to BLE layer.

CONTROL_TASK_MSG_CODE_FRM_BLE 

Message code from BLE layer.

CONTROL_TASK_MSG_CODE_CONFIG 

Message code for Config Server events

CONTROL_TASK_MSG_CODE_PROVISION 

Message code for provisioning events.

CONTROL_TASK_MSG_CODE_TO_APP 

Message code for application events.

CONTROL_TASK_MSG_CODE_TO_MESHX 

Message code for meshX events from app

CONTROL_TASK_MSG_CODE_TXCM 

Message code for TXCM events

CONTROL_TASK_MSG_CODE_MAX 

Maximum message code value.

Definition at line 52 of file meshx_control_task.h.

53{
enum control_task_msg_code control_task_msg_code_t
Enumeration for control task message codes.
@ CONTROL_TASK_MSG_CODE_FRM_BLE
@ CONTROL_TASK_MSG_CODE_TXCM
@ CONTROL_TASK_MSG_CODE_SYSTEM
@ CONTROL_TASK_MSG_CODE_CONFIG
@ CONTROL_TASK_MSG_CODE_MAX
@ CONTROL_TASK_MSG_CODE_TO_APP
@ CONTROL_TASK_MSG_CODE_TO_MESHX
@ CONTROL_TASK_MSG_CODE_EL_STATE_CH
@ CONTROL_TASK_MSG_CODE_PROVISION
@ CONTROL_TASK_MSG_CODE_TO_BLE

Function Documentation

◆ control_task_msg_publish()

meshx_err_t control_task_msg_publish ( control_task_msg_code_t msg_code,
control_task_msg_evt_t msg_evt,
const void * msg_evt_params,
size_t sizeof_msg_evt_params )

Publish a control task message.

This function allows you to publish a control task message with the given message code, event, and event parameters. The message will be sent to the control task for processing.

Parameters
[in]msg_codeThe message code to publish.
[in]msg_evtThe event associated with the message.
[in]msg_evt_paramsPointer to the event parameters.
[in]sizeof_msg_evt_paramsSize of the event parameters.
Returns
MESHX_SUCCESS on success, or an error code on failure.

Definition at line 66 of file meshx_control_task.c.

70{
71 control_task_msg_t send_msg;
72 if (msg_code >= CONTROL_TASK_MSG_CODE_MAX)
73 {
74 MESHX_LOGE(MODULE_ID_COMMON, "Invalid message code or event");
75 return MESHX_INVALID_ARG;
76 }
77#if CONFIG_MESHX_DEFAULT_LOG_LEVEL <= MESHX_LOG_DEBUG
78 void *caller_addr0 = __builtin_return_address(0);
79#endif /* CONFIG_MESHX_DEFAULT_LOG_LEVEL <= MESHX_LOG_DEBUG */
80 MESHX_LOGD(MODULE_ID_COMMON, "fn_address|msg|evt: %p|%p|%p", caller_addr0, (void *)msg_code, (void *)msg_evt);
81
82 if (sizeof_msg_evt_params != 0)
83 {
84 meshx_err_t err = meshx_rtos_malloc(&send_msg.msg_evt_params, sizeof_msg_evt_params);
85 if (err)
86 return err;
87 /* Copy the params to allocated space */
88 memcpy(send_msg.msg_evt_params, msg_evt_params, sizeof_msg_evt_params);
89 }
90 else
91 {
92 send_msg.msg_evt_params = NULL;
93 }
94
95 send_msg.msg_code = msg_code;
96 send_msg.msg_evt = msg_evt;
97
98 meshx_err_t send_err = meshx_msg_q_send(&control_task_queue, &send_msg, sizeof(send_msg), UINT32_MAX);
99 if (send_err != MESHX_SUCCESS && send_msg.msg_evt_params)
100 {
102 }
103 return send_err;
104}
static meshx_msg_q_t control_task_queue
Queue handle for control task messages.
struct control_task_msg control_task_msg_t
Structure for control task message.
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:39
@ MESHX_SUCCESS
Definition meshx_err.h:40
@ MESHX_INVALID_ARG
Definition meshx_err.h:42
#define MESHX_LOGE(module_id, format,...)
Definition meshx_log.h:73
#define MESHX_LOGD(module_id, format,...)
Definition meshx_log.h:113
meshx_err_t meshx_msg_q_send(meshx_msg_q_t *msg_q_handle, void const *msg, size_t msg_len, uint32_t delay_ms)
Send a Message to a MeshX Message Queue Back.
Definition meshx_msg_q.c:80
meshx_err_t meshx_rtos_free(void **ptr)
Frees memory allocated to a pointer and sets it to NULL.
meshx_err_t meshx_rtos_malloc(void **ptr, size_t size)
Allocates memory dynamically in a thread-safe manner using FreeRTOS.
Definition meshx_utils.c:65
@ MODULE_ID_COMMON
Definition module_id.h:32
control_task_msg_evt_t msg_evt
control_task_msg_code_t msg_code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ control_task_msg_subscribe()

meshx_err_t control_task_msg_subscribe ( control_task_msg_code_t msg_code,
control_task_msg_evt_t evt_bmap,
control_task_msg_handle_t callback )

Subscribe to a control task message.

This function allows you to subscribe to a specific control task message identified by the given message code. When the message is received, the specified callback function will be invoked.

Parameters
[in]msg_codeThe message code to subscribe to.
[in]evt_bmapThe event bitmap associated with the message.
[in]callbackThe callback function to be called when the message is received.
Returns
  • MESHX_SUCCESS: Success
  • MESHX_INVALID_ARG: Invalid argument
  • MESHX_FAIL: Other failures

Definition at line 122 of file meshx_control_task.c.

125{
126 if (callback == NULL || msg_code >= CONTROL_TASK_MSG_CODE_MAX)
127 return MESHX_INVALID_ARG; // Invalid arguments
128
129 control_task_evt_cb_reg_t *new_node = NULL;
130 meshx_err_t err = meshx_rtos_malloc((void**)&new_node, sizeof(control_task_evt_cb_reg_t));
131 if (err || !new_node)
132 return err; // Memory allocation failed
133
134 new_node->cb = callback;
135 new_node->msg_evt_bmap = evt_bmap;
136 new_node->next = control_task_msg_code_list_heads[msg_code];
137 control_task_msg_code_list_heads[msg_code] = new_node;
138
139 return MESHX_SUCCESS;
140}
static control_task_evt_cb_reg_t * control_task_msg_code_list_heads[CONTROL_TASK_MSG_CODE_MAX]
Linked list heads for registered callbacks per message code.
struct control_task_evt_cb_reg control_task_evt_cb_reg_t
Structure for control task event callback registration.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ control_task_msg_unsubscribe()

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.

This function allows deregistering a callback handler for a specific message code and event type.

Parameters
[in]msg_codeThe message code to deregister the handler for.
[in]evt_bmapBitmap of events to deregister for.
[in]callbackCallback function to deregister.
Returns
MESHX_SUCCESS on success, or an error code on failure.

Definition at line 152 of file meshx_control_task.c.

155{
156 if (callback == NULL || msg_code >= CONTROL_TASK_MSG_CODE_MAX)
157 return MESHX_INVALID_ARG; // Invalid arguments
158
159 control_task_evt_cb_reg_t *prev = NULL;
161
162 while (curr)
163 {
164 if (curr->cb == callback && curr->msg_evt_bmap == evt_bmap)
165 {
166 if (prev == NULL)
167 control_task_msg_code_list_heads[msg_code] = curr->next;
168 else
169 prev->next = curr->next;
170
171 return meshx_rtos_free((void**)&curr);
172 }
173 prev = curr;
174 curr = curr->next;
175 }
176
177 return MESHX_NOT_FOUND;
178}
@ MESHX_NOT_FOUND
Definition meshx_err.h:46
control_task_msg_handle_t cb
struct control_task_evt_cb_reg * next
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_control_task()

meshx_err_t create_control_task ( dev_struct_t * pdev)

Create the control task.

This function creates a FreeRTOS task to handle control events.

Parameters
[in]pdevPointer to the device structure (dev_struct_t).
Returns
MESHX_SUCCESS on success, or an error code on failure.

Definition at line 40 of file meshx_control_task.c.

41{
42
43 meshx_task_t task_handle = {
44 .arg = pdev,
45 .task_cb = control_task_handler,
46 .priority = CONFIG_CONTROL_TASK_PRIO,
47 .task_name = CONFIG_CONTROL_TASK_NAME,
49 };
50
51 return meshx_task_create(&task_handle);
52}
static void control_task_handler(void *args)
Task handler function for processing control task messages.
#define CONFIG_CONTROL_TASK_NAME
Control task name configuration.
#define CONFIG_CONTROL_TASK_STACK_SIZE
Control task stack size configuration.
#define CONFIG_CONTROL_TASK_PRIO
Control task priority configuration.
struct meshx_task meshx_task_t
MeshX Task Structure.
meshx_err_t meshx_task_create(meshx_task_t *task_handle)
Create a MeshX Task.
Definition meshx_task.c:28
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CONTROL_TASK_MSG_EVT_APP_KEY_ADD

CONTROL_TASK_MSG_EVT_APP_KEY_ADD = MESHX_BIT(0)

Event for adding an application key.

Definition at line 126 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_APP_KEY_BIND

CONTROL_TASK_MSG_EVT_APP_KEY_BIND = MESHX_BIT(2)

Event for binding an application key.

Definition at line 128 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_APP_KEY_DEL

CONTROL_TASK_MSG_EVT_APP_KEY_DEL = MESHX_BIT(1)

Event for deleting an application key.

Definition at line 127 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_APP_KEY_UNBIND

CONTROL_TASK_MSG_EVT_APP_KEY_UNBIND = MESHX_BIT(3)

Event for unbinding an application key.

Definition at line 129 of file meshx_control_task.h.

◆ control_task_msg_evt_config

enum __packed control_task_msg_evt_config

Enumeration for control task config srv events.

Definition at line 124 of file meshx_control_task.h.

125{
#define MESHX_BIT(nr)
enum __packed control_task_msg_evt_config control_task_msg_evt_config_t
Enumeration for control task config srv events.
CONTROL_TASK_MSG_EVT_NET_KEY_DEL
CONTROL_TASK_MSG_EVT_APP_KEY_DEL
CONTROL_TASK_MSG_EVT_SUB_DEL
CONTROL_TASK_MSG_EVT_APP_KEY_UNBIND
CONTROL_TASK_MSG_EVT_APP_KEY_ADD
CONTROL_TASK_MSG_EVT_PUB_ADD
CONTROL_TASK_MSG_EVT_APP_KEY_BIND
CONTROL_TASK_MSG_EVT_SUB_ADD
CONTROL_TASK_MSG_EVT_PUB_DEL
CONTROL_TASK_MSG_EVT_CONFIG_ALL
CONTROL_TASK_MSG_EVT_NET_KEY_ADD

◆ CONTROL_TASK_MSG_EVT_CONFIG_ALL

CONTROL_TASK_MSG_EVT_CONFIG_ALL = 0xFF

Event for all configuration events.

Definition at line 136 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_CTRL

CONTROL_TASK_MSG_EVT_CTRL = MESHX_BIT(1)

Control message

Definition at line 77 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_DATA

CONTROL_TASK_MSG_EVT_DATA = MESHX_BIT(0)

Data message

Definition at line 76 of file meshx_control_task.h.

◆ control_task_msg_evt_el_state_ch

enum __packed control_task_msg_evt_el_state_ch

Enumeration for control task message events to HAL.

Definition at line 84 of file meshx_control_task.h.

85{
CONTROL_TASK_MSG_EVT_EL_STATE_CH_MAX
enum __packed control_task_msg_evt_el_state_ch control_task_msg_evt_el_state_ch_t
Enumeration for control task message events to HAL.
CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_ON_OFF
CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_CTL

◆ CONTROL_TASK_MSG_EVT_EL_STATE_CH_MAX

CONTROL_TASK_MSG_EVT_EL_STATE_CH_MAX

Maximum HAL event value.

Definition at line 88 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_CTL

CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_CTL = MESHX_BIT(1)

Event to set CTL state.

Definition at line 87 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_ON_OFF

CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_ON_OFF = MESHX_BIT(0)

Event to set on/off state.

Definition at line 86 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_EN_NODE_PROV

CONTROL_TASK_MSG_EVT_EN_NODE_PROV = MESHX_BIT(7)

ESP_BLE_MESH_NODE_PROV_ENABLE_COMP_EVT

Definition at line 150 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_IDENTIFY_START

CONTROL_TASK_MSG_EVT_IDENTIFY_START = MESHX_BIT(2)

EESP_BLE_MESH_NODE_PROV_LINK_OPEN_EVT

Definition at line 145 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_IDENTIFY_STOP

CONTROL_TASK_MSG_EVT_IDENTIFY_STOP = MESHX_BIT(3)

ESP_BLE_MESH_NODE_PROV_LINK_CLOSE_EVT

Definition at line 146 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_MAX

CONTROL_TASK_MSG_EVT_MAX

Maximum event value

Definition at line 78 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_NET_KEY_ADD

CONTROL_TASK_MSG_EVT_NET_KEY_ADD = MESHX_BIT(8)

Event for adding a network key.

Definition at line 134 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_NET_KEY_DEL

CONTROL_TASK_MSG_EVT_NET_KEY_DEL = MESHX_BIT(9)

Event for deleting a network key.

Definition at line 135 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_NODE_RESET

CONTROL_TASK_MSG_EVT_NODE_RESET = MESHX_BIT(4)

CONTROL_TASK_MSG_EVT_NODE_RESET

Definition at line 147 of file meshx_control_task.h.

◆ control_task_msg_evt_provision

enum __packed control_task_msg_evt_provision

Enumeration for control task provisioning events.

Definition at line 142 of file meshx_control_task.h.

143{
CONTROL_TASK_MSG_EVT_SYSTEM_FRESH_BOOT
CONTROL_TASK_MSG_EVT_IDENTIFY_START
CONTROL_TASK_MSG_EVT_PROVISION_STOP
CONTROL_TASK_MSG_EVT_PROXY_CONNECT
CONTROL_TASK_MSG_EVT_IDENTIFY_STOP
CONTROL_TASK_MSG_EVT_NODE_RESET
CONTROL_TASK_MSG_EVT_EN_NODE_PROV
CONTROL_TASK_MSG_EVT_PROVISION_ALL
enum __packed control_task_msg_evt_provision control_task_msg_evt_provision_t
Enumeration for control task provisioning events.
CONTROL_TASK_MSG_EVT_PROXY_DISCONN

◆ CONTROL_TASK_MSG_EVT_PROVISION_ALL

CONTROL_TASK_MSG_EVT_PROVISION_ALL = 0xFFFF

Maximum provisioning event value.

Definition at line 152 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_PROVISION_STOP

CONTROL_TASK_MSG_EVT_PROVISION_STOP = MESHX_BIT(1)

ESP_BLE_MESH_NODE_PROV_COMPLETE_EVT

Definition at line 144 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_PROXY_CONNECT

CONTROL_TASK_MSG_EVT_PROXY_CONNECT = MESHX_BIT(5)

ESP_BLE_MESH_PROXY_SERVER_CONNECTED_EVT

Definition at line 148 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_PROXY_DISCONN

CONTROL_TASK_MSG_EVT_PROXY_DISCONN = MESHX_BIT(6)

ESP_BLE_MESH_PROXY_SERVER_DISCONNECTED_EVT

Definition at line 149 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_PUB_ADD

CONTROL_TASK_MSG_EVT_PUB_ADD = MESHX_BIT(6)

Event for adding a publication.

Definition at line 132 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_PUB_DEL

CONTROL_TASK_MSG_EVT_PUB_DEL = MESHX_BIT(7)

Event for deleting a publication.

Definition at line 133 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SUB_ADD

CONTROL_TASK_MSG_EVT_SUB_ADD = MESHX_BIT(4)

Event for adding a subscription.

Definition at line 130 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SUB_DEL

CONTROL_TASK_MSG_EVT_SUB_DEL = MESHX_BIT(5)

Event for deleting a subscription.

Definition at line 131 of file meshx_control_task.h.

◆ control_task_msg_evt_system

enum __packed control_task_msg_evt_system

Enumeration for control task system events.

Definition at line 110 of file meshx_control_task.h.

111{
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_FIRE
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_PERIOD
CONTROL_TASK_MSG_EVT_SYSTEM_MAX
enum __packed control_task_msg_evt_system control_task_msg_evt_system_t
Enumeration for control task system events.
CONTROL_TASK_MSG_EVT_SYSTEM_RESTART
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_DISARM
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_ARM
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_REARM

◆ CONTROL_TASK_MSG_EVT_SYSTEM_FRESH_BOOT

CONTROL_TASK_MSG_EVT_SYSTEM_FRESH_BOOT = MESHX_BIT(8)

Event to indicate fresh boot

Definition at line 151 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SYSTEM_MAX

CONTROL_TASK_MSG_EVT_SYSTEM_MAX

Maximum system event value.

Definition at line 118 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SYSTEM_RESTART

CONTROL_TASK_MSG_EVT_SYSTEM_RESTART = MESHX_BIT(0)

Event to restart the system.

Definition at line 112 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_ARM

CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_ARM = MESHX_BIT(1)

Event to arm an OS Timer

Definition at line 113 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_DISARM

CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_DISARM = MESHX_BIT(3)

Event to stop an OS Timer

Definition at line 115 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_FIRE

CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_FIRE = MESHX_BIT(4)

Event to fire timedout OS Timer

Definition at line 116 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_PERIOD

CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_PERIOD = MESHX_BIT(5)

Event to set timedout OS Timer

Definition at line 117 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_REARM

CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_REARM = MESHX_BIT(2)

Event to re-arm an OS Timer

Definition at line 114 of file meshx_control_task.h.

◆ control_task_msg_evt_to_app_meshx

enum __packed control_task_msg_evt_to_app_meshx

Enumeration for control task message events to application.

Definition at line 74 of file meshx_control_task.h.

75{
CONTROL_TASK_MSG_EVT_MAX
enum __packed control_task_msg_evt_to_app_meshx control_task_msg_evt_to_app_meshx_t
Enumeration for control task message events to application.
CONTROL_TASK_MSG_EVT_CTRL
CONTROL_TASK_MSG_EVT_DATA

◆ control_task_msg_evt_to_ble

enum __packed control_task_msg_evt_to_ble

Enumeration for control task message events to BLE.

Definition at line 94 of file meshx_control_task.h.

95{
96 /* To Client related events */
100
101 /* To server events */
104 CONTROL_TASK_MSG_EVT_TO_BLE_MAX
CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL_SRV
CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF_SRV
enum __packed control_task_msg_evt_to_ble control_task_msg_evt_to_ble_t
Enumeration for control task message events to BLE.
CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL
CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF
CONTROL_TASK_MSG_EVT_TO_BLE_SET_LIGHTNESS

◆ CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL

CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL = MESHX_BIT(1)

Event to set CTL state.

Definition at line 98 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL_SRV

CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL_SRV = MESHX_BIT(17)

Event to send out CTL status

Definition at line 103 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_TO_BLE_SET_LIGHTNESS

CONTROL_TASK_MSG_EVT_TO_BLE_SET_LIGHTNESS = MESHX_BIT(2)

Event to set lightness state.

Definition at line 99 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF

CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF = MESHX_BIT(0)

Event to set on/off state.

Definition at line 97 of file meshx_control_task.h.

◆ CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF_SRV

CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF_SRV = MESHX_BIT(16)

Event to send out on/off status

Definition at line 102 of file meshx_control_task.h.

◆ control_task_msg_evt_txcm

enum __packed control_task_msg_evt_txcm

Enumeration for control task TXCM events.

Definition at line 158 of file meshx_control_task.h.

159{
161 CONTROL_TASK_MSG_EVT_TXCM_MAX
CONTROL_TASK_MSG_EVT_TXCM_MSG_TIMEOUT
enum __packed control_task_msg_evt_txcm control_task_msg_evt_txcm_t
Enumeration for control task TXCM events.

◆ CONTROL_TASK_MSG_EVT_TXCM_MSG_TIMEOUT

CONTROL_TASK_MSG_EVT_TXCM_MSG_TIMEOUT = MESHX_BIT(1)

Event for TXCM message timeout

Definition at line 160 of file meshx_control_task.h.