File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed
subsys/bluetooth/host/mesh Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -801,8 +801,7 @@ static void gatt_proxy_set(struct bt_mesh_model *model,
801
801
struct bt_mesh_subnet * sub = & bt_mesh .sub [i ];
802
802
803
803
if (sub -> net_idx != BT_MESH_KEY_UNUSED ) {
804
- sub -> node_id = BT_MESH_NODE_IDENTITY_STOPPED ;
805
- sub -> node_id_start = 0 ;
804
+ bt_mesh_proxy_identity_stop (sub );
806
805
}
807
806
}
808
807
@@ -2234,8 +2233,11 @@ static void node_identity_set(struct bt_mesh_model *model,
2234
2233
*/
2235
2234
if (IS_ENABLED (CONFIG_BT_MESH_GATT_PROXY ) &&
2236
2235
bt_mesh_gatt_proxy_get () == BT_MESH_GATT_PROXY_ENABLED ) {
2237
- sub -> node_id = node_id ;
2238
- sub -> node_id_start = node_id ? k_uptime_get_32 () : 0 ;
2236
+ if (node_id ) {
2237
+ bt_mesh_proxy_identity_start (sub );
2238
+ } else {
2239
+ bt_mesh_proxy_identity_stop (sub );
2240
+ }
2239
2241
bt_mesh_adv_update ();
2240
2242
}
2241
2243
Original file line number Diff line number Diff line change @@ -337,6 +337,18 @@ void bt_mesh_proxy_beacon_send(struct bt_mesh_subnet *sub)
337
337
}
338
338
}
339
339
340
+ void bt_mesh_proxy_identity_start (struct bt_mesh_subnet * sub )
341
+ {
342
+ sub -> node_id = BT_MESH_NODE_IDENTITY_RUNNING ;
343
+ sub -> node_id_start = k_uptime_get_32 ();
344
+ }
345
+
346
+ void bt_mesh_proxy_identity_stop (struct bt_mesh_subnet * sub )
347
+ {
348
+ sub -> node_id = BT_MESH_NODE_IDENTITY_STOPPED ;
349
+ sub -> node_id_start = 0 ;
350
+ }
351
+
340
352
int bt_mesh_proxy_identity_enable (void )
341
353
{
342
354
/* FIXME: Add support for multiple subnets */
@@ -360,8 +372,7 @@ int bt_mesh_proxy_identity_enable(void)
360
372
return 0 ;
361
373
}
362
374
363
- sub -> node_id = BT_MESH_NODE_IDENTITY_RUNNING ;
364
- sub -> node_id_start = k_uptime_get_32 ();
375
+ bt_mesh_proxy_identity_start (sub );
365
376
bt_mesh_adv_update ();
366
377
367
378
return 0 ;
@@ -1081,8 +1092,7 @@ static s32_t gatt_proxy_advertise(struct bt_mesh_subnet *sub)
1081
1092
active , remaining );
1082
1093
node_id_adv (sub );
1083
1094
} else {
1084
- sub -> node_id = BT_MESH_NODE_IDENTITY_STOPPED ;
1085
- sub -> node_id_start = 0 ;
1095
+ bt_mesh_proxy_identity_stop (sub );
1086
1096
BT_DBG ("Node ID stopped" );
1087
1097
}
1088
1098
}
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ struct net_buf_simple *bt_mesh_proxy_get_buf(void);
28
28
s32_t bt_mesh_proxy_adv_start (void );
29
29
void bt_mesh_proxy_adv_stop (void );
30
30
31
+ void bt_mesh_proxy_identity_start (struct bt_mesh_subnet * sub );
32
+ void bt_mesh_proxy_identity_stop (struct bt_mesh_subnet * sub );
33
+
31
34
bool bt_mesh_proxy_relay (struct net_buf_simple * buf , u16_t dst );
32
35
void bt_mesh_proxy_addr_add (struct net_buf_simple * buf , u16_t addr );
33
36
You can’t perform that action at this time.
0 commit comments