File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
features/nanostack/mbed-mesh-api Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 153
153
"wisun-uc-dwell-interval" : {
154
154
"help" : " Unicast dwell interval. Range: 15-255 milliseconds" ,
155
155
"value" : 0
156
+ },
157
+ "certificate-header" : {
158
+ "help" : " Certificate header" ,
159
+ "value" : null
160
+ },
161
+ "root-certificate" : {
162
+ "help" : " Root certificate in PEM format (must be a null terminated c-string)" ,
163
+ "value" : null
164
+ },
165
+ "own-certificate" : {
166
+ "help" : " Own certificate in PEM format (must be a null terminated c-string)" ,
167
+ "value" : null
168
+ },
169
+ "own-certificate-key" : {
170
+ "help" : " Own certificate's key in PEM format (must be a null terminated c-string)" ,
171
+ "value" : null
156
172
}
157
173
},
158
174
"target_overrides" : {
Original file line number Diff line number Diff line change 28
28
#include "mac_api.h"
29
29
#include "sw_mac.h"
30
30
#include "ws_management_api.h" //ws_management_node_init
31
+ #ifdef MBED_CONF_MBED_MESH_API_CERTIFICATE_HEADER
32
+ #include MBED_CONF_MBED_MESH_API_CERTIFICATE_HEADER
33
+ #endif
31
34
32
35
// For tracing we need to define flag, have include and define group
33
36
//#define HAVE_DEBUG
@@ -210,6 +213,18 @@ static void wisun_tasklet_configure_and_connect_to_network(void)
210
213
network_name ,
211
214
fhss_timer_ptr );
212
215
216
+ #if defined(MBED_CONF_MBED_MESH_API_CERTIFICATE_HEADER )
217
+ arm_certificate_chain_entry_s chain_info ;
218
+ memset (& chain_info , 0 , sizeof (arm_certificate_chain_entry_s ));
219
+ chain_info .cert_chain [0 ] = (const uint8_t * ) MBED_CONF_MBED_MESH_API_ROOT_CERTIFICATE ;
220
+ chain_info .cert_len [0 ] = strlen ((const char * ) MBED_CONF_MBED_MESH_API_ROOT_CERTIFICATE ) + 1 ;
221
+ chain_info .cert_chain [1 ] = (const uint8_t * ) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE ;
222
+ chain_info .cert_len [1 ] = strlen ((const char * ) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE ) + 1 ;
223
+ chain_info .key_chain [1 ] = (const uint8_t * ) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE_KEY ;
224
+ chain_info .chain_length = 2 ;
225
+ arm_network_certificate_chain_set ((const arm_certificate_chain_entry_s * ) & chain_info );
226
+ #endif
227
+
213
228
status = arm_nwk_interface_up (wisun_tasklet_data_ptr -> network_interface_id );
214
229
if (status >= 0 ) {
215
230
wisun_tasklet_data_ptr -> tasklet_state = TASKLET_STATE_BOOTSTRAP_STARTED ;
You can’t perform that action at this time.
0 commit comments