Commit Graph

58 Commits (d68a4211b6ce29c5cc2f2c8c442eec7b3d0f2dd9)

Author SHA1 Message Date
Daniele Gobbetti d68a4211b6 First attempt at parsing the live sensor data, see issue #63
- Live sensor data reading is toggled using the "Set music info" in the debug activity.
- The readings are ONLY logged at the moment
- The miband increments a "counter" (two bytes) at every reading, but it may be that more readings are sent with the same counter value. This is already addressed.
- The name of the axes is general (axis1, 2 and 3) because we still don't know which is which
- It could be that the axes depend on the wear location (especially wearing as a necklace means that the miband rests in a vertical position, while wearing on the wrist means it rests in a horizontal position). NB: It could be that we get RAW data, hence not dependent on the wear location.
- Since the miband may be inserted in two directions in its strap, I guess this also has to be taken into account
- the battery impact of reading this data in unknown
2015-07-02 10:26:32 +02:00
Andreas Shimokawa b25d771ee9 reformat code 2015-06-30 12:09:29 +02:00
Daniele Gobbetti 109b2bef4d add a Toast to confirm the transfer of the alarm or to warn if the transfer wasn't possible. 2015-06-30 06:40:46 +02:00
Daniele Gobbetti dc3ed1659c use parcelable for passing alarms around 2015-06-30 06:40:46 +02:00
Daniele Gobbetti 1caca1439a Initial implementation of setting alarms to the Mi Band.
The code basically works, but there a lot of things to fix / improve.
* The alarms are stored to and read from the Shared Preferences, but there is no persistence within the app (basically they are read and stored at every access)
* The alarm list is not updated when coming back from the alarm detail view (probably related to the point above), but the actual alarm is
* The alarms preference names is sometimes built by concatenating strings, which is not really safe
* There is no check in the alarm constructor whether the stored string is a valid alarm representation
* Even though only 3 alarms can be stored on the device, we could have more in the app and let the user choose which to sync
* In the alarm detail view XML some material* drawables are used, it's possible that these break on android version < 5
* ...
2015-06-30 06:40:14 +02:00
Andreas Shimokawa 07d59322bd Pebble: Preparations for taking screenshots
This commit also includes some cleanups and removal of unused code/strings
2015-06-24 00:23:38 +02:00
Andreas Shimokawa 73da7fff0a Refactoring: rename GBDeviceCommand to GBDeviceEvent 2015-06-23 11:54:33 +02:00
cpfeiffer 23d91ac79e Support for finding a lost device (closes #42) 2015-06-21 19:46:02 +02:00
cpfeiffer c7b4f295a1 Support for vibration profiles, configurable for notifications
Configurable for sms, k9, incoming calls, pebble messages, generic
notifications.

Color is unfortunately not configurable so far, see #37

Closes #29

Currently provided profiles are
- staccato
- short
- medium
- long
- waterdrop
- ring
- alarm clock
2015-06-21 19:46:01 +02:00
cpfeiffer 83079b0456 Stub for device notification changes 2015-06-18 23:07:22 +02:00
Daniele Gobbetti cb3be26349 Do something when we receive a CharacteristicChanged message
on the UUID_CHARACTERISTIC_BATTERY characteristic.

This is a first try at addressing #71

Please note that this will probably not work at this point, but it's
worth a try. To make it work probably we have to tell the device to
send updates, and we don't know how to do it.
2015-06-18 22:17:41 +02:00
Andreas Shimokawa 56d314d054 Reformat code and optimize imports 2015-06-13 00:32:48 +02:00
Daniele Gobbetti ac7e21be48 Remove the activity log debug file.
This partially reverts commit 8b268a676c
2015-06-12 22:30:14 +02:00
cpfeiffer 8aef92026c A new sleep chart based on MPAndroidChart 45
- supports zooming an panning
- displays labels for all x-values (= time of day)
- fix deep vs. light sleep constants
- increase activity data buffer size for Mi Band
2015-06-11 23:37:00 +02:00
cpfeiffer d0b9914770 Keep the db open while adding samples 2015-06-09 21:05:44 +02:00
cpfeiffer ab97b544f0 Some cleanup + actually remember event time and kind for throttling 2015-06-06 23:59:53 +02:00
cpfeiffer f6d5767276 Remove reference to PebbleIOThread from BluetoothCommunicationService
Let PebbleSupport do this instead.
2015-06-06 23:24:00 +02:00
cpfeiffer 020d8d74d6 Added "Fetch Activity Data" to the context menu.
With some kind of progress reporting during the fetching #45
2015-06-06 19:39:04 +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
Daniele Gobbetti a1ff9aab21 Do not iterate over the whole buffer, but only on the effectively used part.
This should fix the "data in the future" issue
2015-06-04 18:56:35 +02:00
Daniele Gobbetti 406f9ab90d Do not allocate the buffer if there's no data available.
Perhaps could fix the "data in the future" issue
2015-06-02 18:33:12 +02:00
Daniele Gobbetti 9e2d32c33f Fixed timestamp conversion for DB, added local variables to make the code clearer 2015-06-01 22:20:28 +02:00
Daniele Gobbetti ea97a902d1 *unchecked* Storing activity values in the DB. 2015-06-01 22:20:28 +02:00
Daniele Gobbetti 8b268a676c Refactoring of the data ingestion method.
* no more ByteBuffer, but a fixed size byte array that gets flushed everytime it's needed
* log of activity data to a separate file (no DB integration yet)
* the size of the buffer must be a multiple of 3 (1 minute of data = 3 bytes) and 20 (the normal size of the chunks we get from the device)
* better logging and more comments in code
2015-06-01 22:20:22 +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
Daniele Gobbetti 228e922ce7 forgotten refactor of a variable 2015-06-01 21:47:01 +02:00
Daniele Gobbetti e4076dc725 Ingesting the activity data the right way, but they are still being thrown away afterwards. 2015-06-01 21:47:01 +02:00
cpfeiffer 92caed5af4 Some cleanup 2015-06-01 21:47:01 +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
Daniele Gobbetti 7e2545f9b4 Use constants instead of hardcoded values 2015-05-21 18:19:07 +02:00
Andreas Shimokawa c4f7fc1531 Start App on Pebble when tapping it AppManager 2015-05-18 22:20:01 +02:00
Andreas Shimokawa c37cacf43d Remove id and index from GBDeviceApp in favor of UUIDs 2015-05-18 20:56:19 +02:00
cpfeiffer d1d3e758d9 Support configurable notifications. Closes #53
To close #29, we need to have a bit more configuration options than
just the number of vibrations. E.g.
- duration
- pause
- LED flashing (again, number of flashes, duration and pause, but also
  the colour and maybe which LEDs)

Also implements reboot-functionality for Mi Band.
2015-05-17 22:57:37 +02:00
cpfeiffer 27d725853f Add extra handler for generic notifications
(instead of misusing onSMS handler). Pebble still does that,
but not everybody has to.

Small step for #53
2015-05-13 21:55:22 +02:00
Andreas Shimokawa c81e28c030 simplify code 2015-05-12 20:32:34 +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 b2518ff927 Discovery + pairing now works
User info is asked on demand before starting the actual pairing.
When no (valid) user info is given, dummy user infor will be  used instead.
2015-05-07 23:52:44 +02:00
cpfeiffer a23690c8e1 Initial support for Mi Band specific settings
(User info for now).

TODO: We need to have that information *before* starting a connect
2015-05-07 01:32:17 +02:00
cpfeiffer 50034e0bfe Request battery info in initialize() 2015-05-05 23:25:54 +02:00
cpfeiffer 9df661bd96 Initial (ugly) support for device discovery and pairing (#3) 2015-05-05 00:48:54 +02:00
Andreas Shimokawa f143c9ec54 androidstudio vs. eclipse :/ 2015-05-01 01:49:43 +02:00
cpfeiffer 5a458611e2 Set the time during initialization. Necessary for steps tracking.
Also see #31
2015-04-27 21:43:57 +02:00
Andreas Shimokawa 613ff1fc91 Pebble: corrections to PebbleIoThreads, better logging 2015-04-26 00:54:41 +02:00
Daniele Gobbetti 98696ce9e2 Implement setting the time on the miband.
It works from the debug activity, since I am not sure about the value of
the ts argument, it always sets the current time.
2015-04-23 14:11:57 +02:00
Andreas Shimokawa fbbc808ca8 Make GBDevice parcable to make passing it via Intents more convinient 2015-04-20 11:58:59 +02:00
cpfeiffer 4a1a1d59be battery info hooked in, dummy for pebble 2015-04-19 22:31:09 +02:00
cpfeiffer 686ed312d6 #15 properly return firmware version 2015-04-19 22:23:53 +02:00