Local provisioning library.
Definition in file local_provisioning.h.
Go to the source code of this file.
◆ local_provisioning_joining_done_cb
typedef bool(* local_provisioning_joining_done_cb) (bool success) |
Callback to be notified when local provisioning joining is finished It is an information for app.
- Parameters
-
success | True if provisioning session ended with a valid configuration, false otherwise |
- Returns
- True if the stack must be stopped in case of unsuccessful provisioning. If it is successful, it will always be restarted
- Note
- As stack must be started to try to join a newtork, it must be stoped at the end in case provisioning fails, otherwise network will scan on a network that doesn't exist. But it will generate a reboot. If not desired and main powered, satck can stay started
Definition at line 70 of file local_provisioning.h.
◆ local_provisioning_proxy_enabled_cb
typedef void(* local_provisioning_proxy_enabled_cb) (bool enabled) |
Callback to be notified when proxy is enabled It is an information for app. It can be used to blink a led for example.
- Parameters
-
enabled | True if joining beacons are currently sent, false otherwise |
Definition at line 56 of file local_provisioning.h.
◆ Local_provisioning_init()
Initialize the Local provisioning library.
- Parameters
-
psk | Pre Shared Key used between joining node and neighbor node. If set to NULL, secure method is still used but with a default key. |
- Returns
- Result code of the operation
- Note
- If psk is not set, even if data exchange is encrypted, anyone could decrypt it thanks to the default key available on GitHub. It is highly recommended to define a personal secret key that will be the same in all the nodes that can interact.
- Examples
- dualmcu_app/app.c.
◆ Local_provisioning_is_provisioned()
bool Local_provisioning_is_provisioned |
( |
| ) |
|
Is the node provisioned A node is considered provisioned if it has a valid config with network security keys set.
- Note
- Once provisioned, a node will automatically wait on app config specific order to start sending its joining beacons
- Returns
- True if node is provisioned, false otherwise.
◆ Local_provisioning_reset_node()
void Local_provisioning_reset_node |
( |
| ) |
|
Reset all node settings.
- Note
- This call will genrate a reboot of node and will never return
◆ Local_provisioning_start_joining()
Start a joining session Node will start a joining request.
- Parameters
-
cb_beacons | Callback to be called after a beacon scan to select the node to do the joining. If set to NULL, the beacon with the highest RSSI is selected |
cb_end | Callback to be called at the end of joining. If set to NULL, the stack is automatically stopped in case of failure |
- Returns
- Result code of the operation
◆ local_provisioning_psk_t
struct local_provisioning_psk_t |
Pre shared key structure.
Definition at line 31 of file local_provisioning.h.
Data Fields |
uint32_t |
id |
|
uint8_t |
psk[32] |
|
◆ Local_provisioning_res_e
Enumerator |
---|
LOCAL_PROVISIONING_RES_SUCCESS | Operation is a success.
|
LOCAL_PROVISIONING_RES_UNINTIALLIZED | |
LOCAL_PROVISIONING_RES_WRONG_STATE | |
LOCAL_PROVISIONING_RES_INTERNAL_ERROR | |
LOCAL_PROVISIONING_RES_UNPROVISIONED | |
LOCAL_PROVISIONING_RES_ALREADY_PROVISIONED | |
Definition at line 19 of file local_provisioning.h.
◆ local_provisioning_joining_beacon_selection_f
const typedef app_lib_joining_received_beacon_t*(* local_provisioning_joining_beacon_selection_f) (const app_lib_joining_received_beacon_t *beacons) |
Selects which joining beacon to connect to at the end of a scan.
- Note
- Joining network selection is up to the application. Any algorithm can be implemented for example by looking at the content of the beacon payload, or the network (address and channel) the node sending the beacons is connected to.
- Parameters
-
beacons | A buffer of joining beacons. |
- Returns
- The selected beacon.
Definition at line 48 of file local_provisioning.h.