Commit Graph

729 Commits

Author SHA1 Message Date
geeksville
94c5bd41f2 Merge remote-tracking branch 'root/master' into dev 2020-07-04 17:42:04 -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
Kevin Hester
acd2090e6d Merge pull request #90 from geeksville/dev
Don't bounce the interface if the UI changes to a device we are alrea…
2020-07-04 17:03:44 -07:00
geeksville
bae1a124d2 Don't bounce the interface if the UI changes to a device we are already using 2020-07-04 16:54:48 -07:00
Kevin Hester
73b8eef25b Merge pull request #89 from geeksville/dev
Dev
2020-07-04 12:50:32 -07:00
geeksville
6c7d108545 0.7.89 2020-07-04 12:47:38 -07:00
geeksville
bc6fa0b1bb If we have an exception thrown *back to us* complain and ignore it? 2020-07-04 11:33:24 -07:00
geeksville
f7ca63ed92 better error message if we can't find the update service 2020-07-04 11:32:51 -07:00
geeksville
92b3fa8d1f bug #76 - old sonys can take a VERY long time for the setMTU operation
to complete.  Change timeout to 10 secs (units in the field were showing
the mtu operation completing after 5 seconds.

Also - don't throw an exception if we encounter a result when we've already
killed things with the failsafe timer
2020-07-04 11:19:54 -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
Kevin Hester
794434dc57 Merge pull request #83 from geeksville/dev
fix unit tests
2020-07-02 14:47:53 -07:00
geeksville
169cb7dcd7 fix unit tests 2020-07-02 14:46:37 -07:00
geeksville
85bdd25782 fix warning 2020-07-02 14:46:29 -07:00
Kevin Hester
de97911262 Merge pull request #82 from geeksville/dev
0.7.88 oops - if no work is pending, we also try to reconnect
2020-07-02 14:31:20 -07:00
geeksville
5f34fcba17 0.7.88 oops - if no work is pending, we also try to reconnect 2020-07-02 14:08:12 -07:00
Kevin Hester
cfc7dc8355 Merge pull request #81 from geeksville/dev
Dev
2020-07-02 10:43:14 -07:00
geeksville
dde5348b3a 0.7.87 2020-07-02 10:39:02 -07:00
geeksville
7faf4d2d79 fix software update button 2020-07-02 10:37:35 -07:00
geeksville
7bd6615cb7 oops - I wasn't properly checking for presence of firmware files 2020-07-02 10:32:47 -07:00
geeksville
0006858469 Fix autobug, don't show update button if we can't find the filename 2020-07-02 10:21:14 -07:00
geeksville
36949b83e5 Merge remote-tracking branch 'root/master' into dev 2020-07-02 10:12:44 -07:00
Kevin Hester
e74f12e6c6 Merge pull request #75 from lgoix/battery
Display battery level of remote nodes #64
2020-07-02 10:12:34 -07:00
geeksville
8ea949a437 fix autobug with old samsung phones 2020-07-02 09:53:52 -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
e5d6ffc4bd fix #77, see below:
root cause in log:
the problem is that we are running dropAndReconnect (because of an error diduing writec) at the same time as handleSendToRadio called scheduleReconnect because of the exception

fix is: now that BluetoothInterface is smart enough to do its own reconnections, do not auto reconnect in SafeBluetooth.  Instead just throw a BLEException and assume the client will reconnect if it wants.
2020-07-02 08:46:25 -07:00
geeksville
6182879d98 0.7.86 test build for https://github.com/meshtastic/Meshtastic-Android/issues/76 2020-07-02 08:11:09 -07:00
Kevin Hester
8d8db3d502 Merge pull request #79 from geeksville/dev
Dev
2020-07-01 18:11:09 -07:00
geeksville
4333f775f9 0.7.85 2020-07-01 18:10:44 -07:00
geeksville
37a909e65d include firmware bins only in release builds 2020-07-01 18:10:30 -07:00
geeksville
c0e58391a3 Fix problem of old messages not being remembered 2020-07-01 18:00:28 -07:00
Kevin Hester
c5df728f02 Merge pull request #78 from geeksville/dev
Dev
2020-07-01 16:34:19 -07:00
geeksville
800060a991 Fix #77: when shutting down interfaces, cancel any retry attempts 2020-07-01 16:31:23 -07:00
geeksville
41bd082296 don't spam crashreport server if the device sent a corrupted protobuf 2020-07-01 15:50:07 -07:00
geeksville
2520a5e69d fix new autobugs 2020-07-01 15:43:01 -07:00
geeksville
b7d0b7fca4 0.7.84 2020-07-01 15:42:46 -07:00
Ludovic Goix
d822538c0e Display battery level of remote nodes #64 2020-07-01 08:28:06 -04:00
Kevin Hester
07d2c58ae5 Merge pull request #72 from geeksville/dev
Dev
2020-06-30 12:42:45 -07:00
geeksville
4172b221f0 autobug: failure to start should be treated like any other BLE exception 2020-06-30 12:35:58 -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
4571eeea2a get logs from oneplus devices 2020-06-30 12:01:48 -07:00
geeksville
e6fd79f477 fix another autobug - clear gatt first, because close() can fail 2020-06-30 11:39:04 -07:00
geeksville
17faecc170 fix autobug 2020-06-30 11:13:18 -07:00
geeksville
010d63d2db Revert "Create codeql-analysis.yml"
This reverts commit 5da86129fa.
2020-06-30 10:56:27 -07:00
geeksville
fdf8c195bf Merge remote-tracking branch 'mine/master' into dev 2020-06-30 10:55:17 -07:00
Kevin Hester
5da86129fa Create codeql-analysis.yml 2020-06-30 09:32:35 -07:00
Kevin Hester
eb59b1e128 Merge pull request #71 from geeksville/dev
Dev
2020-06-28 18:07:25 -07:00
geeksville
cfd6823120 0.7.82 2020-06-28 18:07:01 -07:00
geeksville
fb422006b6 lib fixes 2020-06-28 18:05:29 -07:00
geeksville
549b1e8d7c fix #68 - workaround a disconnect bug in old androids
https://github.com/don/cordova-plugin-ble-central/issues/473#issuecomment-396790239
2020-06-28 18:04:52 -07:00