1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-09-09 07:46:37 +02:00
Commit Graph

21 Commits

Author SHA1 Message Date
Andreas Shimokawa
56d314d054 Reformat code and optimize imports 2015-06-13 00:32:48 +02:00
cpfeiffer
ba76f64bf6 Disable context menu while busy and add "Disconnect" to context menu 2015-06-07 15:31:42 +02:00
cpfeiffer
9e4e50be47 Initial work on synchronizing activity data with feedback.
A device now has a busy flag (set during synchronization). While busy,
no other communication with the device shall occur (TODO)

Refactors the non-bluetooth actions a bit  #45

Next step: make use of the busy state in ControlCenter (show
a busy cursor) and in BluetoothCommunicationService (to not call other
operations while busy)
2015-06-06 00:40:16 +02:00
cpfeiffer
5d950dc407 Fix reconnection after connection loss
Well, obviously we must not ignore connection state changes even if they
come with an error code.

Unfortunately the API docs are a bit terse in that respect.
2015-06-01 21:47:02 +02:00
cpfeiffer
7f89f4bb57 Some fixes regarding device initialization, should avoid disconnects
Avoid repeated initializations and device info requests. Fix unsetting
of dynamic state (e.g. battery info) when initialized.
2015-06-01 21:47:02 +02:00
cpfeiffer
11884d8073 Improve logging 2015-06-01 21:47:02 +02:00
cpfeiffer
75b9fe4c4d ignore connection state changes with status != GATT_SUCCESS
And add logging. Maybe this helps with #57
2015-06-01 21:47:02 +02:00
cpfeiffer
637b43e892 Also wait for descriptor reads and writes
(not just characteristic reads/writes)

This fixes initialization of notification characteristics
(activity, sensor data, battery, ...)
2015-06-01 21:47:01 +02:00
cpfeiffer
f004b7b11c WIP for fetching activity data
This probably affects #44 and #45

Thanks go to Daniele Gobbetti <daniele@gobbetti.name>!
2015-06-01 21:47:01 +02:00
cpfeiffer
880dc7b3a4 Improve BLE gatt handling
- close() the gatt instance when explicitly disconnecting
- create a new gatt instance when explicitly connecting

Unfortunately I still appear to get spontaneous disconnects after some
notifications.
2015-05-22 23:18:29 +02:00
Andreas Shimokawa
c37cacf43d Remove id and index from GBDeviceApp in favor of UUIDs 2015-05-18 20:56:19 +02:00
cpfeiffer
9819819b92 Create the wait-latch before running the action, and only if neeeded
Otherwise the result handler might be called before the wait-latch
has been created, leading to a deadlock of the thread.

Also: only wait for read- and write actions, but not for wait-actions.
2015-05-17 21:55:02 +02:00
Andreas Shimokawa
1b2f20160a fix some lint warnings, mostly simplifications 2015-05-12 20:09:35 +02:00
cpfeiffer
9a26769c3e Search & replace: use slf4j for logging instead of Logcat directly
For a start, use android-logger as backend. Needs a better configuration
but no time right now.

For file-logging we will use logback as slf4j-implementation.
2015-05-12 06:33:37 +02:00
cpfeiffer
9df661bd96 Initial (ugly) support for device discovery and pairing (#3) 2015-05-05 00:48:54 +02:00
Andreas Shimokawa
613ff1fc91 Pebble: corrections to PebbleIoThreads, better logging 2015-04-26 00:54:41 +02:00
cpfeiffer
0377a751b0 be even more robust #35 2015-04-25 23:49:07 +02:00
cpfeiffer
274e8591dc Initialize the BTLE device after the services are discovered.
This hopefully helps with the MI Band automatically disconnecting.
2015-04-24 22:21:35 +02:00
cpfeiffer
06d8488792 #15 log as info, not error 2015-04-20 23:45:34 +02:00
Andreas Shimokawa
dd12bb11b2 reformat code with androidstudio 2015-04-19 11:28:03 +02:00
cpfeiffer
09914e6da0 #15 Initial support for MI Band
1) The MAC address has to be added manually for now (Settings -> Debug) 
2) Configure other notifications as desired
3) After doing that, restart Gadgetbridge, after that, the device should
be visible.
4) Tap it to connect
5) Try the Debug activity via the Menu to send some dummy notifications
=> Your MI should vibrate and blink

Also: add some extra files necessary to support Eclipse ADT. To be
migrated to Andmore, later.
2015-04-19 02:37:29 +02:00