mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-15 14:51:14 -08:00
example 'meshtastic': add hack for faster BLE scan
This commit is contained in:
parent
b41e7929f4
commit
bbf57bd7b5
2 changed files with 39 additions and 0 deletions
13
examples/meshtastic/hacks/qt-bluetooth-hack/java.diff
Normal file
13
examples/meshtastic/hacks/qt-bluetooth-hack/java.diff
Normal 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);
|
||||
26
examples/meshtastic/hacks/qt-bluetooth-hack/readme.md
Normal file
26
examples/meshtastic/hacks/qt-bluetooth-hack/readme.md
Normal 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
|
||||
```
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue