diff --git a/hooks/useBluetoothDiscovery.js b/hooks/useBluetoothDiscovery.js index 60c54b0..8c678aa 100644 --- a/hooks/useBluetoothDiscovery.js +++ b/hooks/useBluetoothDiscovery.js @@ -384,7 +384,7 @@ export function createBluetoothDiscovery(options = {}) { } offStateChange = controller.ble.on('state:change', (state) => { - console.debug('state:change', state) + // console.debug('state:change', state) onStageChange(state.stage) if (state.profileId && state.profileId !== currentProfileId) { @@ -615,11 +615,9 @@ export function createBluetoothDiscovery(options = {}) { clearDiscoveryPollTimer() clearAutoStopTimer() - // 先停止上一次残留扫描 - await stopDiscoverySilently() - // 重置 BLE 适配器:关闭并重开,确保每次搜索都是干净的初始状态 if (initialized) { + await stopDiscoverySilently() unbindControllerEvents() await controller.ble.closeAdapter() await delay(RESTART_SCAN_DELAY_MS)