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.
First comes the pie chart (details) now, the the bar chart (overview)
Maybe we should do this differently in the sleep and week-steps
fragments, but for a start, and having it consistently, this is how it is.
They are now managed by the Activity, because the fragments
may be created and destroyed at any time and hece cannot
synchronize their date-state all the time.
Open issue: moving across the borders (first day with data,
current day)
- append a string on the control center when the device is charging
- battery status string is no more, welcome battery state enum
- the notification will not be shown when the device is charging, even if the level is below threshold
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.
- 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
- only show the bigtext notification if the device has set extended battery info
- custom icon for the low battery notification (with license information)
- show device name in the notification
- set the notification to high priority
- the battery threshold is now set in GBDevice
NOTE:
- supports aplite and basalt emulator
- needs recompilation of Gadgetbridge with INTERNET permission
TODO:
- fix disconnect issues
- emulator special packet support
- string localization
- ...
- version information is now provided implicitly by device initialization
- ACTION_REQUEST_VERSIONINFO is now ACTION_REQUEST_DEVICEINFO and it will
return the current device state of the service without asking any DeviceSupport
instance.
- ACTION_CONNECT now implicitly answers with a device update intent if it
IS already connected.
In a second step, request the version from the device (and send updated
values then)
RequestVersionInfo is either a misnomer or misused, depending on your view.
It is actually used by activities to get the current state of thde device.
We now provide this as quickly as possible, with the drawback of sometimes
sending results twice.
- the BASE_UUID is shared between all BTLE devices, not miband specific. So are the UUID DESCRIPTORS. Hence these have been moved to AbstractBTLEDeviceSupport
- the gatt-characteristic-property-constants used previously in MiBandNotifyAction are also general, and exposed by the gatt subsystem, hence the specific action has been dropped moving the logic to the NotifyAction class
- the logic for checking the gatt-characteristic-property-constants has been extended also to the ReadAction and WriteAction class, this way we won't try to read (or write) a characteristic that isn't readable (or writeable)
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)
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.
- model package contains mostly shared interfaces (UI+service), not named GB*
- impl package contains implementations of those interfaces, named GB*
the impl classes should not be used by the service (not completely done)
- the service classes should mostly use classes inside the service and deviceevents
packages (tbd)
Every device now has two packages:
- devices/[device name] for UI related functionality
- service[device name] for lowlevel communication
There are some inconsistencies across ROMs: some need the mimetype filter to be present in order to match the file extension, other refuse to do so if the filter is present. Current strategy is to satisfy both requirements by duplicating the filter element.
At the moment the progress bar code is not useful because the FW preparation is almost instantly done, and is the BT transfer that takes time.
The transfer happens when the getQueue method is called, and there is no progress info that I can find.
- add some device and db independent model interfaces for activity samples
- use these model interfaces where possible
- chart activity does not do device dependent rendering anymore and uses
normalized values for all devices
- initial interface for daily summaries
This way on android 5 the status of the connection is shown also on the lockscreen even if the user chose to hide sensible content of the notifications.
java.lang.NullPointerException: Attempt to write to field 'int nodomain.freeyourgadget.gadgetbridge.miband.MiBandSupport$ActivityStruct.activityDataHolderProgress' on a null object reference
at nodomain.freeyourgadget.gadgetbridge.miband.MiBandSupport.flushActivityDataHolder(MiBandSupport.java:748)
at nodomain.freeyourgadget.gadgetbridge.miband.MiBandSupport.handleActivityNotif(MiBandSupport.java:689)
at nodomain.freeyourgadget.gadgetbridge.miband.MiBandSupport.onCharacteristicChanged(MiBandSupport.java:583)
at nodomain.freeyourgadget.gadgetbridge.btle.BtLEQueue$2.onCharacteristicChanged(BtLEQueue.java:369)
This release seems to be working quite well with respect to the firmware upgrading itself. The user facing part needs more work.
In order to update the firmware one has to:
- open a file ending with .fw
- switch from the firmware upgrade activity to the main one
- connect to the miband
- return to the firmware upgrade activity
- press the "install" button (that became active when the device connection was established)
Caveats:
There are almost no check wrt. the integrity of the firmware files.