diff --git a/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_gatt.c b/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_gatt.c index d83ca0a52..97f13d59d 100644 --- a/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_gatt.c +++ b/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_gatt.c @@ -917,6 +917,12 @@ void SoftbusBleAdapterInit(void) int32_t ret = SoftBusAddBtStateListener(&g_softbusBcAdapterBtStateListener); DISC_CHECK_AND_RETURN_LOGE(ret >= 0, DISC_BLE_ADAPTER, "add bt state listener failed."); g_adapterBtStateListenerId = ret; + for (uint8_t channelId = 0; channelId < GATT_ADV_MAX_NUM; channelId++) { + g_advChannel[channelId].advId = -1; + } + for (uint8_t channelId = 0; channelId < GATT_SCAN_MAX_NUM; channelId++) { + g_scanChannel[channelId].scannerId = -1; + } } void SoftbusBleAdapterDeInit(void)