13#ifndef __MESHX_CONTROL_TASK__
14#define __MESHX_CONTROL_TASK__
30#define CONFIG_CONTROL_TASK_NAME "meshx_control_task"
35#ifndef CONFIG_CONTROL_TASK_PRIO
36#define CONFIG_CONTROL_TASK_PRIO configTIMER_TASK_PRIORITY + 2
42#ifndef CONFIG_MESHX_LOG_TASK_PRIO
43#define CONFIG_MESHX_LOG_TASK_PRIO configTIMER_TASK_PRIORITY + 1
49#ifndef CONFIG_CONTROL_TASK_STACK_SIZE
50#define CONFIG_CONTROL_TASK_STACK_SIZE 8192
56#ifndef CONFIG_CONTROL_TASK_QUEUE_LEN
57#define CONFIG_CONTROL_TASK_QUEUE_LEN 10
117 CONTROL_TASK_MSG_EVT_TO_BLE_MAX
178 CONTROL_TASK_MSG_EVT_TXCM_MAX
#define MESHX_BIT(nr)
Definition meshx_ble_mesh_cmn_def.h:22
Common application definitions and includes for BLE Mesh Node.
struct dev_struct dev_struct_t
Structure representing the device composition and elements.
CONTROL_TASK_MSG_EVT_SYSTEM_FRESH_BOOT
Definition meshx_control_task.h:167
meshx_err_t control_task_init(void)
Initialize the control task messaging system.
Definition meshx_control_task.c:45
CONTROL_TASK_MSG_EVT_IDENTIFY_START
Definition meshx_control_task.h:161
enum __packed control_task_msg_evt_config control_task_msg_evt_config_t
Enumeration for control task config srv events.
CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL_SRV
Definition meshx_control_task.h:115
CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF_SRV
Definition meshx_control_task.h:114
CONTROL_TASK_MSG_EVT_PROVISION_STOP
Definition meshx_control_task.h:160
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_SYSTEM_TIMER_FIRE
Definition meshx_control_task.h:129
enum __packed control_task_msg_evt_config
Enumeration for control task config srv events.
Definition meshx_control_task.h:139
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_PERIOD
Definition meshx_control_task.h:130
CONTROL_TASK_MSG_EVT_SYSTEM_MAX
Definition meshx_control_task.h:132
CONTROL_TASK_MSG_EVT_EL_STATE_CH_MAX
Definition meshx_control_task.h:100
CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL
Definition meshx_control_task.h:110
CONTROL_TASK_MSG_EVT_SYSTEM_NVS_COMMIT
Definition meshx_control_task.h:131
enum control_task_msg_code control_task_msg_code_t
Enumeration for control task message codes.
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.
uint32_t control_task_msg_evt_t
Type definition for control task message event.
Definition meshx_control_task.h:81
CONTROL_TASK_MSG_EVT_TO_BLE_SENSOR_SRV
Definition meshx_control_task.h:116
enum __packed control_task_msg_evt_system control_task_msg_evt_system_t
Enumeration for control task system events.
CONTROL_TASK_MSG_EVT_NET_KEY_DEL
Definition meshx_control_task.h:149
CONTROL_TASK_MSG_EVT_APP_KEY_DEL
Definition meshx_control_task.h:141
CONTROL_TASK_MSG_EVT_PROXY_CONNECT
Definition meshx_control_task.h:164
CONTROL_TASK_MSG_EVT_SUB_DEL
Definition meshx_control_task.h:145
meshx_err_t create_control_task(dev_struct_t *pdev)
Create the control task.
Definition meshx_control_task.c:58
enum __packed control_task_msg_evt_el_state_ch
Enumeration for control task message events to HAL.
Definition meshx_control_task.h:97
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.
Definition meshx_control_task.h:188
struct control_task_evt_cb_reg control_task_evt_cb_reg_t
Structure for control task event callback registration.
CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_ON_OFF
Definition meshx_control_task.h:98
CONTROL_TASK_MSG_EVT_SYSTEM_RESTART
Definition meshx_control_task.h:125
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
CONTROL_TASK_MSG_EVT_TXCM_MSG_TIMEOUT
Definition meshx_control_task.h:177
CONTROL_TASK_MSG_EVT_APP_KEY_UNBIND
Definition meshx_control_task.h:143
CONTROL_TASK_MSG_EVT_PROV_REG_COMP
Definition meshx_control_task.h:158
control_task_msg_code
Enumeration for control task message codes.
Definition meshx_control_task.h:64
@ CONTROL_TASK_MSG_CODE_FRM_BLE
Definition meshx_control_task.h:68
@ CONTROL_TASK_MSG_CODE_TXCM
Definition meshx_control_task.h:74
@ CONTROL_TASK_MSG_CODE_PROV_PLAT
Definition meshx_control_task.h:71
@ CONTROL_TASK_MSG_CODE_SYSTEM
Definition meshx_control_task.h:66
@ CONTROL_TASK_MSG_CODE_CONFIG
Definition meshx_control_task.h:69
@ CONTROL_TASK_MSG_CODE_MAX
Definition meshx_control_task.h:75
@ CONTROL_TASK_MSG_CODE_TO_APP
Definition meshx_control_task.h:72
@ CONTROL_TASK_MSG_CODE_TO_MESHX
Definition meshx_control_task.h:73
@ CONTROL_TASK_MSG_CODE_EL_STATE_CH
Definition meshx_control_task.h:65
@ CONTROL_TASK_MSG_CODE_PROVISION
Definition meshx_control_task.h:70
@ CONTROL_TASK_MSG_CODE_TO_BLE
Definition meshx_control_task.h:67
enum __packed control_task_msg_evt_to_ble
Enumeration for control task message events to BLE.
Definition meshx_control_task.h:107
CONTROL_TASK_MSG_EVT_APP_KEY_ADD
Definition meshx_control_task.h:140
struct control_task_msg control_task_msg_t
Structure for control task message.
enum __packed control_task_msg_evt_system
Enumeration for control task system events.
Definition meshx_control_task.h:124
CONTROL_TASK_MSG_EVT_SYSTEM_STACK_READY
Definition meshx_control_task.h:168
CONTROL_TASK_MSG_EVT_MAX
Definition meshx_control_task.h:90
CONTROL_TASK_MSG_EVT_IDENTIFY_STOP
Definition meshx_control_task.h:162
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_NODE_RESET
Definition meshx_control_task.h:163
CONTROL_TASK_MSG_EVT_EL_STATE_CH_SET_CTL
Definition meshx_control_task.h:99
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_DISARM
Definition meshx_control_task.h:128
CONTROL_TASK_MSG_EVT_PUB_ADD
Definition meshx_control_task.h:146
enum __packed control_task_msg_evt_txcm control_task_msg_evt_txcm_t
Enumeration for control task TXCM events.
CONTROL_TASK_MSG_EVT_EN_NODE_PROV
Definition meshx_control_task.h:166
CONTROL_TASK_MSG_EVT_APP_KEY_BIND
Definition meshx_control_task.h:142
CONTROL_TASK_MSG_EVT_SET_NAME_COMP
Definition meshx_control_task.h:159
CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF
Definition meshx_control_task.h:109
CONTROL_TASK_MSG_EVT_SUB_ADD
Definition meshx_control_task.h:144
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_ARM
Definition meshx_control_task.h:126
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.
Definition meshx_control_task.c:84
enum __packed control_task_msg_evt_to_app_meshx
Enumeration for control task message events to application.
Definition meshx_control_task.h:87
CONTROL_TASK_MSG_EVT_SYSTEM_TIMER_REARM
Definition meshx_control_task.h:127
CONTROL_TASK_MSG_EVT_CTRL
Definition meshx_control_task.h:89
CONTROL_TASK_MSG_EVT_PROVISION_ALL
Definition meshx_control_task.h:169
CONTROL_TASK_MSG_EVT_DATA
Definition meshx_control_task.h:88
enum __packed control_task_msg_evt_provision
Enumeration for control task provisioning events.
Definition meshx_control_task.h:157
CONTROL_TASK_MSG_EVT_PUB_DEL
Definition meshx_control_task.h:147
enum __packed control_task_msg_evt_provision control_task_msg_evt_provision_t
Enumeration for control task provisioning events.
CONTROL_TASK_MSG_EVT_CONFIG_ALL
Definition meshx_control_task.h:150
CONTROL_TASK_MSG_EVT_PROXY_DISCONN
Definition meshx_control_task.h:165
CONTROL_TASK_MSG_EVT_NET_KEY_ADD
Definition meshx_control_task.h:148
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.
Definition meshx_control_task.c:142
enum __packed control_task_msg_evt_txcm
Enumeration for control task TXCM events.
Definition meshx_control_task.h:176
CONTROL_TASK_MSG_EVT_TO_BLE_SET_LIGHTNESS
Definition meshx_control_task.h:111
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:43
MeshX Message Queue Interface.
Utility functions for RTOS operations in the MeshX framework.
Structure for control task event callback registration.
Definition meshx_control_task.h:204
control_task_msg_handle_t cb
Definition meshx_control_task.h:206
struct control_task_evt_cb_reg * next
Definition meshx_control_task.h:207
uint32_t msg_evt_bmap
Definition meshx_control_task.h:205
Structure for control task message.
Definition meshx_control_task.h:194
void * msg_evt_params
Definition meshx_control_task.h:197
control_task_msg_evt_t msg_evt
Definition meshx_control_task.h:196
control_task_msg_code_t msg_code
Definition meshx_control_task.h:195