![]() |
Wirepas SDK
|
Local provisioning library.
Definition in file local_provisioning.h.
Go to the source code of this file.
Typedefs | |
| typedef const 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. | |
| 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. | |
| 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. | |
Functions | |
| Local_provisioning_res_e | Local_provisioning_init (local_provisioning_psk_t *psk, local_provisioning_proxy_enabled_cb on_proxy_enabled_cb, const local_provisioning_config_t *conf) |
| Initialize the Local provisioning library. | |
| 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. | |
| Local_provisioning_res_e | Local_provisioning_start_joining (local_provisioning_joining_beacon_selection_f cb_beacons, local_provisioning_joining_done_cb cb_end) |
| Start a joining session Node will start a joining request. | |
| void | Local_provisioning_reset_node () |
| Reset all node settings. | |
Data Structures | |
| struct | local_provisioning_psk_t |
| Pre shared key structure. More... | |
| struct | local_provisioning_config_t |
| Configuration for the Local provisioning library. More... | |
Enumerations | |
| enum | Local_provisioning_res_e { LOCAL_PROVISIONING_RES_SUCCESS = 0 , LOCAL_PROVISIONING_RES_UNINTIALLIZED = 1 , LOCAL_PROVISIONING_RES_WRONG_STATE = 2 , LOCAL_PROVISIONING_RES_INTERNAL_ERROR = 3 , LOCAL_PROVISIONING_RES_UNPROVISIONED = 4 , LOCAL_PROVISIONING_RES_ALREADY_PROVISIONED = 5 } |
| typedef const 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.
| beacons | A buffer of joining beacons. |
Definition at line 46 of file local_provisioning.h.
| 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.
| success | True if provisioning session ended with a valid configuration, false otherwise |
Definition at line 70 of file local_provisioning.h.
| 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.
| enabled | True if joining beacons are currently sent, false otherwise |
Definition at line 56 of file local_provisioning.h.
| Local_provisioning_res_e Local_provisioning_init | ( | local_provisioning_psk_t * | psk, |
| local_provisioning_proxy_enabled_cb | on_proxy_enabled_cb, | ||
| const local_provisioning_config_t * | conf | ||
| ) |
Initialize the Local provisioning library.
| 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. |
| on_proxy_enabled_cb | Callback notified when proxy is enabled or disabled. May be NULL. |
| conf | Provisioning configuration. If NULL, defaults are used. |
| 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.
| void Local_provisioning_reset_node | ( | ) |
Reset all node settings.
| Local_provisioning_res_e Local_provisioning_start_joining | ( | local_provisioning_joining_beacon_selection_f | cb_beacons, |
| local_provisioning_joining_done_cb | cb_end | ||
| ) |
Start a joining session Node will start a joining request.
| 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 |
| 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] | |
| struct local_provisioning_config_t |
Configuration for the Local provisioning library.
Definition at line 75 of file local_provisioning.h.
| Data Fields | ||
|---|---|---|
| uint16_t | timeout_s |
Provisioning session timeout in seconds |
Definition at line 19 of file local_provisioning.h.