The provisoner configures a network in a fixed, predefined way. Together with light switch server and light switch client, it is part of the light switch example network demonstration.
Table of contents
The provisioner is implemented as a multi-layered state machine due to the asynchronous nature of the provisioning and configuration process.
The following diagram shows the typical state transitions of the provisioner while provisioning and configuring light switch client.
For more information on how a provisioning process works, see the Mesh provisioning Guide.
You can find the source code of the mesh provisioner in the following folder: <InstallFolder>/examples/light_switch/provisioner
To run the mesh provisioner, see Light switch example.
The provisioner uses the following set of APIs:
In general, the provisioner role is an order of magnitude more complex than the provisionee role, both in resource requirements and in application complexity. Therefore, there is no simple "press play and it works"-API for the provisioning and configuration process. However, for a specific use case, it can be reduced into a set of simple steps, as implemented in the provisioner example:
In the example code, this behavior is split between the following modules:
examples/light_switch/provisioner/src/main.c
: Deals with the initialization and setup of the mesh stack.examples/light_switch/provisioner/src/provisioner_helper.c
: Deals with the provisioning process.examples/light_switch/provisioner/src/node_setup.c
: Deals with the configuration process of the node once the provisioning is completed.The following figure shows the details of how provisioning and configuration are implemented with the provided APIs. Note that the figure may simplify some API calls to provide a clearer understanding. See the relevant source files for details.