originally the 100ms sleep after writes was introduced to fix a bug where sending an appmessage right after ACKing a previous appmessage cuased the outgoing packet to be NACK'd by the 3.0+ firmware. 4fe498efc
Keeping because 100ms for most situations doesn't matter, but definitely worth avoiding when uploading new firmware to the watch.
1. We should upload all of the firmware before starting the install process. Otherwise this can cause issues with the install sometimes failing
2. Updates the encoding of the upload start. There are different upload start packet structures
3. Encode the install firmwareStart packet correctly to include how big it will be so that the watch can pre-erase the flash region.
4. Send the firmware then resouces to match the order that the pebble app sends the files.
5. remove arbitrary 100ms sleep in the main loop, the state machine blocks on readWithException already.
Changes:
- BondingUtil: Use PebbleHardware.isBleOnly() for accurate BLE detection
- PebbleIoThread: Detect BLE-only devices using hardware revision/model
- PebblePairingActivity: Use manufacturer data for device identification,
refresh device list on pairing complete
- PebbleGATTClient: Fixed connection handling when pairing with new
pebble watches based on open source PebbleOS
New status and pairing codes which match PebbleOS implementation.
- ConnectivityStatus: BLE connectivity state enum
- PairingErrorCode: Pairing error codes for better debugging
Create PebbleHardware.java as the single source of truth for all
Pebble hardware definitions and for determining what model and features
a watch has. The goal of this commit is to better unify the pebble watch
model definitions into a single source of truth to make adding new
models easier, as well as to bring all the relevant model specific logic
about what a watch is capable of, or which watch model to use into a
single file versus being spread out among multiple files making it
easier to fail to fix logic bugs.
The PebbleHardware class now has all the definitions for the following
information in one place:
- Platform enum with capabilities (BLE-only, hasHealth, hasHRM)
- Hardware revision registry mapping hardware IDs to codenames
- BLE-only device detection methods
- Platform name lookup for watchface installation
This cleans up PebbleUtils to only contain non-hardware utilities.
(maybe should move into the pebble directory away from the utils folder
in another commit?)