Commit Graph

829 Commits (962720145e3678f5ffd17ea6c4a9e277a665b144)

Author SHA1 Message Date
cpfeiffer 0c51f86afc Mi2: more work on activity data #323 2016-11-22 00:05:41 +01:00
cpfeiffer 82cd06f4c1 Mi2: WIP: initial support for activity data
(#323)
2016-11-22 00:05:41 +01:00
Andreas Shimokawa eb052cead3 Pebble 2: Also honor the mtu when client gets a change reported
Should help older LE Pebbles
2016-11-21 17:29:16 +01:00
Andreas Shimokawa 647b67cfca Pebble 2: call both requestMTU and use the characteristic write 2016-11-21 15:17:03 +01:00
Andreas Shimokawa fce86482b9 Pebble 2: try an alternative way of setting the MTU (might revert) 2016-11-21 14:54:01 +01:00
Andreas Shimokawa e8da301da3 Pebble 2: fix a few crashes with disconnect/ reconnect 2016-11-20 22:04:49 +01:00
Andreas Shimokawa 4f3c46f704 Pebble 2: only add second service if first one was added sucessfully 2016-11-20 00:12:41 +01:00
Andreas Shimokawa 3b250a4568 Pebble 2: initial hacky reconnect support
Works sometimes, at least less crashes
(#432)
2016-11-19 23:53:07 +01:00
Andreas Shimokawa ddfab1cdae Pebble 2: use requestMTU() on Android 5+ instead of characteristics write.
This actually fixes MTU problems with older Pebbles (Time, OG)
2016-11-18 23:47:48 +01:00
Andreas Shimokawa 4dc085de57 Pebble 2: React to MTU notifications, fixes LE for older pebbles also
It seems that setting the MTU on older pebbles does not work, so just use what we can use.
Maybe old pebbles need setMTU() which only works on Android 5+, we could use that conditionally...
2016-11-18 23:47:48 +01:00
cpfeiffer 51fa31aa66 Fix BLE type conversions problems 2016-11-18 23:36:22 +01:00
Andreas Shimokawa 66e3de9168 Pebble 2: improve connection problems (at least for me) 2016-11-18 22:38:39 +01:00
Andreas Shimokawa d7256d172e I hate java 2016-11-15 23:23:21 +01:00
Andreas Shimokawa 163a7bdf15 Pebble 2: save heart rate values to database (hopefully) 2016-11-15 23:21:13 +01:00
Andreas Shimokawa 82a47022fa Pebble 2: allow to disable/enable HRM in context menu of Workout app
Okay this might be stupid  since Workout seems to work also works without HRM!
I assumed (wrongly) that I will disable Workout by disabling HRM

anyway, better than not being able to toggle it at all!
2016-11-15 12:17:51 +01:00
Andreas Shimokawa 4b7f47ba6c Pebble 2: add Workout system app to app manager on P2 and hexdump incoming HRM datalog 2016-11-15 11:56:14 +01:00
cpfeiffer d8145a52f9 Activate the display when lifting the wrist #323
Configurable, defaults to true
2016-11-13 21:47:54 +01:00
Andreas Shimokawa 00a71f53b3 Pebble 2: add not yet working code (at least not without weird workarounds)
This is is a pain because of tons of weird pairing issues
2016-11-13 21:29:58 +01:00
cpfeiffer d89899557c Mi2: Add config option to configure date/time display
(added a new EventHandler method to set a specific configuration option)
2016-11-13 20:47:24 +01:00
cpfeiffer ddaf51768d Improved logging 2016-11-13 20:24:25 +01:00
cpfeiffer 3cc8d887ca Mi2: Initial support for wear location, hr during sleep and date format #323
- wear location from prefs is sent to the band
- hr measurement during sleep is sent to the band
- date format is sent to the band (date+time or just time)
  (TODO: needs preference option)
2016-11-13 01:44:52 +01:00
Andreas Shimokawa f68bbe453b Pebble: bump flags and version we report
Plus some small preparations for P2 support which do not hurt in master
2016-11-10 11:05:32 +01:00
cpfeiffer 3b474bb5a9 Move another notify registration to after initialization #408 2016-11-08 22:55:31 +01:00
cpfeiffer 55f036c104 Move heart rate notification enamblement to after authentication
Might fix #408 and #425
2016-11-04 22:11:07 +01:00
Andreas Shimokawa 14ef5202e1 some internal testing which does not hurt in master 2016-11-03 11:07:44 +01:00
cpfeiffer 0076bbf572 Remove all Mi2 DeviceInfo stuff -- they're not used together #365
This might fix firmware downgrading on certain Mi1A devices
with hw revision 8
2016-10-30 23:04:21 +01:00
cpfeiffer cea5f5fa36 Remove duplicate case here as well 2016-10-29 00:01:56 +02:00
cpfeiffer 3db9748136 Mi2: Attempt to support non-repetitive alarms #323 2016-10-28 23:18:10 +02:00
cpfeiffer 1352403089 Mi2: Allow for disabling alarms #323 2016-10-28 22:26:07 +02:00
Andreas Shimokawa 55daaf247c Merge pull request #420 from atkyritsis/master
Removed duplicate if statement.
2016-10-28 10:45:09 +02:00
Andreas Shimokawa d6b9e6d64b Pebble: Support sending byte arrays from app configuration data
Also add debug output if trying to encode unknown classes in PebbleProtocol

(Fixes #421)
2016-10-28 00:32:45 +02:00
atkyritsis 45cf4e5396 Removed duplicate if statement. 2016-10-27 18:44:27 +02:00
cpfeiffer de46555e37 Mi2: display heart rate result from Debug screen as a toast #323 2016-10-24 00:23:59 +02:00
cpfeiffer b20a9c9ccc Some initial hacky support for hr readings (Debug activity only)
My Mi2 stopped reporting hr values a while ago though, even on-device.
2016-10-23 23:53:48 +02:00
cpfeiffer 17b70a1b82 Support for more than one alarm #323
Smart alarms not supported yet.
2016-10-23 23:05:54 +02:00
cpfeiffer 3a12ffd42d Mi2: Fix for alarm enablement. Was too late, apparently. 2016-10-23 22:38:57 +02:00
Daniele Gobbetti 503bcee7b4 Support record version 13 (firmware 4.2) 2016-10-21 13:07:07 +02:00
cpfeiffer ee24443b6a Make it really clear, that only the first alarm works #323 2016-10-21 01:01:30 +02:00
cpfeiffer 15954d4561 Initial support for alarms (one, atm) #323
(repetitinos not tested yet)
2016-10-21 00:50:41 +02:00
cpfeiffer 839da4f06a Shuffle some logging things around 2016-10-21 00:50:41 +02:00
cpfeiffer c87d08bf4b Small refactoring for initial support for Mi2 Alarms #323 2016-10-21 00:50:41 +02:00
Daniele Gobbetti 21fc5c7498 Integrate Daniele's live-sensor-data support 2016-10-11 23:13:40 +02:00
cpfeiffer 713989ef38 Add event "test new function" for the debug screen 2016-10-11 23:06:59 +02:00
cpfeiffer 7c3dc741d2 Send vibration off-commands to Mi2 (#323)
Far from perfect, but a little better.
2016-10-11 21:38:17 +02:00
cpfeiffer e7c0afa603 Cleanup onNotification() 2016-10-11 21:18:43 +02:00
Andreas Shimokawa a094f0cc76 Mi Band: for vibration settings, group navication types (email, sms, chat, social network, navigation) 2016-10-11 15:20:55 +02:00
Andreas Shimokawa cd195a5969 map more apps to notification types (icons and colors on the pebble) 2016-10-11 11:54:52 +02:00
cpfeiffer 92c629c351 Ranem NotificationType.UNDEFINED to UNKNOWN 2016-10-10 23:06:44 +02:00
cpfeiffer 62828e5158 Remove ORIGIN_ notification constants, clean up
- MI preferences now use NotificationType.getFixedName() for preference
  keys
2016-10-10 22:45:26 +02:00
cpfeiffer db034a246c Add 'Try' button to vibration profile preferences, closes #405 2016-10-09 00:10:53 +02:00
cpfeiffer 9e32e7d0d3 Remove some Mi2 testing code, only use Mild Alerts for Mi1 (fow now) 2016-10-08 22:43:41 +02:00
cpfeiffer 125c0092cb Storage and improved way of realtime data (hr, steps so far) 2016-10-08 01:35:58 +02:00
cpfeiffer 713e9426b9 Re-enable UUID_PAIR again, when keeping data on device is configured) #250
This should fix data sharing with Mi Fit
2016-10-05 23:01:35 +02:00
cpfeiffer f23ed5ce69 Mi2: declare to always support hr #323 2016-10-03 21:17:58 +02:00
cpfeiffer 5bdc7933b3 Somewhat hacky support for Mi2 notification icons #323 2016-10-02 23:04:59 +02:00
Andreas Shimokawa 5e63b7ce04 Vibratissimo: do not show database migration activity 2016-09-30 21:43:44 +02:00
Daniele Gobbetti 42f622af85 Support record version 12 (firmware 4.1) 2016-09-30 17:28:46 +02:00
cpfeiffer 8f36712342 WIP: A little more Alert Notification Profile
I think we should rather focus on a code generator, though.
2016-09-29 20:32:15 +02:00
cpfeiffer c2f8037f07 WIP: Alert Notification Profile 2016-09-26 22:21:59 +02:00
Andreas Shimokawa 9cccb085c4 Pebble: allow sending acks to pebblekit android apps which always use transaction id -1 (this seems to be okay for pebblekit apps which do not want to use real transaction ids) 2016-09-26 21:51:11 +02:00
Andreas Shimokawa 55a1248e8f compile fix 2016-09-26 21:43:10 +02:00
cpfeiffer d4b134a490 WIP regarding heart rate profile 2016-09-26 11:44:57 +02:00
Andreas Shimokawa 8080734470 Pebble: use telegram icon for telegram messages
also use the facebook icon for the official facebook app
(untested because we would never use facebook)
2016-09-21 21:31:23 +02:00
cpfeiffer 1bd919ccaa For a start, we can reuse the alert notification from Mi 1 #323
So vibration works :-)
2016-09-20 23:41:50 +02:00
cpfeiffer ccdb843b6e Improved Mi Band 2 support #323
- connecting works and is stable
- firmware and hardware version is displayed
- time is set
2016-09-20 23:12:17 +02:00
Andreas Shimokawa 1f8cfa5a68 Vibratissimo: clear queue when setting vibration 2016-09-20 21:49:27 +02:00
Andreas Shimokawa 6a18d90fee Vibratissimo: add simple and buggy activity with a slider for vibration control
Also includes some fixes and "find your device" support ;)
2016-09-20 20:28:52 +02:00
Andreas Shimokawa da01a76594 fix BatteryInfoProfile NPE, show battery level for Vibratissimo 2016-09-19 16:37:45 +02:00
Andreas Shimokawa 8ba7bc7353 Add (useless) support for Vibratissimo "massage devices"
Don't take this serious. It will make the "massage device" vibrate when a phone call arrives.
It is inspired by the famous lawsuit[1] which has nothing to do with the Vibratissimo device maker.
After reading this I picked up the cheapest ble massage device just to see if we could support it.
And yes, we can.

[1] http://arstechnica.com/wp-content/uploads/2016/09/vibratorsuit.pdf
2016-09-19 12:37:41 +02:00
JohnnySun 53d4681763 Optimize Imports 2016-09-13 23:53:35 +08:00
JohnnySun 19fbe5719c When miband2 auth success, let application show miband status is connected 2016-09-13 23:50:35 +08:00
JohnnySun 08f2b0eb7c fix somebug and rewirte the auth process 2016-09-13 18:15:03 +08:00
JohnnySun 90d730bdc8 Added miband2 connection support 2016-09-13 01:28:50 +08:00
cpfeiffer e555066ffc Fix firmware2 not being set 2016-09-11 21:15:36 +02:00
Andreas Shimokawa 9c2e40ecc0 Pebble: fix mixup of userId and deviceId in contructor for Misfit and Morpheuz samples 2016-09-11 00:12:37 +02:00
cpfeiffer c31049839a Make DeviceCommunicationServiceTestCase runnable with robolectric
- enables the test for travis
- tests operation when not connected
- tests connecting
- tests operation when connected
2016-09-10 11:12:51 +02:00
Daniele Gobbetti 5cbedc782d Pebble health: accept records of firmware 4.0 (nothing changed among the data we parse) 2016-09-04 15:59:19 +02:00
Daniele Gobbetti 84e644fa1a Add preference for save raw pebble health data. 2016-08-31 14:05:02 +02:00
Andreas Shimokawa c55369747d launch onboarding (database migration) activity from service when:
- device got initialized
- is not yet in the new device db
- an old database exists
2016-08-28 23:49:05 +02:00
cpfeiffer c59553c9c9 Rename GBDevice#hardwareVersion to model
(e.g. while DeviceType is "PEBBLE" in general, the model
might specify a Pebble Time or Time Steel.
2016-08-26 20:57:59 +02:00
Daniele Gobbetti 2a2ad20aa3 Store raw data in the DB for later interpretation. 2016-08-21 20:24:02 +02:00
Andreas Shimokawa 3fb558c536 db refactoring: add raw data column in health overlay table and make rawType part of the composite key 2016-08-18 22:06:26 +02:00
Daniele Gobbetti 0126b90f20 Store the timestamps as sent by the pebble. Use a strict inequality operator at the end of the period to exclude the last sample. 2016-08-18 21:44:06 +02:00
Andreas Shimokawa ce8af615d1 Merge branch 'composite-key-dao' 2016-08-18 20:35:56 +02:00
cpfeiffer fbf06c1fe3 Separate coordinator and support instances for Mi1 and Mi2 #323
+ Some more testing stuff for Mi2
2016-08-17 00:53:16 +02:00
cpfeiffer 9b7e8e06d6 Improved time conversion (0x2A0F)
- support for org.bluetooth.characteristic.local_time_information
- support for day of week in 0x2A2B

Unfortunately Mi Band 2 does not support 0x2A0F ;(
2016-08-15 00:40:35 +02:00
cpfeiffer 8766fc5269 Handle MiBand2 device type 2016-08-14 23:25:35 +02:00
Andreas Shimokawa 69933c5e92 db refactoring: depend on latest -fyg patched greendao, change column order again (primary keys first), remove index from pebble health overlay also 2016-08-14 22:33:41 +02:00
Andreas Shimokawa eb962c65f0 work towards composite keys
(builds but does not run because greendao generates wrong table creation code - we need to fix that)
2016-08-13 01:24:43 +02:00
Andreas Shimokawa 68b303246d db refactoring: change column order for health overlay table also 2016-08-10 23:26:25 +02:00
Andreas Shimokawa 359ed46b06 db refactoring: remove raw activity kind field from pebble health minute data, add a blob column for raw undecoded health minute data.
also:
- change column order for all pebble related minute data tables (mandatory stuff first, then custom columns, for easier addition of new columns)
- remove unused code

TODO:
- fix column order in Mi Band table also
2016-08-10 23:06:07 +02:00
Daniele Gobbetti 4a7a34f461 Use only the overlay table for storing overlay data.
This removes the need to wait to have minute samples to store the overlay data, hence store has been made void instead of boolean.
2016-08-09 18:05:24 +02:00
Andreas Shimokawa 5072d6b959 Pebble: try to write to health activity overlay table 2016-08-08 19:16:53 +02:00
Andreas Shimokawa 6b2565e4c9 DB refactoring: remove activity type from Morpheuz database, determinate it in PebbleMorpheuzSampleProvider instead 2016-08-07 01:47:15 +02:00
Andreas Shimokawa e05d40dc7e Pebble: Support for latest version of Morpheuz (4.6)
Also a few simplifications and minor fixes.
Morpheuz 3.7 should still work (last version for FW 2.x)
2016-08-06 01:19:38 +02:00
cpfeiffer 43d7566c0b some more microsteps #206 2016-08-01 22:18:57 +02:00
Andreas Shimokawa 4fe498efc2 Pebble: delay 100ms after writing a pebble packet to the output steam
This fixes a problem on newer firmwares, probably from 3.0 on, where sending an
appmessage packet right after acknowledging a previous incoming appmessage
packet results in our outgoing appmessage packet to be NACKed by the pebble
firmware and not even reaching the app running on the pebble.
2016-07-31 23:49:19 +02:00
Andreas Shimokawa 8ba1ae3f3e create extra table for Morpheuz, remove more unused stuff
Pebble activity tracker now do not share a common base anymore.

TODO: consider creating a custom way of querying activity types like in Misfit. The activity kind stored in the database now is solely based on the intensity, so it is redundant.

(#206)
2016-07-31 00:06:26 +02:00
Andreas Shimokawa eabe625c47 rename some classes, remove obsolete ones 2016-07-30 23:22:27 +02:00
cpfeiffer b43b7948b0 Let GallCallback return boolean values in order to mark an event as "consumed"
(to avoid dispatching the event to further listeners (ble profiles)
2016-07-28 23:04:37 +02:00
cpfeiffer c9a9566dad Minor fixlet 2016-07-28 22:42:16 +02:00
cpfeiffer b22111df9d Fix field ordering of ActivitySample (c'tor!) and improve importer #206 2016-07-28 22:12:20 +02:00
Andreas Shimokawa 8ea29e6e1d Refactor database / sample access (#206)
We now have separate tables for each provider's samples but a common interface.
2016-07-27 23:34:13 +02:00
Andreas Shimokawa 726f767576 work towards a Pebble Misfit raw sample table 2016-07-25 22:19:39 +02:00
cpfeiffer f5ba09ebe0 Some babysteps towards miband2 support #323
Start to implement standard BLE profiles/services.
2016-07-25 00:00:22 +02:00
cpfeiffer 1997a9b7fa some more service discovery logging 2016-07-18 23:55:44 +02:00
cpfeiffer 7b26986ab0 Fix for #349
We must not use UUID_CHAR_PAIR anymore. This prevents connecting
without being bonded. Connecting when bonded still works.

As without bonding, ControlCenter would not display the device anymore,
we have to re-install the "remember last connected device" in the
preferences thing.
2016-07-15 00:13:49 +02:00
cpfeiffer 367091587f No more 0x8 in the logs
It's the confirmation that setting the latency succeeded.
2016-07-14 20:15:54 +02:00
cpfeiffer 8154a887cb When there are cached services, skip service discovery 2016-07-08 22:15:36 +02:00
cpfeiffer 8549031c6f Only attempt to reconnect when we were previously initialized 2016-07-04 23:38:25 +02:00
cpfeiffer 91d1cea51f Avoid potential NPEs 2016-07-04 22:40:24 +02:00
Andreas Shimokawa 73b2fc357e Pebble: Add some Pebble Time 2 support - NOT WORKING
Not working because these are expected to use BLE.
The Emulator should work though.
2016-07-04 22:09:56 +02:00
cpfeiffer 8b24e098ea Set sampleProvider to avoid NPEs 2016-07-01 00:22:54 +02:00
cpfeiffer f65afa64d9 log raw activity data from mi band, closes #341
Hopefully aids in deciphering activity kinds.
2016-06-28 23:23:29 +02:00
cpfeiffer f0da25c49b Fix activity fetching getting stuck when double tapping #333 2016-06-28 23:07:24 +02:00
cpfeiffer e70a2290c3 sampleproviders now return device specific data #206 2016-06-27 20:43:48 +02:00
Andreas Shimokawa 659165fa4c Pebble: fix new app manager on 2.x
- properly intert apps reported from pebble into the corresponding tab
- disable tracking of installed apps
- disable drag and drop for apps and watchfaces
- ...
2016-06-24 13:39:29 +02:00
Andreas Shimokawa 1de6ee019f Pebble: fix regression. FW 2.x was completely broken
No one noticed, so it seems we can kill 2.x support soon :D
2016-06-24 12:07:44 +02:00
Andreas Shimokawa b77f3ad3bf Pebble: Implement call dismissal with canned messages
This also moved the canned replies setting to pebble settings
(we will change that if we have another device supporting this)
2016-06-24 10:25:08 +02:00
Andreas Shimokawa 67e5bc0434 Pebble: implement decline call with SMS
Based on a proposal by @danielegobbetti, thanks!

This still does not enable the feature since the necessary blobdb is not filled yet
2016-06-21 00:31:53 +02:00
cpfeiffer 9772d8af06 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-19 21:14:03 +02:00
Andreas Shimokawa 4b5969ef96 Merge branch 'master' into appmanager-fragments 2016-06-19 12:33:05 +02:00
Andreas Shimokawa f42899d910 Pebble: on FW 2.x do not send extended music info and do not send playstate
I don't think they are supported and I cannot test.
2016-06-19 12:17:19 +02:00
Andreas Shimokawa 79b439da28 Implement App Sorting
- grab icon to move apps
- cache can be sorted but nothing will be send to watch
- if sorting apps or watchfaces, order will be sent to watch
- we try to keep track of what is installed and what not

Firmware 2.x is currently not working properly
2016-06-17 22:43:06 +02:00
cpfeiffer d544509b60 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-16 21:55:16 +02:00
Andreas Shimokawa 65ac4b364f Merge branch 'master' into appmanager-fragments 2016-06-16 01:09:35 +02:00
Andreas Shimokawa b79b94809a initial support for FW 4.0-dp1 2016-06-16 00:24:27 +02:00
Andreas Shimokawa 1c6c78507c Merge branch 'master' into appmanager-fragments 2016-06-15 22:53:41 +02:00
Andreas Shimokawa d225743d64 Pebble: some preparations for Pebble 2 2016-06-15 22:53:05 +02:00
Andreas Shimokawa 7937fd6ea7 Merge branch 'master' into appmanager-fragments 2016-06-15 22:36:06 +02:00
Daniele Gobbetti 4120d686b8 Some key events were not working with the default audio player. Reported in #322 2016-06-15 22:15:21 +02:00
cpfeiffer a01507a924 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-14 20:14:04 +02:00
Andreas Shimokawa 1d6a697000 playing around with fragments 2016-06-14 15:56:38 +02:00
Andreas Shimokawa 98999993e5 Pebble: In AppManager allow moving apps on the device to the top (context menu) 2016-06-12 01:20:12 +02:00
Andreas Shimokawa f812fb1b1f Improvements to MusicPlayback receiver
- Also send duration if "duration" extra is present
- If "playing" and "postion" extras are present send a music state update

treat previous state and current state as equal if position delta is <=2 seconds
(Neccessary for some players which update every second - the pebble however counts by itself)
2016-06-11 23:37:03 +02:00
Andreas Shimokawa 9623449b6e Merge branch 'master' into feature-weather 2016-06-09 23:15:23 +02:00
Andreas Shimokawa b76619bb5b Pebble: implement app reordering in PebbleProtocol
Not yet used.
2016-06-09 23:14:40 +02:00
Andreas Shimokawa fd31bfe56b Merge pull request #325 from stepardo/steffen/pocketcasts_notifications
Set extended music info by dissecting notifications on Android 5.0+
2016-06-09 23:12:17 +02:00
Steffen Liebergeld c5262869d9 Use names for playstates
These names need to be mapped to device specific constants in the
device code.
2016-06-09 20:02:55 +02:00
Steffen Liebergeld 91f374edec Revert ""duration" parameter in onSetMusicInfo uses microseconds"
The decision on granularity of APIs is up to the maintainers.

This reverts commit 204748c518.
2016-06-09 20:02:55 +02:00
Andreas Shimokawa 088dfda5f4 Pebble: implement app reordering in PebbleProtocol
Not yet used.
2016-06-09 19:55:36 +02:00
Steffen Liebergeld 204748c518 "duration" parameter in onSetMusicInfo uses microseconds
This is in line with Android, and saves some calculations (and thereby a
tiny little bit of battery life).
2016-06-08 20:43:46 +02:00
Steffen Liebergeld e386d6da43 Add onSetMusicState(MusicStateSpec stateSpec)
This commit contains the infrastructure needed for the
NotificationHandler to send music state information to the device. That
is, it introduces a call onSetMusicState(MusicStateSpec stateSpec), that
in turn sets up an intent to the service, which will then call the
encodeSetMusicState() function of the device. encodeSetMusicState is
available for pebble only. There are empty stubs for other devices.
2016-06-08 20:31:48 +02:00
Steffen Liebergeld 0470731e4b PebbleProtocol: Do not call encodeSetMusicState in encodeSetMusicInfo
encodeSetMusicState will be accessible on its own. If it was used to set
the music state, a call to encodeSetMusicInfo must not reset this info
arbitrarily.
2016-06-08 20:16:33 +02:00
Andreas Shimokawa 98a0774fc2 Merge branch 'master' into feature-weather 2016-06-07 22:53:40 +02:00
Andreas Shimokawa 32429df7bc Pebble: allow to enable or disable sync for each activity tracker in settings
This is useful if you have multiple phones and do not want to have your data synced to one of them
2016-06-07 22:51:14 +02:00
cpfeiffer ae548d0806 WIP: more work, compile again 2016-06-06 23:18:46 +02:00
cpfeiffer 3b87966fe9 Merge branch 'master' into db-refactoring 2016-06-06 22:16:40 +02:00
cpfeiffer 2b6ee41970 Add logging of heartrate values #318 2016-06-05 22:37:42 +02:00
cpfeiffer ca26e27c60 Basic support for Mi Band 2 #323, untested 2016-06-05 22:31:07 +02:00
Andreas Shimokawa 9d3f3c57cd Pebble: make disabling of appmessage handlers more generic
Also disable morpheuz handler if morpheuz is not the chosen activity tracker
.... and bump reported version to 3.12 to match the latest pebble release
2016-06-04 21:50:26 +02:00
Andreas Shimokawa 321707af8f Pebble: ignore incoming misfit data if misfit is not set as the preferred activty tracker 2016-06-04 21:33:38 +02:00
Daniele Gobbetti 968d15c8d8 Keep the pebble health data on the pebble watch if the activity provider is not pebble Health.
This will nack all pebble health datalog messages. As mentioned in #322, this would allow to use multiple android device without secondary devices "sipping" the health data from the watch.
2016-06-04 18:21:49 +02:00
cpfeiffer 2e6536555b Fix previous commit (compile!) 2016-05-31 22:56:22 +02:00
cpfeiffer 9a106667d2 Setting the wear location appears to fail for amazfit #274
So as a test, disable that for amazfit. Let's see what happens
next.
2016-05-31 22:33:38 +02:00
Andreas Shimokawa 19d7c03545 Pebble: get rid of log spamming when changing applications (unhandled message) 2016-05-31 14:18:45 +02:00
Andreas Shimokawa b71597800a Pebble: set device to reconnecting state when actively reconnecting
It makes it easier to watch connection attempts and the delay between them in control center.
2016-05-29 23:24:16 +02:00
Andreas Shimokawa 33da6c2925 Pebble: make sure that "waiting for reconnect" state is set when initial connect fails 2016-05-29 22:58:25 +02:00
cpfeiffer 2d49ce505a Set state to "Waiting for reconnect" for BTLE devices 2016-05-26 23:48:05 +02:00
cpfeiffer 6e33c7364a Remove some commented code 2016-05-26 22:21:58 +02:00
cpfeiffer c360eb3392 This should fix some connection problems #274
Some APIs have become synchronous, it seems, e.g.
connectGatt() -> onConnectionStateChanged() -> discoverServices() -> onServicesDiscovered()
appears to happen synchronously. So connectGatt() will not return before services are discovered!

So now we deal with this situation.
2016-05-26 19:03:38 +02:00
Andreas Shimokawa e3bee37b81 Change UUID prefix to 0x4767744272646700 2016-05-24 13:20:16 +02:00
Andreas Shimokawa cb1ec5dccb Make calendar event type byte instead of int
Now the UUID will be constructed like this:

High 64bit 0x4742474200 | type
Low 64bit id
2016-05-24 13:11:57 +02:00
Andreas Shimokawa c9c9b420dc Pebble: Send sunrise and sunset events to the pebble every day using AlarmManager 2016-05-24 11:19:57 +02:00
Andreas Shimokawa ec154c9041 Merge branch 'master' into feature-weather 2016-05-24 11:09:21 +02:00
Andreas Shimokawa af3cfefec0 Merge branch 'master' into feature-sunrise 2016-05-23 23:52:39 +02:00
Daniele Gobbetti bef59ae9c0 Parse new version of Pebble health datalog message with tag "84".
This message was previously treated as a further "Sleep" message type, with firmware version 3.12 further types were added that are clearly unrelated to sleep (possibly to high-intensity activities like running etc.), hence the related code is now moved to a separate class.

The only decoded records are still sleep-related.

Fixes #312
2016-05-23 21:13:12 +02:00
Andreas Shimokawa 6370fdbebe Merge branch 'master' into feature-sunrise 2016-05-22 01:25:52 +02:00
Andreas Shimokawa 0d7986a5ab Pebble: rework incoming reconnection support
This is now completely generic and should work for other devices also

Fixes #296
2016-05-22 01:19:28 +02:00
Andreas Shimokawa 4bd578ebea Pebble: send sunrise/sunset to watch for today and tomorrow, also delete previous timeline pins 2016-05-16 23:37:40 +02:00
cpfeiffer 876bdac918 More WIP: remove now unused code, better use of generics 2016-05-16 23:36:54 +02:00
cpfeiffer 40a376bbd0 Merge branch 'master' into db-refactoring 2016-05-16 23:01:16 +02:00
cpfeiffer 3e0bc16741 More WIP, but we're getting closer
current state:
- storing samples works (tested only mi band)
- charts work
2016-05-16 23:00:04 +02:00
Andreas Shimokawa 017f650b3f Pebble: send sunrine and sunset pins to timeline when setting time in debug menu
This is just a test and it will leak your timeline data, since we never delete it.
Also this adds some rough infrastructure for calendar events.
2016-05-16 17:30:11 +02:00
Andreas Shimokawa dafdb1008d Merge branch 'master' into feature-weather 2016-05-16 14:15:39 +02:00
cpfeiffer 3a1f91b5a8 Default to low latency mode #287
Tested with Mi1A and Mi1S -- works fine and faster than without
low-latency mode.
2016-05-15 00:22:53 +02:00
cpfeiffer 5963843216 Experimental support for #274 (untested yet) 2016-05-15 00:15:31 +02:00
cpfeiffer 8ca821ab8a More WIP on db refactoring 2016-05-13 23:47:47 +02:00
cpfeiffer d0c8483d92 More WIP 2016-05-08 23:49:15 +02:00
Andreas Shimokawa 9b7f2c1e91 try to fix weiredness with pebble reconnects 2016-05-08 17:19:01 +02:00
Andreas Shimokawa 65a95366f4 Mi Band: Allow setting low-latency FW update mode in Mi Band development settings 2016-05-04 13:24:32 +02:00
cpfeiffer 10d7274aa1 Fix testcases (all this should be scrapped and redone with e.g. robolectric) 2016-04-29 21:58:08 +02:00
cpfeiffer 5e02724c4c Make automatic reconnect after connection loss configurable #293
Mi Band: automatically reconnect when the device is back in range

Also: #89
2016-04-28 23:17:13 +02:00
cpfeiffer e35ce978bd Remove now unused imports + fix one more SharedPreferences usage 2016-04-25 23:43:19 +02:00
cpfeiffer 0704915a88 Move parsing of preference strings to int values to Prefs 2016-04-25 23:39:03 +02:00
cpfeiffer 0c715a2669 Wrap access to SharedPreferences with "Prefs"
(to centralize quirk handling)
2016-04-25 23:18:55 +02:00
cpfeiffer 98d7237ec3 Display a different notification icon, when disconnected
Better icons welcome :-)
2016-04-15 22:57:13 +02:00
cpfeiffer 78bf516897 Disabling sleep measurement for continuous measurement is not necessary
Looks like they don't interfere, after all. #178
2016-04-12 23:25:12 +02:00
cpfeiffer f15a97d994 Initial live heartrate measurement in the live activity tab #178 2016-04-12 23:12:50 +02:00
cpfeiffer 802e9a8235 OK, revert to connectGatt(false), connect often does not work with true #249 2016-04-09 09:53:03 +02:00
cpfeiffer 1e5dbb6a23 OK, just connect(true) is not sufficient #249
(we again get connection problems. Let's try this.)
2016-04-07 20:53:25 +02:00
Daniele Gobbetti a49335fa67 Allow to change stored samples converting only certain old types 2016-04-07 17:52:15 +02:00
Andreas Shimokawa b1a93c430d interrupt thread instead of joining to fix ANR 2016-04-07 00:21:21 +02:00
Andreas Shimokawa e91b5a07bd Pebble: change delay between reconects to 1,2,4,8,16,32,64 (max) seconds 2016-04-06 22:55:04 +02:00
Andreas Shimokawa 94cec55a20 Merge pull request #276 from roidelapluie/reconnect
Pebble: Smarter reconnection attempts
2016-04-06 22:41:07 +02:00
danielegobbetti d2af3468f0 Add support for new datalog message added in pebble firmware 3.11
This adds support for storing deep sleep data.
2016-04-06 21:48:16 +02:00
Julien Pivotto e42a041448 Pebble: Smarter reconnection attempts
Sleep several seconds between reconnection attempts:
One second after first attempt, two after the second, and so on.

refs #89
2016-04-06 12:37:23 +02:00
Daniele Gobbetti 51def0d497 Add light intensity to the known steps datalog message.
Add support for record version 6 introduced with firmware 3.11.
There are more data in each record now, but we still do not know what they mean.
Close #270
2016-04-04 23:33:17 +02:00
Daniele Gobbetti 34600e085e Fix wrong assignment, needed to properly deal with datalog messages longer than 255 2016-04-04 23:13:57 +02:00
Andreas Shimokawa a15b327ff1 Refactoring: get rid of ServiceCommand, use new CallSpec and MusicSpec to pass Call and Music info 2016-04-04 20:08:34 +02:00
cpfeiffer 3e3cf462a6 Attempt to re-enable automatic reconnect (autosensing) #249
(now that initializing device works again)
2016-04-03 23:32:15 +02:00
cpfeiffer 59c3970008 Reuse characteristic objects #234 2016-04-03 23:01:58 +02:00
cpfeiffer b129844169 Small fixes to PR 273 #232
- dynamically toggle hr sleep support when preference changes
- check hr support dynaically after device info is available to avoid false error message
2016-04-03 22:38:06 +02:00
cpfeiffer 7cda9f1923 Merge branch 'computerlyrik-heartrate-sleep-support' 2016-04-03 21:46:29 +02:00
cpfeiffer 804a85d31f Small refactoring of BtLE actions 2016-04-03 21:46:24 +02:00
cpfeiffer b54fe53cd5 Merge branch 'heartrate-sleep-support' of https://github.com/computerlyrik/Gadgetbridge into computerlyrik-heartrate-sleep-support 2016-04-03 21:02:45 +02:00
Andreas Shimokawa 4389c1cca3 Pebble: wait 4 seconds instead of 2 when notifications/calls trigger reconnection 2016-04-03 18:36:30 +02:00
Andreas Shimokawa 7ddfd35c35 Pebble: auto connect on incoming notification or phone call if connection was lost unxpectedly before 2016-04-03 18:30:20 +02:00
cpfeiffer a4919789ca Add some progress to firmware updating #271 #234
Also: remove the low latency mode for firmware update,
because my Mi1S simply disconnects then.

Still missing in the view: device disconnects
2016-04-03 00:50:45 +02:00
cpfeiffer 2d10c11005 Log the length of the bytes written 2016-04-02 22:35:37 +02:00
cpfeiffer 0e49535966 Fix progress during fw update #234 2016-04-02 22:24:33 +02:00
Christian Fischer f2de21a664 test if heartrate is supported before writing preferences 2016-04-02 16:11:51 +02:00
Christian Fischer 20aa7d9ad9 add preference to set hartrate sleep detection 2016-04-02 16:09:30 +02:00
cpfeiffer ea5c6a0848 Log ignored notifications when updateCoordinator is null 2016-03-31 21:57:36 +02:00
cpfeiffer 6f97b8c1e5 Log the date that we receive from the Mi Band 2016-03-31 21:54:09 +02:00
cpfeiffer 66c1b3f178 Relax check for Mi1S device detection #234 2016-03-31 21:39:51 +02:00
cpfeiffer 4631df67ac Some more logging + add svg launcher again (somehow it was not added again) 2016-03-30 22:53:08 +02:00
cpfeiffer ffc006c21c Fix ordering problem with firmwareInfoSent state variable #234 2016-03-30 21:56:00 +02:00
cpfeiffer cc7f5406ef Use low latency transfer mode for fw update #234 2016-03-30 21:48:42 +02:00
cpfeiffer e931cf47d7 Need to pass '0' as parameter to mi band fw metadata info #234 2016-03-29 22:15:14 +02:00
cpfeiffer 8815f0d134 Small cleanups and fixlets. 2016-03-28 23:02:22 +02:00
Andreas Shimokawa 6ce63276a3 play around with play states, simplify weired nested switch 2016-03-27 19:50:32 +02:00
Andreas Shimokawa adfef3db42 Prepare code for more music metadata (duration, track count, current track number)
Oh and format code
2016-03-27 17:45:44 +02:00
cpfeiffer 8165751e57 Refactoring to test the double firmware update procedure #234
(while performing the same, known to be working firmware update for Mi1A)

Result: double firmware update procedure works on Mi1A.

Also updated FirmwareTest. Perform all tests not only in the test itself,
but also at runtime before doing the actual update.

Further:
- fix setting of firmwareInfoSent state variable, which prevented installation
  of the section firmware
- make one string translatable
2016-03-25 23:45:27 +01:00
cpfeiffer 3714ec82da Extracted String "HR: ", (= Heart Rate Firmware Version) 2016-03-24 22:23:16 +01:00
cpfeiffer 89eddb13b0 Fixed connection issues by reading the date from the band #249 2016-03-24 22:10:23 +01:00
cpfeiffer e5b0afb916 Enable low latency during activity sync 2016-03-24 21:26:51 +01:00
cpfeiffer 11ac01f0e8 Set low latency mode during initialization #249
This appears to fix the initialization getting stuck sometimes, e.g.
after turning on bluetooth and then connecting.

The band incidentally sends 0x8 when it's stuck (won't accept the UUID_PAIR
request).
2016-03-23 22:50:42 +01:00
cpfeiffer 1348bad4d3 Improved log output 2016-03-23 22:17:01 +01:00
cpfeiffer b0ec74696d Give better feedback when a firmware cannot be installed #234 2016-03-22 16:12:27 +01:00
cpfeiffer 424d9cd142 More work on firmware detection, recognition and validation #234
Should be as robust as possible now.
2016-03-21 23:42:34 +01:00
cpfeiffer 275839a7f4 last arg of copyOfRange() is index, not length! 2016-03-21 04:18:45 +01:00
cpfeiffer f7b71c1f96 Add logging to firmware detection #234 2016-03-21 04:17:12 +01:00
Andreas Shimokawa 76fc7a2aec always save last device address when connecting, fixes #258 2016-03-20 19:48:54 +01:00
Andreas Shimokawa 4be1926459 reformat code though Android Studio 2016-03-20 15:00:05 +01:00
cpfeiffer b3410dcebe Improved testcase #234 2016-03-20 12:18:43 +01:00
cpfeiffer 4f956000c5 Enhanced support for firmware detection, recognition and upgrade #234
Also supports double firmware upgrade for Mi1S.
- so far, only hr firmware upgrade is tested for 1S
- adds junit testcases for firmware recognition and handling
2016-03-20 01:07:57 +01:00
cpfeiffer 6d8d6d5bc8 Testcases for firmware checking 2016-03-20 01:07:57 +01:00
cpfeiffer c5a887192d Remove/revert some temporary test code 2016-03-16 00:27:32 +01:00
cpfeiffer e26e6d7b24 Display HR firmware version
Hide fw,hw,hr versions by default and show them on demand with an info
button.
2016-03-16 00:27:32 +01:00
cpfeiffer 91f02ae920 WIP: Lots of work towards double firmware update for Mi 1S #234 2016-03-16 00:27:08 +01:00
cpfeiffer 3f39928df5 Some more cursor-related improvements (closing) 2016-03-08 23:48:31 +01:00
cpfeiffer 7e8281e8d4 Improve exception handling logic a bit 2016-03-08 21:33:12 +01:00
Andreas Shimokawa a89fea9c7d Pebble: Fix crash when starting pebstyle
Also make code for "push" handlers more generic
2016-03-08 12:02:00 +01:00
Andreas Shimokawa 88982a6174 Merge pull request #235 from Freeyourgadget/feature-configuration
Use external browser for configuring pebble apps
2016-03-08 10:41:46 +01:00
cpfeiffer 5eb8f57b4c Some more byte -> int conversions 2016-03-07 22:47:34 +01:00
cpfeiffer be012eca8d For Mi Band 1A (fw 5.15.7.14) we get 0xa for auth success #180 2016-03-07 21:43:45 +01:00
cpfeiffer 50dd7f5eba Better check for heartrate support on non-heartrate devices 2016-03-07 21:36:31 +01:00
Daniele Gobbetti 3920b3f977 Do not override the configured settings with our old stored values (but keep them around) 2016-03-04 17:43:43 +01:00
Andreas Shimokawa bd7b34985b reformat code and optimize imports 2016-03-03 15:47:00 +01:00
Andreas Shimokawa 2a7f9226a0 Pebble: send configuration to watch
TODO: handle booleans
2016-03-03 14:23:17 +01:00
Andreas Shimokawa 63d938559e pass GBDevice down to ExternalPebbleJSActivity to determine the platform version (aplite,basalt,chalk) 2016-03-03 11:52:30 +01:00
Andreas Shimokawa fc464d112d change some more short and byte to int regarding Morpheuz 2016-02-29 23:13:07 +01:00
cpfeiffer cbe73f71a1 Fix some typos (thanks!) #178 2016-02-29 22:08:34 +01:00
Andreas Shimokawa ed85fd5011 convert byte and short values related to activity tracking to int
This avoids a lot of problems because java
- does not know unsigned values
- jvm and dalvic do not internally support byte and short
- sqlite does not know them either
2016-02-29 20:54:39 +01:00
cpfeiffer ddde25e5df Initial firmware update support for Mi1S #234 2016-02-28 02:46:48 +01:00
cpfeiffer d7822d07a6 Show the measured heart rate as a Toast, for now #178 2016-02-27 23:27:15 +01:00
cpfeiffer 3ff31cd73b Disable heartrate in charts fow now, fix notification for manual hr 2016-02-27 23:18:44 +01:00
cpfeiffer ac8d7bee5f Only do heart rate stuff when supported #178 2016-02-27 11:23:55 +01:00
cpfeiffer de6f898fef Some more fixes regarding heart rate measurement #178 2016-02-27 11:18:16 +01:00
Kasha 9e636d66f6 Initial heart rate support by KashaMalaga #178
(removed unrelated Android M fixes and squashed commits)
2016-02-27 00:05:06 +01:00
cpfeiffer 0ef738067d Some work in progress for heart rate graphs #178
Currently we get the heart rate when synchronizing activity data
(i.e. not live) and we write it to the activity database so that we
can show a nice graph. The value is currently always 0 though,
because we can't enable recording hr, yet.
2016-02-26 23:45:17 +01:00
Daniele Gobbetti df741e9571 Install app on watch directly instead of telling the user to do so. 2016-02-26 15:29:26 +01:00
cpfeiffer 0b568df8de Extra byte indeed appears to be heartrate value #205 2016-02-26 00:04:33 +01:00
cpfeiffer 095ef56c14 Initial support for activity data sync with Mi 1S #205
Looks like the activity type is somehow wrong though, or I'm sleeping
all day ;-)
2016-02-25 23:52:34 +01:00
cpfeiffer 109146c8c1 Attempt at fixing a (re-) connection issue
Sometimes reconnection lead only to "Connected" state, but not "Initialized".
This probably happened when the device got disconnected earlier and then was
automatically reconnected. The reconnection closed the previous connection,
which caused the dispatch-thread to wake up and think the connection is
actually establish. Then, when the first action is invoked, it would fail
with an NPE because mBluetoothGatt passed to the action is actually null.
2016-02-18 23:44:01 +01:00
cpfeiffer c86365ee2e Some more Mi Band pairing improvements #180
- listen to notifications early -- the band then actually tells us that
  authentication is required
- check for this after sending user info
- add authentication states to GBDevice
- workaround for event problems in pairing activity (delivered although
  already unregistered)
- BtLEQueue now deals with gatt events coming *before* connectGatt()
  actually returned (namely the connection event)
2016-02-13 00:15:16 +01:00
Daniele Gobbetti 8294921de7 Do not ack the sleep data until we can actually store them
Added helper method to fetch the latest timestamp stored in the DB, needed for the aforementioned feature.
Update changelog

This closes #188 \o/
2016-02-11 19:14:40 +01:00
Andreas Shimokawa 7436778700 Pebble: fix for recent morpheuz versions (maybe breaks old versions) 2016-02-11 12:49:01 +01:00
Daniele Gobbetti 20c4e49fe1 Refactoring of the Pebble Health steps data receiver.
Added logic to deal with pebble health sleep data.
Added database helper to change the type of a range of samples (needed for sleep data).
Fixes to the Pebble Health sample provider.
2016-02-09 17:52:21 +01:00
Andreas Shimokawa d62946df63 Pebble: some minor code cleanups regarding health 2016-02-09 01:31:41 +01:00
Andreas Shimokawa 93db073538 Pebble: try to fix health code, might be broken, cant test 2016-02-09 00:56:16 +01:00
Andreas Shimokawa 12a5b53f00 Pebble: Merge DatalogHandler and DataLog session
Also:
- pass the length of the payload and not of the whole datalog buffer to handleMessage(), simplifying DatalogSessionHealth::handleMessage()
2016-02-09 00:49:42 +01:00
Andreas Shimokawa b01a517813 Pebble: fix hexdump for health datalog 2016-02-08 23:33:05 +01:00
Andreas Shimokawa 0c4e606e74 Pebble: rename BLOBDB_HEALTH to BLOBDB_PREFERENCES and encodeSaneDistanceUnit to encodeSetSaneDistanceUnit
Also allow to set insane units in the method
2016-02-07 21:59:14 +01:00
danielegobbetti 10b5c571bb Use Kilometers as distance unit 2016-02-07 16:44:16 +01:00
danielegobbetti 2f8207abf9 Initial support for reading pebble health steps/activity data. 2016-02-07 09:27:51 +01:00
danielegobbetti 03ad7f5a24 Do not enable insights on the watch. Add notice about health activation to changelog. 2016-02-06 21:38:55 +01:00
Andreas Shimokawa 59d6553c54 Pebble: fix stupid bug that broke active reconnection 2016-02-06 19:35:49 +01:00
Andreas Shimokawa 85bad9abf5 Pebble: store information about datalog sessions (uuid, item type, length, tag)
... and log them if data comes in from a known id.
Also request open sessions on connect.
And last but not least hex dump data which might be from Health (the tags that I never see on Aplite but always on Basalt)
2016-02-03 23:27:35 +01:00
Andreas Shimokawa 493fcfc853 Pebble: improve datalog output 2016-02-03 20:23:56 +01:00
Daniele Gobbetti baf5eee72f Refactored the User Activity-tracking related preferences.
Created a new device-independent class ActivityUser to hold the data
Moved the constants from the miband constant class to the ActivityUser class
Removed the miband-specific in favor of common-prefixed preferences (with upgrade support for legacy values)
Changed the way the gender is stored to an integer value
Removed the hardcoded default values for user data in favor of static fields of the ActivityUser class
2016-02-02 17:33:24 +01:00
Daniele Gobbetti 5b016e2577 WIP, read the miband user information for the time being. 2016-01-29 17:45:35 +01:00
Daniele Gobbetti 8e7dc18fa8 Merge branch 'master' into feature-weather 2016-01-28 12:00:47 +01:00
Daniele Gobbetti 9f2a7f5448 actual deletetion of the Health app.
It brings the health watchapp back to the pristine state "you need pebble health in order to use this app". The data, however, is not deleted!
2016-01-28 11:59:23 +01:00
Daniele Gobbetti e7c93ca1c3 Merge remote-tracking branch 'origin/master' into feature-weather 2016-01-28 11:11:20 +01:00
Andreas Shimokawa 33cf76172b Pebble: add hack to enable and maybe disable Health from the App Manager activity 2016-01-27 23:02:09 +01:00
Andreas Shimokawa 666c53a1e4 Pebble: make encodeBlobDB accept Strings and UUIDS as keys, use it for Heath activation 2016-01-26 10:48:50 +01:00
danielegobbetti 7ba3a874a2 Message to activate Pebble Health, possibly. 2016-01-25 23:15:19 +01:00
danielegobbetti 3d3643ece3 Add weather to PebStyle as well. 2016-01-22 21:04:01 +01:00
danielegobbetti 11297cd855 Merge remote-tracking branch 'origin/master' into feature-weather 2016-01-22 20:48:26 +01:00
Andreas Shimokawa a72373c17c move PebbleContentProvider.java 2016-01-22 20:38:44 +01:00
Andreas Shimokawa b9c1332442 Testing content provdider 2016-01-22 20:21:18 +01:00
Andreas Shimokawa de4ffe8fb0 allow to setup a common suffix for canned replies (defaults to " (canned reply)") 2016-01-11 15:29:12 +01:00
Andreas Shimokawa 7ba156da62 Try to support MarioTime.
Does not work :/
2016-01-10 20:12:52 +01:00
danielegobbetti 4bb78722b5 Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into feature-weather 2016-01-09 18:48:39 +01:00
Andreas Shimokawa 0b53f60b0d Pebble: EXPERIMENTAL support for replying to wearable notifications
Tested with Signal, more could work.
2016-01-09 17:54:17 +01:00
Andreas Shimokawa 46bbab7df0 rename IDSenderLookup to LimitedQueue and store Object instead of String 2016-01-09 16:07:22 +01:00
cpfeiffer ae5417b9cc Avoid NPEs when aborting an erroneous sync #205 2016-01-07 00:33:20 +01:00
danielegobbetti 3d389f31a3 fix force close when weather hasn't been parsed yet, use the yahoo codes for this watchface, as required 2016-01-05 16:05:12 +01:00
danielegobbetti c7c723134e Add weather singleton (to store the whole data passed by weather notification).
Add weather info for TimeStylePebble.
Add further fields to the ParcelableWeather class.
Add reverse mapping to ParcelableWeather to get back the original OpenWeatherMap API condition codes.
2016-01-03 18:28:32 +01:00
danielegobbetti 1f1ac8cf37 Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into feature-weather 2016-01-03 16:36:09 +01:00
Andreas Shimokawa 50cd5b2629 Pebble: Fix regression which freezes Gadgetbridge when disconnecting via long-press menu 2016-01-02 00:30:11 +01:00
Andreas Shimokawa d358ed81d2 Pebble: Display a failure if we cannot map a notification id back to a Phone number when replying to an SMS 2015-12-31 01:43:00 +01:00
Andreas Shimokawa 890016d652 Pebble: Fix crash when turning off bluetooth when connected on Android 6.0 2015-12-31 01:13:48 +01:00
Andreas Shimokawa e533fdbaa6 Pebble: actually display current whether in WeatherNeat 2015-12-29 22:10:38 +01:00
Daniele Gobbetti 1cbe965802 Add analog+digital settings 2015-12-29 10:45:14 +01:00
Daniele Gobbetti f9122bc674 send the calendar events each time the time is sent to miband, until we have a common strategy (e.g. EventHandler). 2015-12-29 10:01:32 +01:00
Daniele Gobbetti 1d9e1d7caf Fix possible race condition when availableSlots == 3
(There are two difficult things...)
2015-12-29 09:18:02 +01:00
Andreas Shimokawa e3d0c63676 fix PebStyle color 2015-12-27 21:39:46 +01:00
Andreas Shimokawa 2caef02309 fix typo :/ 2015-12-27 19:16:56 +01:00
Andreas Shimokawa 11e02fbf5f Pebble: add experimental reconnect support for standby-mode on firmware 3.x
- You should also set reconnect attempts to 0 in preferences when using this.
- It also works when you set flight mode on the pebble, then wait for about 5 minutes and turn BT back on
- Pebble FW 2.x support ist completely untested.
2015-12-27 19:11:40 +01:00
Daniele Gobbetti 3ee418a45b Implement pushing messages upon watchapp start.
This watchface is used as example: https://github.com/ygalanter/PebStyle because it doesn't initiate a connection like others do.

At the moment this is more a proof of concept^W^W^Wdirty hack then anything else.
2015-12-23 14:22:28 +01:00
Daniele Gobbetti 5f189aedbd Add support for some configuration options of TimeStylePebble watchface ( https://github.com/freakified/TimeStylePebble ) 2015-12-23 09:04:01 +01:00
Andreas Shimokawa 87739d94db Pebble: unify FW 2.x and 3.x action decoding 2015-12-20 21:23:39 +01:00
danielegobbetti a71c27d25e Added subtitle to timeline pins 2015-12-20 19:50:48 +01:00
Andreas Shimokawa 96e21dbf21 Pebble: fix "[Action]" being displayed as SMS action when no canned replies are defined 2015-12-20 00:58:14 +01:00
Andreas Shimokawa 35c7ab6dde PEbble: add database parameter to encodeBlobDBClear(), minor cleanups 2015-12-20 00:40:38 +01:00
danielegobbetti 5026cf269f Added command to clear the DB on pebble. 2015-12-19 20:52:44 +01:00
Andreas Shimokawa 4b29d63d4e Pebble: more debugging 2015-12-19 20:30:46 +01:00
danielegobbetti 9fb2e1620e Rename misnamed file. 2015-12-19 14:36:28 +01:00
danielegobbetti 6582ead01c Add pebble health uuid. 2015-12-19 09:43:55 +01:00
Andreas Shimokawa 7eabf1e603 spoof android app version to 3.8.1 (was 3.0.1) 2015-12-18 21:34:52 +01:00
danielegobbetti 89ef950c62 Add the feature to changelog.
Fix max index for alarms on miband.
2015-12-18 20:30:09 +01:00
danielegobbetti 5fb8c7bed8 Use the right column for sorting upcoming events.
Plus add forgotten getQueue
2015-12-18 18:49:29 +01:00
Andreas Shimokawa 47a34bb7bf Pebble: debug output for blobdb responses (get rid of unhandled endpoint -20005 messages) 2015-12-18 12:41:01 +01:00
Andreas Shimokawa c9dcf06529 Pebble: improve debug output
- decode apprunstate and systemmessage endpoint messages
- prevent error messages by not using appmanager endpoint on firmware 3.x (it is gone)
2015-12-17 23:09:52 +01:00
Daniele Gobbetti 036e92ee64 Implement sending the upcoming events to the miband.
The reserved alarm slots are used for storing the upcoming events.

The method is not yet called anywhere.
2015-12-17 18:02:21 +01:00
Andreas Shimokawa f387f7c96b increase canned replies from 8 to 16
NOTE:

Total allowed bytes for all replies = 512 - (reply count - 1)

TODO:
- check with Firmware 2.9.1
- remove last reply that exceeds the 512 bytes limit completly (else it will be partly truncated)
2015-12-17 00:05:42 +01:00
Andreas Shimokawa dfa85745e8 Send out SMS when replying with a canned response
Closes #121
2015-12-15 00:26:06 +01:00
Andreas Shimokawa de5f30ae97 WIP: Work towards SMS replies / canned replies, round 3
- put random id/phone number pair into limited lookup list (last 16 sms messages) when sms arrives
- lookup the phone number when replying from the a device

THIS STILL DOES NOT DO ANYTHING USEFUL
2015-12-14 23:31:31 +01:00
Andreas Shimokawa 14f8929439 Pebble: fix decoding strings in appmessages from the pebble
This fixes sending SMS from "Dialer for Pebble"
2015-12-14 00:05:14 +01:00
Andreas Shimokawa e5cf22bda6 WIP: Work towards SMS replies / canned replies, round 2
- parse the reply string in PebbleProtocol
- put replies into GBDeviceEvents
- display a toast in AbstractDeviceSupport, containing the reply

THIS STILL DOES NOT DO ANYTHING USEFUL
2015-12-13 22:43:53 +01:00
Andreas Shimokawa 53fb63781e WIP: Work towards SMS replies / canned replies
- Implement the PebbleProtocol side (2.x and 3.x)
- Add Preferences for canned replies

This can be tested by enabling untested features in Pebble Settings
It lets you see and select the replies set up in "Canned Repies" on the Pebble
You will get a "NOT IMPLENTED" message on your Pebble.

THIS DOES NOT ACTUALLY DO ANYTHING USEFUL YET.
2015-12-13 12:03:57 +01:00
cpfeiffer f258e62633 Refactoring: centralize GBDevice creation
- created and provided by DeviceHelper
- passed from UI to service
- without UI, service uses DeviceHelper directly

=> Cleaner and less duplicated code
2015-12-13 00:43:07 +01:00
cpfeiffer 854a7ee1ac Avoid NPE when DeviceInfo is null
(when a notification comes in while we're connected, but not initialized yet)
2015-12-09 17:55:46 +01:00
cpfeiffer 794ae6d800 Well, we better return something usefull instead of just false :-]
Please try again #178
2015-12-09 17:54:54 +01:00
Andreas Shimokawa 18726eca33 Pebble: Correct setting the timezone on firmware 3.x (pebble expects the "ID" eg. Europe/Berlin) 2015-12-08 14:59:24 +01:00
Andreas Shimokawa 3ac00a004f Pebble: Support installing .pbl (language files) on firmware 3.x 2015-12-08 12:07:14 +01:00
Andreas Shimokawa f20e11d517 Pebble: Increase maximum notification body length from 255 to 512 bytes on firmware 3.x 2015-12-07 12:25:34 +01:00
cpfeiffer 365ce61cb6 Support for firmware upgrade/downgrade on Mi 1A.
I hope I didn't break firmware upgrades on some Mi 1 models
other than mine (my hardware revision is 2).

Upgrades for Mi 1S are currently disabled, we need some brave
souls who can help us test this.

Closes #173
Also see: #169
2015-12-07 01:14:06 +01:00
cpfeiffer 6b053c4240 Make method protected, for future use 2015-12-07 01:13:47 +01:00
cpfeiffer aa60ce4b56 Disable some notifications also for update-firmware operation
(introduce a common superclass to do that)
2015-12-07 01:13:47 +01:00
cpfeiffer 8cd6bf09a4 Fix NPE when an error occurs during activity synchronization
(activityDataStruct is null after handleActivityFetchFinish())

Also remove superfluous log statement -- toasts are logged as well.
2015-12-07 01:13:47 +01:00
Andreas Shimokawa b05cfc6aac Pebble: fix crash on firmware 3.x when pebble requests a pbw that is not in Gadgetbridge's cache 2015-12-06 17:56:46 +01:00
Andreas Shimokawa 39e09946cd fix missing assignment *cough* 2015-12-06 15:39:34 +01:00
Andreas Shimokawa 112dfa184a Catch securtiy exception if contacts can't be read on Android 6.0. Closes #182 2015-12-06 15:32:48 +01:00
Andreas Shimokawa aca0149b45 use DeviceHelper in DeviceSupportFactory to determine supported device from bt addresses
This fixes a bug when Pebble was detected as Mi when unpaired.
Since we were not able to read the device name, it was considered MI by duplicated and
faulty code. Fixes #177.
2015-12-01 11:39:34 +01:00
cpfeiffer 40d7f3b19f Improved log output for progress actions 2015-11-30 23:42:59 +01:00
cpfeiffer 4b42a9a4f6 Improved log output for abort actions 2015-11-30 23:42:59 +01:00