Skip to content

Commit

Permalink
fix: android legacy scan linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dimninik committed Oct 16, 2023
1 parent 267c133 commit bfd00f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}}
/>
<AppButton
label="Look for devices (legacy off)"
onPress={() => {
setFoundDevices([])
BLEService.initializeBLE().then(() => BLEService.scanDevices(false, addFoundDevice))
BLEService.initializeBLE().then(() => BLEService.scanDevices(addFoundDevice, null, false))
}}
/>
<AppButton label="Ask for permissions" onPress={BLEService.requestBluetoothPermission} />
Expand Down
2 changes: 1 addition & 1 deletion example/src/services/BLEService/BLEService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bfd00f3

Please sign in to comment.