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,
801801 struct bt_mesh_subnet * sub = & bt_mesh .sub [i ];
802802
803803 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 );
806805 }
807806 }
808807
@@ -2234,8 +2233,11 @@ static void node_identity_set(struct bt_mesh_model *model,
22342233 */
22352234 if (IS_ENABLED (CONFIG_BT_MESH_GATT_PROXY ) &&
22362235 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+ }
22392241 bt_mesh_adv_update ();
22402242 }
22412243
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)
337337 }
338338}
339339
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+
340352int bt_mesh_proxy_identity_enable (void )
341353{
342354 /* FIXME: Add support for multiple subnets */
@@ -360,8 +372,7 @@ int bt_mesh_proxy_identity_enable(void)
360372 return 0 ;
361373 }
362374
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 );
365376 bt_mesh_adv_update ();
366377
367378 return 0 ;
@@ -1081,8 +1092,7 @@ static s32_t gatt_proxy_advertise(struct bt_mesh_subnet *sub)
10811092 active , remaining );
10821093 node_id_adv (sub );
10831094 } else {
1084- sub -> node_id = BT_MESH_NODE_IDENTITY_STOPPED ;
1085- sub -> node_id_start = 0 ;
1095+ bt_mesh_proxy_identity_stop (sub );
10861096 BT_DBG ("Node ID stopped" );
10871097 }
10881098 }
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ struct net_buf_simple *bt_mesh_proxy_get_buf(void);
2828s32_t bt_mesh_proxy_adv_start (void );
2929void bt_mesh_proxy_adv_stop (void );
3030
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+
3134bool bt_mesh_proxy_relay (struct net_buf_simple * buf , u16_t dst );
3235void bt_mesh_proxy_addr_add (struct net_buf_simple * buf , u16_t addr );
3336
You can’t perform that action at this time.
0 commit comments