example 'meshtastic': add hack for faster BLE scan

This commit is contained in:
pls.153 2024-02-16 12:37:27 +01:00
parent b41e7929f4
commit bbf57bd7b5
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,13 @@
diff --git a/QtBluetoothLE.java.orig b/QtBluetoothLE.java
--- a/QtBluetoothLE.java.orig
+++ b/QtBluetoothLE.java
@@ -215,7 +215,8 @@ public class QtBluetoothLE {
if (isEnabled) {
Log.d(TAG, "New BTLE scanning API");
ScanSettings.Builder settingsBuilder = new ScanSettings.Builder();
- settingsBuilder = settingsBuilder.setScanMode(ScanSettings.SCAN_MODE_BALANCED);
+ //settingsBuilder = settingsBuilder.setScanMode(ScanSettings.SCAN_MODE_BALANCED);
+ settingsBuilder = settingsBuilder.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY); // hack for 'meshtastic'
ScanSettings settings = settingsBuilder.build();
List<ScanFilter> filterList = new ArrayList<ScanFilter>(2);

View file

@ -0,0 +1,26 @@
**android only**
Why
---
Not strictly necessary, but this enables faster BLE scan mode, like in the
official 'meshtastic' android app.
HowTo
-----
Install the Qt5.15 sources and do:
```
$ cd <qt-sources>/qtconnectivity/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth
```
* apply patch `java.diff`
```
$ cd <qt-sources>/qtconnectivity/src/android/bluetooth
$ qmake-android bluetooth.pro
$ make
$ chmod +x ~/Qt/5.15.2/android/jar/QtAndroidBluetooth.jar
```