69
69
#if defined(CONFIG_BT_WIFIPROV_SERVER )
70
70
static void wifiprov_connect_ap_ind (void )
71
71
{
72
- printf ("Recevied indication to connect to AP\r\n" );
72
+ printf ("Recevied indication to connect to AP\r\n" );
73
73
wifi_prov_api_event_trigger_connect ();
74
74
}
75
75
@@ -87,7 +87,7 @@ static void wifiprov_ssid_ind(void *buf,size_t size)
87
87
88
88
static void wifiprov_bssid_ind (void * buf ,size_t size )
89
89
{
90
-
90
+
91
91
printf ("Recevied bssid: %s \r\n" , bt_hex (buf , size ));
92
92
}
93
93
@@ -115,7 +115,7 @@ struct conn_callback WifiProv_conn_callback = {
115
115
116
116
void model_gen_cb (uint8_t value )
117
117
{
118
- bl_gpio_output_set (LED_PIN , value );
118
+ bl_gpio_output_set (LED_PIN , value );
119
119
}
120
120
121
121
#if defined(CONFIG_BT_MESH_MODEL )
@@ -132,6 +132,9 @@ static void example_handle_gen_onoff_msg(bfl_ble_mesh_model_t *model,
132
132
break ;
133
133
case BFL_BLE_MESH_MODEL_OP_GEN_ONOFF_SET :
134
134
case BFL_BLE_MESH_MODEL_OP_GEN_ONOFF_SET_UNACK :
135
+ if (!set ) {
136
+ break ;
137
+ }
135
138
if (set -> op_en == false) {
136
139
srv -> state .onoff = set -> onoff ;
137
140
} else {
@@ -209,6 +212,9 @@ static void example_handle_light_lgn_msg(bfl_ble_mesh_model_t *model,
209
212
break ;
210
213
case BFL_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_SET :
211
214
case BFL_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_SET_UNACK :
215
+ if (!set ) {
216
+ break ;
217
+ }
212
218
if (set -> op_en == false) {
213
219
srv -> state -> lightness_actual = set -> lightness ;
214
220
} else {
@@ -243,14 +249,14 @@ static void example_ble_mesh_lighting_server_cb(bfl_ble_mesh_lighting_server_cb_
243
249
}
244
250
else if (param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_CTL_SET ||
245
251
param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_CTL_SET_UNACK ) {
246
- printf ("Light ctl ln[%x]tp[%x]uv[%x]\n" ,
252
+ printf ("Light ctl ln[%x]tp[%x]uv[%x]\n" ,
247
253
param -> value .state_change .ctl_set .lightness ,
248
254
param -> value .state_change .ctl_set .temperature ,
249
255
param -> value .state_change .ctl_set .delta_uv );
250
256
}
251
257
else if (param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_HSL_SET ||
252
258
param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_HSL_SET_UNACK ) {
253
- printf ("Light hsl l[%x]h[%x]s[%x]\n" ,
259
+ printf ("Light hsl l[%x]h[%x]s[%x]\n" ,
254
260
param -> value .state_change .hsl_set .lightness ,
255
261
param -> value .state_change .hsl_set .hue ,
256
262
param -> value .state_change .hsl_set .saturation );
@@ -265,15 +271,15 @@ static void example_ble_mesh_lighting_server_cb(bfl_ble_mesh_lighting_server_cb_
265
271
}
266
272
else if (param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_CTL_GET ) {
267
273
bfl_ble_mesh_light_ctl_srv_t * srv = param -> model -> user_data ;
268
- printf ("Light ctl ln[%x]ln_t[%x] tp[%x]tp_t[%x] uv[%x]uv_t[%x]\n" ,
274
+ printf ("Light ctl ln[%x]ln_t[%x] tp[%x]tp_t[%x] uv[%x]uv_t[%x]\n" ,
269
275
srv -> state -> lightness , srv -> state -> target_lightness ,
270
276
srv -> state -> temperature , srv -> state -> target_temperature ,
271
277
srv -> state -> delta_uv , srv -> state -> target_delta_uv );
272
278
//example_handle_gen_onoff_msg(param->model, ¶m->ctx, NULL);
273
279
}
274
280
else if (param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_HSL_GET ) {
275
281
bfl_ble_mesh_light_hsl_srv_t * srv = param -> model -> user_data ;
276
- printf ("Light ctl l[%x]l_t[%x] h[%x]h_t[%x] s[%x]s_t[%x]\n" ,
282
+ printf ("Light ctl l[%x]l_t[%x] h[%x]h_t[%x] s[%x]s_t[%x]\n" ,
277
283
srv -> state -> lightness , srv -> state -> target_lightness ,
278
284
srv -> state -> hue , srv -> state -> target_hue ,
279
285
srv -> state -> saturation , srv -> state -> target_saturation );
@@ -293,7 +299,7 @@ static void example_ble_mesh_lighting_server_cb(bfl_ble_mesh_lighting_server_cb_
293
299
}
294
300
else if (param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_CTL_SET ||
295
301
param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_CTL_SET_UNACK ) {
296
- printf ("Light ctl ln[%x] tp[%d] uv[%x] tid[%x]\n" ,
302
+ printf ("Light ctl ln[%x] tp[%d] uv[%x] tid[%x]\n" ,
297
303
param -> value .set .ctl .lightness ,
298
304
param -> value .set .ctl .temperature ,
299
305
param -> value .set .ctl .delta_uv ,
@@ -306,7 +312,7 @@ static void example_ble_mesh_lighting_server_cb(bfl_ble_mesh_lighting_server_cb_
306
312
}
307
313
else if (param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_HSL_SET ||
308
314
param -> ctx .recv_op == BFL_BLE_MESH_MODEL_OP_LIGHT_HSL_SET_UNACK ) {
309
- printf ("Light hsl l[%x] h[%d] s[%x] tid[%x]\n" ,
315
+ printf ("Light hsl l[%x] h[%d] s[%x] tid[%x]\n" ,
310
316
param -> value .set .hsl .lightness ,
311
317
param -> value .set .hsl .hue ,
312
318
param -> value .set .hsl .saturation ,
@@ -330,7 +336,7 @@ static void example_ble_mesh_lighting_server_cb(bfl_ble_mesh_lighting_server_cb_
330
336
#ifndef CONFIG_BT_TL
331
337
void bt_enable_cb (int err )
332
338
{
333
- if (!err ) {
339
+ if (!err ) {
334
340
ble_cli_register ();
335
341
#if defined(CONFIG_BT_STACK_PTS )
336
342
pts_cli_register ();
@@ -340,7 +346,7 @@ void bt_enable_cb(int err)
340
346
blemesh_cli_register ();
341
347
#if defined(CONFIG_BT_MESH_MODEL )
342
348
#if defined(CONFIG_BT_MESH_MODEL_GEN_SRV )
343
- bl_gpio_enable_output (LED_PIN , LED_PIN_PULLUP , LED_PIN_PULDONW );
349
+ bl_gpio_enable_output (LED_PIN , LED_PIN_PULLUP , LED_PIN_PULDONW );
344
350
bfl_ble_mesh_register_generic_server_callback (example_ble_mesh_generic_server_cb );
345
351
#endif
346
352
#if defined(CONFIG_BT_MESH_MODEL_LIGHT_SRV )
0 commit comments