@@ -84,7 +84,7 @@ static void gatt_connected(struct bt_conn *conn, uint8_t err)
8484 struct bt_conn_info info ;
8585
8686 bt_conn_get_info (conn , & info );
87- if (info .role != BT_CONN_ROLE_SLAVE ||
87+ if (info .role != BT_CONN_ROLE_PERIPHERAL ||
8888 !service_registered || bt_mesh_is_provisioned ()) {
8989 return ;
9090 }
@@ -99,7 +99,7 @@ static void gatt_disconnected(struct bt_conn *conn, uint8_t reason)
9999 struct bt_conn_info info ;
100100
101101 bt_conn_get_info (conn , & info );
102- if (info .role != BT_CONN_ROLE_SLAVE ||
102+ if (info .role != BT_CONN_ROLE_PERIPHERAL ||
103103 !service_registered ) {
104104 return ;
105105 }
@@ -108,14 +108,8 @@ static void gatt_disconnected(struct bt_conn *conn, uint8_t reason)
108108
109109 bt_mesh_pb_gatt_close (conn );
110110
111- if (!bt_mesh_is_provisioned ()) {
112- return ;
113- }
114-
115- (void )bt_mesh_pb_gatt_disable ();
116-
117- if (IS_ENABLED (CONFIG_BT_MESH_GATT_PROXY )) {
118- (void )bt_mesh_proxy_gatt_enable ();
111+ if (bt_mesh_is_provisioned ()) {
112+ (void )bt_mesh_pb_gatt_disable ();
119113 }
120114}
121115
@@ -304,10 +298,7 @@ int bt_mesh_pb_gatt_adv_start(void)
304298 return err ;
305299}
306300
307- /* Add `_2` suffix forces this callback to be called
308- * after proxy_srv's conn_cb.
309- */
310- BT_CONN_CB_DEFINE (conn_callbacks_2 ) = {
301+ BT_CONN_CB_DEFINE (conn_callbacks ) = {
311302 .connected = gatt_connected ,
312303 .disconnected = gatt_disconnected ,
313304};
0 commit comments