BT Mesh Configuration Executor#

BT Mesh Configuration Executor executes configuration jobs by executing the tasks in the task tree of the configuration job.

Each executor shall have one parent BT Mesh Configuration Distributor. Parent distributor can command the executor to start configuration job execution by calling btmesh_conf_executor_start_job function. The configuration executor reports the status of job execution by calling btmesh_conf_distributor_on_job_notification function of parent distributor.

The relationship between the configuration distributor and its executors is composition so the executors are owned by its parent distributor completely. Only the parent distributor is allowed to start configuration jobs because the executors always report its job statuses to the parent distributor.

The robust execution of configuration tasks is guaranteed by the retry mechanism of the executor.
Retry mechanism is used in the following cases:

  • Configuration request timeout in the BT Mesh Stack due to the following:

    • BT Mesh message sent to the configuration server is lost

    • BT Mesh status message sent by the configuration server is lost

  • Configuration event is not received maybe due to event lost over NCP communication (quite rare)

  • Configuration request is busy due to unavailable resources in the BT Mesh Stack

Modules#

btmesh_conf_executor_status_t

btmesh_conf_executor

Enumerations#

enum
BTMESH_CONF_EXEC_STATE_IDLE
BTMESH_CONF_EXEC_STATE_TASK_SET
BTMESH_CONF_EXEC_STATE_TASK_EVENT_WAIT
BTMESH_CONF_EXEC_STATE_TASK_REQUEST_BUSY
BTMESH_CONF_EXEC_STATE_COUNT
}

State constants of BT Mesh Configuration Executor.

Typedefs#

State constants of BT Mesh Configuration Executor.

Current status of Configuration Executor.

typedef struct btmesh_conf_executor

BT Mesh Configuration Executor executes configuration jobs by executing the tasks in the task tree of the configuration job.

Functions#

btmesh_conf_executor_create(uint16_t id, btmesh_conf_distributor_t *const parent)
void
btmesh_conf_executor_destroy(btmesh_conf_executor_t *const self)
sl_status_t
btmesh_conf_executor_start_job(btmesh_conf_executor_t *const self, btmesh_conf_job_t *job)
void
btmesh_conf_executor_get_status(btmesh_conf_executor_t *const self, btmesh_conf_executor_status_t *status)
void
btmesh_conf_executor_on_event(btmesh_conf_executor_t *const self, const sl_btmesh_msg_t *evt)

Enumeration Documentation#

btmesh_conf_executor_state_t#

btmesh_conf_executor_state_t

State constants of BT Mesh Configuration Executor.

Enumerator
BTMESH_CONF_EXEC_STATE_IDLE

Configuration Executor is ready to execute waiting configuration jobs.

BTMESH_CONF_EXEC_STATE_TASK_SET

Configuration Executor advanced to the next configuration task.

BTMESH_CONF_EXEC_STATE_TASK_EVENT_WAIT

Configuration Executor forwards events to current task and waits for result.

BTMESH_CONF_EXEC_STATE_TASK_REQUEST_BUSY

Configuration Executor waits the retry time because the previous task request was busy due to unavailable resources.

BTMESH_CONF_EXEC_STATE_COUNT

Number of Configuration Executor states.


Typedef Documentation#

btmesh_conf_distributor_t#

typedef struct btmesh_conf_distributor_t btmesh_conf_distributor_t

btmesh_conf_executor_state_t#

typedef enum btmesh_conf_executor_state_t btmesh_conf_executor_state_t

State constants of BT Mesh Configuration Executor.


btmesh_conf_executor_status_t#

typedef struct btmesh_conf_executor_status_t btmesh_conf_executor_status_t

Current status of Configuration Executor.


btmesh_conf_executor_t#

typedef struct btmesh_conf_executor btmesh_conf_executor_t

BT Mesh Configuration Executor executes configuration jobs by executing the tasks in the task tree of the configuration job.


Function Documentation#

btmesh_conf_executor_create#

btmesh_conf_executor_t * btmesh_conf_executor_create (uint16_t id, btmesh_conf_distributor_t *const parent)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]id

Identifier of BT Mesh Configuration Executor instance

btmesh_conf_distributor_t *const[in]parent

BT Mesh Configuration Distributor which executor belongs to

Create BT Mesh Configuration Executor instance which belongs to the specified configuration distributor

Returns

  • Created configuration executor.

Return values

  • NULL: If the configuration executor creation fails.

BT Mesh Configuration Executor is allocated and initialized with the provided BT Mesh Configuration Distributor parent. The initialized configuration executor is in idle state and therefore it does not execute any jobs. The identifier of configuration executor shall be unique in the context of parent configuration distributor.


btmesh_conf_executor_destroy#

void btmesh_conf_executor_destroy (btmesh_conf_executor_t *const self)
Parameters
TypeDirectionArgument NameDescription
btmesh_conf_executor_t *const[in]self

Pointer to the configuration executor which shall be destroyed

Deallocates the BT Mesh Configuration Executor instance

If the configuration executor runs a configuration job then the job and all of its tasks are deallocated as well.


btmesh_conf_executor_start_job#

sl_status_t btmesh_conf_executor_start_job (btmesh_conf_executor_t *const self, btmesh_conf_job_t * job)
Parameters
TypeDirectionArgument NameDescription
btmesh_conf_executor_t *const[in]self

Pointer to the configuration executor instance

btmesh_conf_job_t *[in]job

Configuration job which shall be started

Start execution of the specified configuration job in a BT Mesh Configuration Executor instance

Returns

  • Status of configuration job execution start.

Return values

  • SL_STATUS_OK: If the configuration job is started properly.

  • SL_STATUS_INVALID_STATE: If the executor is busy with the execution of another configuration job.

  • SL_STATUS_NOT_FOUND: If the first task of configuration job could not be set.

  • SL_STATUS_FAIL: If one or more configuration requests are failed and no further configuration task remains in the task tree which can be executed.


btmesh_conf_executor_get_status#

void btmesh_conf_executor_get_status (btmesh_conf_executor_t *const self, btmesh_conf_executor_status_t * status)
Parameters
TypeDirectionArgument NameDescription
btmesh_conf_executor_t *const[in]self

Pointer to the configuration executor instance

btmesh_conf_executor_status_t *[out]status

Pointer where status of the executor instance is written

Get status BT Mesh Configuration Executor instance


btmesh_conf_executor_on_event#

void btmesh_conf_executor_on_event (btmesh_conf_executor_t *const self, const sl_btmesh_msg_t * evt)
Parameters
TypeDirectionArgument NameDescription
btmesh_conf_executor_t *const[in]self

Pointer to the configuration executor instance

const sl_btmesh_msg_t *[in]evt

BT Mesh Stack event

Event handler of BT Mesh Configuration Executor instance

The BT Mesh Configuration Executor event handler forwards events to the current task of the configuration job which is executed at the moment. If the event is a configuration event then it is forwarded only if the handle in the event matches the handle returned by the last configuration BT Mesh Stack request which belongs to the same configuration task.