Commit graph

27 commits

Author SHA1 Message Date
Kevin Hester
31e0136b2a support spiffs updates over OTA (not yet tested)
for https://github.com/meshtastic/Meshtastic-device/issues/496
2020-11-16 15:57:40 +08:00
Ludovic Goix
c87d0adc61 Connect to a device without updating any change #119 2020-09-02 20:16:41 -04:00
geeksville
a5678392f5 fix autobug - if gatt is closed while we are shutting down it is not an error 2020-08-30 12:01:38 -07:00
geeksville
9a73da562c Update to kotlin 1.4 2020-08-18 11:25:16 -07:00
geeksville
92621e07aa don't spam autobugs if we get an exception reading fromnum when the device is leaving 2020-08-15 11:19:23 -07:00
geeksville
ae117fcd9e add debug output 2020-07-24 13:00:27 -07:00
geeksville
7b46046af6 cancel all jobs when we shutdown interface (an autobug) 2020-07-18 14:23:58 -07:00
geeksville
8d6af24488 amazon fire requires a longer delay for the nasty BLE force-refresh hack 2020-07-17 14:12:46 -07:00
geeksville
203dc456ab NRF52 based devices don't need our forceRefresh BLE hack 2020-07-17 11:55:36 -07:00
geeksville
38b4bc255c 0.7.90 read on if you want to see the stories of bluetooth trauma #76
So I'm trying to get an old version of bluetooth on Sony phones to work
In the process I realized I've always been doing something dumb which
bastically works fine, but is an ugly hack I also did to support old
devices.  Due to an accident of history there were two different layers
of the app which were trying to manage bluetooth connections, which was
dumb.  Always only one layer of an app should worry about such things.

/**
     * Should we automatically try to reconnect when we lose our connection?
     *
     * Originally this was true, but over time (now that clients are smarter and need to build
     * up more state) I see this was a mistake.  Now if the connection drops we just call
     * the lostConnection callback and the client of this API is responsible for reconnecting.
     * This also prevents nasty races when sometimes both the upperlayer and this layer decide to reconnect
     * simultaneously.
     */
2020-07-04 17:40:44 -07:00
geeksville
cc05be7d87 bug #76 fix a related autobug from feh123's log
Non-fatal Exception: kotlin.KotlinNullPointerException
       at com.geeksville.mesh.service.BluetoothInterface.doDiscoverServicesAndInit(BluetoothInterface.java:357)
       at com.geeksville.mesh.service.BluetoothInterface.access$doDiscoverServicesAndInit(BluetoothInterface.java:78)
       at com.geeksville.mesh.service.BluetoothInterface$onConnect$1.invokeSuspend(BluetoothInterface.java:429)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:56)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:571)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:738)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:678)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:665)
2020-07-04 11:02:18 -07:00
geeksville
103b21aafd Add stress tester that simulates super high chance of BLE failures
and fix bug that it revealed (missing handling of error during discovery)
2020-07-02 09:38:08 -07:00
geeksville
800060a991 Fix #77: when shutting down interfaces, cancel any retry attempts 2020-07-01 16:31:23 -07:00
geeksville
2520a5e69d fix new autobugs 2020-07-01 15:43:01 -07:00
geeksville
fed418dae2 better debug output for the next time an autobug occurs 2020-06-30 12:18:49 -07:00
geeksville
0349e823f8 don't spam crashlytics with non-bug reports 2020-06-30 12:02:12 -07:00
geeksville
68cc494021 autobug - don't fail if the gatt goes away while we are connecting 2020-06-28 16:09:37 -07:00
geeksville
1fd80c06d8 Fix #67, see that issue for writeup. gatt needs to be @Volatile 2020-06-25 17:56:31 -07:00
geeksville
2780a08931 The android Gatt caching bug on old phones (based on my reading of
the android C code) needs a small delay after calling refresh() because
otherwise the (stale) BLE handles are not discarded until _after_
we start using the connected service.
2020-06-25 15:53:17 -07:00
geeksville
7cca69be0d properly mark when we are disconnected 2020-06-14 16:43:36 -07:00
geeksville
f9c1ac8cd2 Fix back to back writes to not overwrite BLE characterstic. Fixes
the "sending while device was asleep bug"
2020-06-13 16:21:26 -07:00
geeksville
68ed9d5333 ESP32 BLE handles are not stable across sleep - force refresh 2020-06-13 16:02:25 -07:00
geeksville
75576efabe ESP32 code does not generate "service changed" indications 2020-06-13 08:43:22 -07:00
geeksville
eb5a492ade OMG - we were accidentally leaving two GATTs alive - which is super bad 2020-06-11 17:34:22 -07:00
geeksville
d282c7911e immediately fail bluetooth links if we get a read or write error 2020-06-11 16:32:33 -07:00
geeksville
e20f7c5943 use only async io when talking to the radio 2020-06-11 16:22:20 -07:00
geeksville
30137efc68 WIP - cleaned up BLE vs serial interface approximately works 2020-06-07 17:11:30 -07:00
Renamed from app/src/main/java/com/geeksville/mesh/service/BluetoothInterfaceService.kt (Browse further)