diff --git a/components/bt/ble_mesh/mesh_core/mesh_bearer_adapt.c b/components/bt/ble_mesh/mesh_core/mesh_bearer_adapt.c index 5573077764..73c6d7d3f5 100644 --- a/components/bt/ble_mesh/mesh_core/mesh_bearer_adapt.c +++ b/components/bt/ble_mesh/mesh_core/mesh_bearer_adapt.c @@ -816,13 +816,12 @@ static void bt_mesh_bta_gatts_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data) } break; } - case BTA_GATTS_ADD_INCL_SRVC_EVT: { + case BTA_GATTS_ADD_INCL_SRVC_EVT: svc_handle = p_data->add_result.attr_id; if (future_mesh != NULL) { future_ready(future_mesh, FUTURE_SUCCESS); } break; - } case BTA_GATTS_ADD_CHAR_EVT: char_handle = p_data->add_result.attr_id; if (future_mesh != NULL) { @@ -841,7 +840,7 @@ static void bt_mesh_bta_gatts_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data) break; case BTA_GATTS_STOP_EVT: break; - case BTA_GATTS_CONNECT_EVT: { + case BTA_GATTS_CONNECT_EVT: /*Adv disabled*/ // atomic_clear_bit(bt_dev.flags, BT_DEV_ADVERTISING); if (bt_mesh_gatts_conn_cb != NULL && bt_mesh_gatts_conn_cb->connected != NULL) { @@ -850,10 +849,11 @@ static void bt_mesh_bta_gatts_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data) bt_mesh_gatts_conn[index].handle = BT_MESH_GATT_GET_CONN_ID(p_data->conn.conn_id); (bt_mesh_gatts_conn_cb->connected)(&bt_mesh_gatts_conn[index], 0); } + /* Send GATT service change indication */ + BTA_GATTS_SendServiceChangeIndication(p_data->conn.server_if, p_data->conn.remote_bda); } break; - } - case BTA_GATTS_DISCONNECT_EVT: { + case BTA_GATTS_DISCONNECT_EVT: /*Adv disabled*/ // atomic_clear_bit(bt_dev.flags, BT_DEV_ADVERTISING); if (bt_mesh_gatts_conn_cb != NULL && bt_mesh_gatts_conn_cb->disconnected != NULL) { @@ -864,7 +864,6 @@ static void bt_mesh_bta_gatts_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data) } } break; - } case BTA_GATTS_CLOSE_EVT: break; default: diff --git a/examples/bluetooth/ble_mesh/ble_mesh_client_model/sdkconfig.defaults b/examples/bluetooth/ble_mesh/ble_mesh_client_model/sdkconfig.defaults index 365ccbe944..1020655d5a 100644 --- a/examples/bluetooth/ble_mesh/ble_mesh_client_model/sdkconfig.defaults +++ b/examples/bluetooth/ble_mesh/ble_mesh_client_model/sdkconfig.defaults @@ -6,6 +6,8 @@ CONFIG_SCAN_DUPLICATE_TYPE=2 CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200 CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200 +CONFIG_GATTS_ENABLE=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y CONFIG_BT_MESH=y CONFIG_BT_MESH_USE_DUPLICATE_SCAN=y CONFIG_BT_MESH_NODE=y diff --git a/examples/bluetooth/ble_mesh/ble_mesh_console/ble_mesh_node/sdkconfig.defaults b/examples/bluetooth/ble_mesh/ble_mesh_console/ble_mesh_node/sdkconfig.defaults index 56ab57107f..39361b6b4a 100644 --- a/examples/bluetooth/ble_mesh/ble_mesh_console/ble_mesh_node/sdkconfig.defaults +++ b/examples/bluetooth/ble_mesh/ble_mesh_console/ble_mesh_node/sdkconfig.defaults @@ -9,6 +9,8 @@ CONFIG_SCAN_DUPLICATE_TYPE=2 CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200 CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200 +CONFIG_GATTS_ENABLE=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y CONFIG_BT_MESH=y CONFIG_BT_MESH_USE_DUPLICATE_SCAN=y CONFIG_BT_MESH_NODE=y diff --git a/examples/bluetooth/ble_mesh/ble_mesh_fast_provision/ble_mesh_fast_prov_server/sdkconfig.defaults b/examples/bluetooth/ble_mesh/ble_mesh_fast_provision/ble_mesh_fast_prov_server/sdkconfig.defaults index a867c0743a..96d927b74a 100644 --- a/examples/bluetooth/ble_mesh/ble_mesh_fast_provision/ble_mesh_fast_prov_server/sdkconfig.defaults +++ b/examples/bluetooth/ble_mesh/ble_mesh_fast_provision/ble_mesh_fast_prov_server/sdkconfig.defaults @@ -6,6 +6,8 @@ CONFIG_SCAN_DUPLICATE_TYPE=2 CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200 CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200 +CONFIG_GATTS_ENABLE=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y CONFIG_BT_MESH=y CONFIG_BT_MESH_USE_DUPLICATE_SCAN=y CONFIG_BT_MESH_FAST_PROV=y diff --git a/examples/bluetooth/ble_mesh/ble_mesh_node/sdkconfig.defaults b/examples/bluetooth/ble_mesh/ble_mesh_node/sdkconfig.defaults index 8429ab42e2..38cf86cd21 100644 --- a/examples/bluetooth/ble_mesh/ble_mesh_node/sdkconfig.defaults +++ b/examples/bluetooth/ble_mesh/ble_mesh_node/sdkconfig.defaults @@ -6,6 +6,8 @@ CONFIG_SCAN_DUPLICATE_TYPE=2 CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200 CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200 +CONFIG_GATTS_ENABLE=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y CONFIG_BT_MESH=y CONFIG_BT_MESH_USE_DUPLICATE_SCAN=y CONFIG_BT_MESH_NODE=y diff --git a/examples/bluetooth/ble_mesh/ble_mesh_wifi_coexist/sdkconfig.defaults b/examples/bluetooth/ble_mesh/ble_mesh_wifi_coexist/sdkconfig.defaults index cea461cc60..9a11835df6 100644 --- a/examples/bluetooth/ble_mesh/ble_mesh_wifi_coexist/sdkconfig.defaults +++ b/examples/bluetooth/ble_mesh/ble_mesh_wifi_coexist/sdkconfig.defaults @@ -10,6 +10,8 @@ CONFIG_SCAN_DUPLICATE_TYPE=2 CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200 CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200 +CONFIG_GATTS_ENABLE=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y CONFIG_BT_MESH=y CONFIG_BT_MESH_USE_DUPLICATE_SCAN=y CONFIG_BT_MESH_FAST_PROV=y