diff --git a/example/src/screens/MainStack/DashboardScreen/DashboardScreen.tsx b/example/src/screens/MainStack/DashboardScreen/DashboardScreen.tsx index 53e8e879..4f898401 100644 --- a/example/src/screens/MainStack/DashboardScreen/DashboardScreen.tsx +++ b/example/src/screens/MainStack/DashboardScreen/DashboardScreen.tsx @@ -77,14 +77,14 @@ export function DashboardScreen({ navigation }: DashboardScreenProps) { label="Look for devices" onPress={() => { setFoundDevices([]) - BLEService.initializeBLE().then(() => BLEService.scanDevices(true, addFoundDevice)) + BLEService.initializeBLE().then(() => BLEService.scanDevices(addFoundDevice, null, true)) }} /> { setFoundDevices([]) - BLEService.initializeBLE().then(() => BLEService.scanDevices(false, addFoundDevice)) + BLEService.initializeBLE().then(() => BLEService.scanDevices(addFoundDevice, null, false)) }} /> diff --git a/example/src/services/BLEService/BLEService.ts b/example/src/services/BLEService/BLEService.ts index 66fa347c..3eba303b 100644 --- a/example/src/services/BLEService/BLEService.ts +++ b/example/src/services/BLEService/BLEService.ts @@ -81,7 +81,7 @@ class BLEServiceInstance { this.showErrorToast('Bluetooth is turned off') } - scanDevices = async (legacyScan: boolean, onDeviceFound: (device: Device) => void, UUIDs: UUID[] | null = null) => { + scanDevices = async (onDeviceFound: (device: Device) => void, UUIDs: UUID[] | null = null, legacyScan?: boolean) => { this.manager.startDeviceScan(UUIDs, { legacyScan }, (error, device) => { if (error) { this.onError(error)