Skip to content

Commit

Permalink
fix scan extended advertisements
Browse files Browse the repository at this point in the history
  • Loading branch information
qianxiansheng committed Jan 5, 2024
1 parent 68307de commit f7606b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/java/com/ingchips/fota/BLEUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.bluetooth.*
import android.bluetooth.le.BluetoothLeScanner
import android.bluetooth.le.ScanCallback
import android.bluetooth.le.ScanResult
import android.bluetooth.le.ScanSettings
import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
Expand Down Expand Up @@ -175,7 +176,9 @@ class BLEUtil private constructor(private val context: Context) {
}
scanCallback = callback
scanHandler.postDelayed({ stopScan() }, durationMilli)
bluetoothLeScanner!!.startScan(leScanCallback)
bluetoothLeScanner!!.startScan(null,
ScanSettings.Builder().setLegacy(false).build(),
leScanCallback)
}

companion object {
Expand Down

0 comments on commit f7606b4

Please sign in to comment.