Wirepas SDK
provisioning.h
Go to the documentation of this file.
1 /* Copyright 2019 Wirepas Ltd. All Rights Reserved.
2  *
3  * See file LICENSE.txt for full license details.
4  *
5  */
6 #ifndef _PROVISIONING_H_
7 #define _PROVISIONING_H_
8 
9 #include <stdint.h>
10 #include "api.h"
11 #include "wms_joining.h"
12 #include "wms_settings.h"
13 #include "cbor.h"
14 
16 typedef enum
17 {
25 
27 typedef enum
28 {
42 
44 typedef enum
45 {
51 
60 typedef bool (*provisioning_end_cb_f)(provisioning_res_e result);
61 
73 typedef void (*provisioning_user_data_cb_f)(uint32_t id,
74  CborType type,
75  uint8_t * data,
76  uint8_t len);
77 
88 typedef const app_lib_joining_received_beacon_t *
89  (*provisioning_joining_beacon_cb_f)
90  (const app_lib_joining_received_beacon_t * beacons);
91 
96 typedef struct
97 {
107 
127  const uint8_t * uid,
128  uint8_t uid_len,
129  provisioning_method_e method,
130  provisioning_proxy_net_param_t * net_param);
131 
135 typedef struct
136 {
140  uint8_t nb_retry;
142  uint16_t timeout_s;
144  const uint8_t * uid;
146  uint8_t uid_len;
151  const uint8_t * key;
153  uint8_t key_len;
160 
164 
172 typedef struct
173 {
175  uint8_t * payload;
177  uint8_t num_bytes;
179  int8_t tx_power;
188  const uint8_t * key;
190  uint8_t key_len;
194 
215 
222 
231 
245 
254 
262 
263 #endif //_PROVISIONING_H_
PROV_RES_ERROR_JOINING
@ PROV_RES_ERROR_JOINING
Definition: provisioning.h:37
provisioning_joining_beacon_cb_f
const typedef app_lib_joining_received_beacon_t *(* provisioning_joining_beacon_cb_f)(const app_lib_joining_received_beacon_t *beacons)
Selects which joining beacon to connect to at the end of a scan.
Definition: provisioning.h:90
provisioning_conf_t::uid
const uint8_t * uid
Definition: provisioning.h:144
provisioning_proxy_conf_t
This structure holds the joining proxy parameters.
Definition: provisioning.h:172
PROV_RET_INVALID_PARAM
@ PROV_RET_INVALID_PARAM
Definition: provisioning.h:20
PROV_RES_SUCCESS
@ PROV_RES_SUCCESS
Definition: provisioning.h:29
provisioning_res_e
provisioning_res_e
Provisioning result.
Definition: provisioning.h:27
app_lib_settings_net_channel_t
uint8_t app_lib_settings_net_channel_t
Channel type definition.
Definition: wms_settings.h:58
wms_joining.h
provisioning_proxy_conf_t::num_bytes
uint8_t num_bytes
Definition: provisioning.h:177
PROV_RES_ERROR_SCANNING_BEACONS
@ PROV_RES_ERROR_SCANNING_BEACONS
Definition: provisioning.h:35
provisioning_conf_t::method
provisioning_method_e method
Definition: provisioning.h:138
PROV_RES_INVALID_PACKET
@ PROV_RES_INVALID_PACKET
Definition: provisioning.h:33
Provisioning_start
provisioning_ret_e Provisioning_start(void)
Start the provisioning process.
provisioning_user_data_cb_f
void(* provisioning_user_data_cb_f)(uint32_t id, CborType type, uint8_t *data, uint8_t len)
Received User provisioning data callback. Provisioning data is received as a map of id:data....
Definition: provisioning.h:73
PROV_RET_OK
@ PROV_RET_OK
Definition: provisioning.h:18
Provisioning_Proxy_init
provisioning_ret_e Provisioning_Proxy_init(provisioning_proxy_conf_t *conf)
Initialize the provisioning proxy.
Provisioning_Proxy_start
provisioning_ret_e Provisioning_Proxy_start(void)
Start sending joining beacons. Provisioning packets will be forwarded to provisioning server or treat...
Provisioning_init
provisioning_ret_e Provisioning_init(provisioning_conf_t *conf)
Initialize the provisioning process.
cbor.h
PROV_RES_ERROR_SENDING_DATA
@ PROV_RES_ERROR_SENDING_DATA
Definition: provisioning.h:34
wms_settings.h
provisioning_conf_t
This structure holds the provisioning parameters.
Definition: provisioning.h:135
PROV_RET_INVALID_STATE
@ PROV_RET_INVALID_STATE
Definition: provisioning.h:19
PROV_METHOD_UNSECURED
@ PROV_METHOD_UNSECURED
Definition: provisioning.h:46
provisioning_conf_t::timeout_s
uint16_t timeout_s
Definition: provisioning.h:142
provisioning_proxy_conf_t::payload
uint8_t * payload
Definition: provisioning.h:175
PROV_RET_JOINING_LIB_ERROR
@ PROV_RET_JOINING_LIB_ERROR
Definition: provisioning.h:22
app_lib_settings_net_addr_t
uint32_t app_lib_settings_net_addr_t
Network address type definition.
Definition: wms_settings.h:53
PROV_METHOD_SECURED
@ PROV_METHOD_SECURED
Definition: provisioning.h:47
provisioning_proxy_net_param_t::net_chan
app_lib_settings_net_channel_t net_chan
Definition: provisioning.h:105
Provisioning_stop
provisioning_ret_e Provisioning_stop(void)
Stops the provisioning process.
PROV_RET_INTERNAL_ERROR
@ PROV_RET_INTERNAL_ERROR
Definition: provisioning.h:23
provisioning_method_e
provisioning_method_e
supported provisioning methods
Definition: provisioning.h:44
provisioning_conf_t::uid_len
uint8_t uid_len
Definition: provisioning.h:146
provisioning_proxy_conf_t::is_local_unsec_allowed
bool is_local_unsec_allowed
Definition: provisioning.h:181
PROV_RES_TIMEOUT
@ PROV_RES_TIMEOUT
Definition: provisioning.h:30
PROV_RES_INVALID_DATA
@ PROV_RES_INVALID_DATA
Definition: provisioning.h:32
provisioning_ret_e
provisioning_ret_e
Return codes of provisioning functions.
Definition: provisioning.h:16
Provisioning_Proxy_stop
provisioning_ret_e Provisioning_Proxy_stop(void)
Stops the provisioning proxy.
CborType
CborType
Definition: cbor.h:82
provisioning_conf_t::beacon_joining_cb
provisioning_joining_beacon_cb_f beacon_joining_cb
Definition: provisioning.h:159
provisioning_conf_t::key
const uint8_t * key
Definition: provisioning.h:151
APP_LIB_SETTINGS_AES_KEY_NUM_BYTES
#define APP_LIB_SETTINGS_AES_KEY_NUM_BYTES
AES key size in bytes.
Definition: wms_settings.h:44
PROV_RES_STOPPED
@ PROV_RES_STOPPED
Definition: provisioning.h:39
provisioning_end_cb_f
bool(* provisioning_end_cb_f)(provisioning_res_e result)
The end provisioning callback. This function is called at the end of the provisioning process.
Definition: provisioning.h:60
app_lib_settings_key_management_configuration_t
Structure to hold key management configuration information for the settings API.
Definition: wms_settings.h:110
provisioning_proxy_conf_t::tx_power
int8_t tx_power
Definition: provisioning.h:179
PROV_RET_INVALID_DATA
@ PROV_RET_INVALID_DATA
Definition: provisioning.h:21
PROV_METHOD_KEY_MGMT
@ PROV_METHOD_KEY_MGMT
Definition: provisioning.h:49
provisioning_conf_t::p_key_mgmt_config
app_lib_settings_key_management_configuration_t * p_key_mgmt_config
Definition: provisioning.h:162
provisioning_proxy_start_cb_f
bool(* provisioning_proxy_start_cb_f)(const uint8_t *uid, uint8_t uid_len, provisioning_method_e method, provisioning_proxy_net_param_t *net_param)
The proxy received START packet callback. This function is called when the proxy receives a valid STA...
Definition: provisioning.h:126
provisioning_conf_t::nb_retry
uint8_t nb_retry
Definition: provisioning.h:140
provisioning_conf_t::user_data_cb
provisioning_user_data_cb_f user_data_cb
Definition: provisioning.h:157
provisioning_proxy_conf_t::start_cb
provisioning_proxy_start_cb_f start_cb
Definition: provisioning.h:192
PROV_RES_ERROR_NO_ROUTE
@ PROV_RES_ERROR_NO_ROUTE
Definition: provisioning.h:38
PROV_RES_NACK
@ PROV_RES_NACK
Definition: provisioning.h:31
PROV_RES_ERROR_INTERNAL
@ PROV_RES_ERROR_INTERNAL
Definition: provisioning.h:40
provisioning_proxy_conf_t::is_local_sec_allowed
bool is_local_sec_allowed
Definition: provisioning.h:183
provisioning_conf_t::key_len
uint8_t key_len
Definition: provisioning.h:153
provisioning_proxy_net_param_t
This structure contains the network parameters sent by the provisioning proxy to the new node.
Definition: provisioning.h:96
PROV_METHOD_EXTENDED_UID
@ PROV_METHOD_EXTENDED_UID
Definition: provisioning.h:48
provisioning_conf_t::end_cb
provisioning_end_cb_f end_cb
Definition: provisioning.h:155
provisioning_proxy_net_param_t::net_addr
app_lib_settings_net_addr_t net_addr
Definition: provisioning.h:103
api.h