fix:init gatt channelId and advId

Signed-off-by: zhanghaodong <zhanghaodong12@huawei.com>
This commit is contained in:
zhanghaodong 2024-06-27 20:13:46 +08:00
parent 7e212d7079
commit 42d50bffef

View File

@ -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)