1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-11 07:54:03 +02:00
Commit Graph

10818 Commits

Author SHA1 Message Date
kuhy
b92e1ff947 Garmin protocol: add AGPS data checks 2024-05-03 16:41:01 +02:00
kuhy
00faf1be6b Garmin protocol: install AGPS data as firmware 2024-05-03 16:40:59 +02:00
kuhy
e97d699c6f Garmin protocol: improve detection of successfully sent files (DataTransferHandler) 2024-05-03 16:38:37 +02:00
kuhy
13cf48a6c5 Garmin protocol: add support for AGPS data retrieval 2024-05-03 16:38:37 +02:00
Daniele Gobbetti
2bfbb75c0b Fixup: Introduce device specific writable directory (MAC address)
Add logic to not fetch again files which had the previously defined name
2024-05-03 12:22:15 +02:00
Daniele Gobbetti
598549b1f5 Introduce device specific writable directory (MAC address)
Also adds temporary method to move the fetched files from the legacy path to the new one which does not include the device name.
Also moves the FileIndex to the end of the cached files to allow for easier sorting.

Cherry-picked from 525b395c01ce57449ee9a8f74af663595223279e and adapted
2024-05-03 10:27:00 +02:00
José Rebelo
7dcefd1815 Garmin: Make fit header crc optional 2024-05-03 09:51:44 +02:00
Daniele Gobbetti
f932dabc72 Garmin: enable unicode Emoji for all devices
This seems to be widely supported by garmin devices, hence enable it in the base coordinator. Specific devices not supporting Unicode Emojis can override this method and return false.
2024-05-03 09:45:04 +02:00
Daniele Gobbetti
36911b890f Garmin: harmonize device names
All device name strings start with manufacturer name.
Normalized the usage of accented i.
2024-05-03 09:36:36 +02:00
Andreas Schneider
1a07ad8ff1 Garmin: add coordinator for Instinct Crossover 2024-05-03 09:34:34 +02:00
Daniele Gobbetti
19095caa6e Garmin: fix regression in call handling
Add a fictitious action to the notification to enable reply/hangup/reject from the watch.
Also fixes the behavior on sms reply, which should also reject the incoming call.

Change the log level in case some of the canned messages types are left as default to info, as this is a supported scenario.
2024-05-03 09:30:38 +02:00
Daniele Gobbetti
533ce0441f Garmin: encode unknown weather codes as invalid 2024-05-01 16:51:56 +02:00
meskio
586d792cc9 Initial support for Garmin Instinct Solar 2024-04-29 18:05:39 +02:00
José Rebelo
b78bc30a53 Garmin: Improve fit parsing
* Remove the dependency on PredefinedLocalMessage from generic fit parsing code
* Standardize toString methods, omit types for known fields
* Return null on unknown field number or names, instead of crashing
* Map more Global FIT messages (device info, monitoring, sleep stages, sleep stats, stress level)
* Prioritize "timestamp" over "253_timestamp" if specified explicitly in the global message definition
* Introduce RecordData wrappers for each global message, allowing us to have proper types when getting data. If missing or unknown, the getter returns null. All classes are auto-generated by the FitCodeGen.
* Persist a list of RecordData, instead of a Map from RecordDefinition
* Fix parsing of compressed timestamps - keep them in computedTimestamp on each data record
* Use timestamp16 if available in Monitoring records
2024-04-29 18:01:05 +02:00
Daniele Gobbetti
d44fd4ab61 Garmin: add coordinator for Instinct 2 Solar Tactical
confirmed working in https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/3063#issuecomment-1787762
2024-04-29 18:01:05 +02:00
José Rebelo
e061eecde4 Garmin: Send location to watch 2024-04-29 18:01:05 +02:00
Daniele Gobbetti
8840727228 Garmin: calendar integration improvements
use the protobuf fields described in the documentation[0]
build the message according to the requested fields

[0] https://gadgetbridge.org/internals/specifics/garmin-protocol/#calendarevent
2024-04-29 18:01:05 +02:00
a0z
b9bb9f2023 Garmin: Initial support of Instinct 2 Solar 2024-04-29 18:01:05 +02:00
Daniele Gobbetti
6759881247 Garmin: fix notification crashes and handle SMS correctly
It looks like (some) watches really don't like having an empty list of actions, hence enable the legacy "refuse" action in every case, leaving it empty and inactive.
Further display the SMS sender in the notification and enable the correct code path for the reply action to work.
2024-04-29 18:01:05 +02:00
José Rebelo
06287ea081 Garmin: Auto-detect canned messages support 2024-04-29 18:01:05 +02:00
José Rebelo
fc3d4102f3 Garmin: Fix reply to sms 2024-04-29 18:01:05 +02:00
José Rebelo
278c2d4c12 Garmin: Add setting to disable notifications 2024-04-29 18:01:05 +02:00
José Rebelo
44aea4e0a8 Garmin Venu 3: Enable canned replies 2024-04-29 18:01:05 +02:00
Daniele Gobbetti
1d3f2cc848 Garmin: use developer device setting for keeping data on device
Make use of the previously added preference to toggle file archival (deletion) on the watch.

Default is true (keep data on device) until we are sure of the consequences.
2024-04-29 18:01:05 +02:00
José Rebelo
d3c7df9688 Garmin: Map all known files types 2024-04-29 18:01:05 +02:00
José Rebelo
1e751c16fc Garmin: Add support for http weather requests 2024-04-29 18:01:05 +02:00
Daniele Gobbetti
10474bb568 Garmin: Rename LocalMessage to PredefinedLocalMessage and clarify its usage
PredefinedLocalMessage are only useful for FIT messages and should not interfere with FIT files. The only impact of using the local message in fit files was in the textual output, but it was confusing.

Add an explicit constructor to RecordHeader if PredefinedLocalMessage should be taken into account, and use this only in fit messages leaving the default constructor for fit files.

Also adjusts the test case as textual output comparison needs to be fixed.
2024-04-29 18:01:05 +02:00
kuhy
a4a631816f Initial support for Garmin Vivoactive 4S 2024-04-29 18:01:05 +02:00
Daniele Gobbetti
e8eb1a906a Garmin: Add support for custom replies (notifications and calls)
To enable custom replies an override must be defined in the devices coordinator that actually support custom replies.

The custom preferences allow to:
- enable / disable the default message suffix (Instinct 2 appends "sent from my $vendor device" to each reply by default)
- define custom messages to reply to calls and incoming messages (leaving those lists empty will enable the default messages to be used)

Also adds a new protobuf definition file of mostly unknown values that enable toggling the message suffix on Instinct 2.
2024-04-29 18:01:05 +02:00
myxor
00dddca911 Initial support for Garmin Vivoactive 5 2024-04-29 18:01:05 +02:00
Daniele Gobbetti
eb49523524 Garmin: Add support for replying to notifications
This uses the (assumed) new method of passing multiple actions, instead of the (assumed) legacy accept/decline approach.
At the moment the preset messages stored on the watch firmware are used for replying, the code supports using custom messages already but those have to be updated to the watch somehow (probably by protobuf) and this is not supported yet. Using custom messages if they are not set will just do nothing.
The NotificationActionIconPosition values have been determined on a vívomove Style and might not work properly on other watches.
The evaluation of GBDeviceEvent have been moved in GarminSupport since the notification actions handling uses device events.

Also adds a method to read null terminated strings to GarminByteBufferReader.
Also adds a warning in NotificationListener if the wrong handle is used for replying to a notification.
2024-04-29 18:01:05 +02:00
Daniele Gobbetti
13d189b42a Garmin: Add FileDownloadedDeviceEvent and (disabled) file deletion
Also adds (disabled) file deletion in case of already downloaded files
2024-04-29 18:01:05 +02:00
Daniele Gobbetti
84ff24253d Garmin: Add DST/Timezone support 2024-04-29 18:01:05 +02:00
hrdl
91b8a00954 Add Garmin Forerunner 245 2024-04-29 18:01:05 +02:00
Daniele Gobbetti
b25331e35f Garmin: Support file archival (deletion) on watch
Also add original timestamp to local cache filename as the file identifier are reused
Also fix imports of Test class
2024-04-29 18:01:05 +02:00
José Rebelo
aeb0b9b885 Garmin: Fetch activity on demand 2024-04-29 18:01:05 +02:00
José Rebelo
62483614a9 Garmin: Fix proguard rules for release builds 2024-04-29 18:01:05 +02:00
José Rebelo
6220a688d2 Garmin: Allow high MTU 2024-04-29 18:01:04 +02:00
José Rebelo
f1930a5ac6 Garmin protocol: Simplify FILE_TYPE 2024-04-29 18:01:04 +02:00
José Rebelo
c2670c0f70 Garmin protocol: Fix linter warnings 2024-04-29 18:01:04 +02:00
José Rebelo
8837832903 Garmin protocol: Introduce GarminCoordinator 2024-04-29 18:01:04 +02:00
José Rebelo
453c9b74d1 Garmin protocol: fix crash when stopping find phone 2024-04-29 18:01:04 +02:00
Daniele Gobbetti
c2ec3120d3 Garmin protocol: basic file transfer and notification handling
adds synchronization of supported files from watch to external directory
adds support for Activity and Monitoring files (workouts and activity samples), but those are not integrated yet
adds upload functionality (not used ATM and not tested)
adds notification support without actions
introduces centralized processing of "messageHandlers" (protobuf, file transfer, notifications)

also properly dispose of the music timer when disconnecting
2024-04-29 18:01:04 +02:00
Daniele Gobbetti
0392ed27e3 Garmin protocol: enable media volume control from watch 2024-04-29 18:01:04 +02:00
Daniele Gobbetti
f13bc320ee Garmin protocol: store max packet size from DeviceInformationMessage
also adds messageType to the warnifleftover log message
2024-04-29 18:01:04 +02:00
Daniele Gobbetti
4fd9de2bab Garmin protocol: various changes
- add FitFile class that deals with parsing and generating outgoing files
- consider all field definitions with number 253 as Timestamps [0]
- add support for "compressed timestamps" in fit file parsing. Those are not returned among the other normal fields but are available through a method of RecordData
- adjust the test cases

[0]48b6554d8a/fitdecode/reader.py (L719)
2024-04-29 18:01:04 +02:00
Daniele Gobbetti
0b858c2919 Garmin protocol: change naming and logic of several FIT classes
- refactor the logic of Global and Local messages
- add some Global messages with naming taken from [1]
- Global messages are not enum because there are too many
- introduce the concept of FieldDefinitionPrimitive
- add new Field Definitions
- add support for developer fields and array fields
- add test case for FIT files taken from [0]

[0] https://github.com/polyvertex/fitdecode/
[1] https://www.fitfileviewer.com/
2024-04-29 18:01:04 +02:00
Daniele Gobbetti
b89079b20f Garmin protocol: create helper class GarminByteBufferReader
separate the logic specific for GFDI messages from the generally useful logic.
Also centralize the logging in case of leftover bytes while parsing GFDI messages.
2024-04-29 18:01:04 +02:00
Daniele Gobbetti
48a65f30f5 Garmin protocol: create custom GBDeviceEvent for weather request 2024-04-29 18:01:04 +02:00
Daniele Gobbetti
5317d29d40 Garmin protocol: use message enum instead of id in GFDI Messages 2024-04-29 18:01:04 +02:00