Commit Graph

84 Commits (4b4e95bfe0a0b18bd98bc5d31f1c0f23f68757be)

Author SHA1 Message Date
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
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
Andreas Shimokawa 3ac00a004f Pebble: Support installing .pbl (language files) on firmware 3.x 2015-12-08 12:07:14 +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
cpfeiffer bd0716ba58 Some more lint warnings fixed 2015-11-23 23:04:46 +01:00
cpfeiffer d4f070f0aa Simplify external dir handling again -- prefer the primary dir
The primary external dir is often a user-partition on the internal
storage medium. This one is safe in multi-user environments.

The "removable storage" (sdcard) on the other hand can be read by
everyone. If the former is not available or not writable, use the
latter.

closes #153
2015-11-01 20:49:50 +01:00
Andreas Shimokawa cd7acf6572 Pebble: Do not reboot after language file installation (does not seem to be necessary)
NOTE: This still does not work since crc calculation is missing
2015-10-07 00:44:29 +09:00
Andreas Shimokawa 5860c4f4f9 Pebble: WIP support for flashing language files (.pbl)
NOTES:
- YOU SHOULD NOT TRY THIS YET ;)
- This was only tested with the unoffical japansese language pack
- Problably needs proper crc calculation (I just hardcoded the one for the japanese language pack)
2015-10-06 23:56:01 +09:00
Andreas Shimokawa 3bb673d33a Pebble Time Round support ("chalk" platform) 2015-09-23 23:20:49 +02:00
Andreas Shimokawa f6ef72e9fb Pebble: fix some hardware revision strings to match strings in firmware json file
This should enable firmware upgrade on Pebble Time and might fix pbw installation on Pebble Time Steel
2015-09-20 18:27:41 +02:00
Andreas Shimokawa e1b02e1be4 Pebble: add option for PebbleKit support (default is disabled)
Also fix an endless loop when number of reconnects is set to 0
2015-09-19 12:49:34 +02:00
Andreas Shimokawa a5ef952e37 Pebble: Implement WIP outbound communication with PebbleKit Android Apps
This improves #106

Pebblebike aka Ventoo works to some extent sometimes now ;)
2015-09-17 19:21:22 +02:00
Andreas Shimokawa 58bbcb0035 Pebble: allow to configure reconnect attempts
This should help #89
2015-09-17 15:31:12 +02:00
Andreas Shimokawa 95e22a4e32 Pebble: Allow stopping apps though PebbleKit messages (also in the API) 2015-09-13 21:44:26 +02:00
Andreas Shimokawa 9a32be97cb Pebble: work towards PebbleKit support #106
- Untested features have to be turned on.
- We will accept data from any source.
- One way, we do not send out replies.

This already works with the minimalistic sports demo from the sdk
2015-09-13 18:20:15 +02:00
Andreas Shimokawa 95b65265b4 remove eventClass field from GBDeviceEvent, use instanceof instead 2015-08-31 17:25:58 +02:00
Andreas Shimokawa 44c7f99c58 GBDeviceProtocol::decodeResponse() now returns an array GBDeviceEvents
This allowed to remove some ugly hacks from pebble code,  when encoding a
response in a GBDeviceEventSendBytes  and at the same time trying to notify
generic code via another GBDeviceEnvent.
2015-08-27 15:02:29 +02:00
Andreas Shimokawa 2b0acd649b Pebble: close TCP socket when disconnecting from emulator. Prevents hang. 2015-08-21 13:19:46 +02:00
cpfeiffer a1cb246e27 Add and use a "client interface" for the actions of the service
Previously, the DeviceCommunicationService was invoked directly,
via
Intent intent = new Intent(foo, bar);
intent.setExtra(EXTRA_BAZ, baz);
startService(...);

and this was scattered throughout GadgetBridge.
Now there is a "frontend" available, so that you can call
the service more easily, like
GBApplication.deviceService().connect();

For a start, this client interface (DeviceService) actually
implements the same interface (EventHandler) as the receiving side
(DeviceSupport). This may change in the future.

This will also make testing much easier, because we can use
this client interface to invoke the test service as well.
2015-08-21 01:03:57 +02:00
Andreas Shimokawa faaa04b670 App Installation: various improvements
- make FwAppInstallerActivity wait for a completely initialized device
- check basalt/aplite compatibility with pbw to be installed and report intead of crashing
- fix crash when trying to install pbw with all app slots full
2015-08-20 18:55:22 +02:00
Andreas Shimokawa d2173d37ce forgot to commit this also 2015-08-19 01:46:18 +02:00
Andreas Shimokawa a7796ecbc6 Pebble: Emulator support
NOTE:
- supports aplite and basalt emulator
- needs recompilation of Gadgetbridge with INTERNET permission

TODO:
- fix disconnect issues
- emulator special packet support
- string localization
- ...
2015-08-19 00:06:15 +02:00
cpfeiffer 121baa19ec Move AbstractSerialDeviceSupport et al from bt package into serial package 2015-08-18 01:26:15 +02:00
Andreas Shimokawa 0c872a920e Pebble: always set token to -1 before waiting for a new one
This could fix potential problems with app installation
2015-08-17 22:50:46 +02:00
Andreas Shimokawa 6fede31bdf Pebble: make watchapp installation available on FW 3.x without the need for setting an option 2015-08-17 18:07:47 +02:00
Andreas Shimokawa 0d0b3a87e1 Pebble: on FW 3.x always assume success for installation and do no wait for 2.x packets 2015-08-17 12:43:38 +02:00
Andreas Shimokawa 6af0bb2754 Pebble: Do not hardcode icon id for metadata installation, properly acknowledge app fetch requests 2015-08-16 11:33:32 +02:00
Andreas Shimokawa a4f5524f6e Pebble: blindly implement missing parts for app installation on FW 3.x
This is expected to fail and needs to be enable in preferences (untested features).
2015-08-16 00:32:36 +02:00
Andreas Shimokawa f5fbb08696 Pebble: remove unneccessary device update intent (this is done in generic code) 2015-08-14 13:46:37 +02:00
Andreas Shimokawa e28d6fa7cb Pebble: try to install app metadata on FW 3.x (untested) 2015-08-14 12:51:30 +02:00
Andreas Shimokawa 151f5b8e12 Pebble: Choose binaries from basalt/ inside .pbw files for Pebble Time
PBW installation is still unsupported on FW 3.x, these are just preparations
2015-08-11 12:47:23 +02:00
Andreas Shimokawa 6125594703 Various changes related to INITIALZED device state
Due to a bug in DeviceCommunicationService.isConnected(), devices using the
INITIALIZED state only worked when they had useAutoConnect set to true (Mi Band)

Now setting devices to INITIALIZED state to allow any action send to
DeviceCommunicationService is mandatory. As an exception only
REQUEST_VERSIONINFO will be also be allowed for CONNECTED state.

This also fixes a problem when notifications came in on the Pebble with 3.x
FW before we actually knew it was FW 3.x (INITZALIZED state on the Pebble
now implies that we know the FW version)
2015-08-07 13:24:54 +02:00
cpfeiffer 8dee55198e Don't (always) leak the file descriptor.
It's still very much possible to leak the descriptor (when an exception occurs
somewhere in between or anything else goes wrong). So maybe the whole thing
should be redesigned to be independent of files.
2015-08-06 00:45:07 +02:00
cpfeiffer db4261e02b More refactoring: new service/devices package and service/bt package 2015-08-03 23:51:53 +02:00