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

10785 Commits

Author SHA1 Message Date
a0z
3ac478e163 Garmin: Initial support of Instinct 2 Solar 2024-04-25 09:25:39 +00:00
Daniele Gobbetti
b345e41db0 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-25 11:18:51 +02:00
José Rebelo
28984d9152 Garmin: Auto-detect canned messages support 2024-04-25 08:07:21 +00:00
José Rebelo
e839a6d197 Garmin: Fix reply to sms 2024-04-25 08:07:21 +00:00
José Rebelo
42fa8ffaed Garmin: Add setting to disable notifications 2024-04-25 08:07:21 +00:00
José Rebelo
5865dc9650 Garmin Venu 3: Enable canned replies 2024-04-25 08:07:21 +00:00
Daniele Gobbetti
baec9b3040 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-24 10:11:23 +02:00
José Rebelo
438bfa4cce Garmin: Map all known files types 2024-04-23 20:06:51 +01:00
José Rebelo
13c72d827f Garmin: Add support for http weather requests 2024-04-23 20:06:50 +01:00
Daniele Gobbetti
1a120bcd50 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-23 16:39:59 +02:00
kuhy
9b27a71328 Initial support for Garmin Vivoactive 4S 2024-04-23 16:13:39 +02:00
Daniele Gobbetti
ba560a9a4f 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-23 16:11:37 +02:00
myxor
f0efc53d54 Initial support for Garmin Vivoactive 5 2024-04-21 11:12:57 +02:00
Daniele Gobbetti
f127c47fe9 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-20 16:37:50 +02:00
Daniele Gobbetti
4c25ae2d83 Garmin: Add FileDownloadedDeviceEvent and (disabled) file deletion
Also adds (disabled) file deletion in case of already downloaded files
2024-04-19 17:07:27 +02:00
Daniele Gobbetti
b2d6f4492a Garmin: Add DST/Timezone support 2024-04-19 16:45:58 +02:00
hrdl
1a9fe65a52 Add Garmin Forerunner 245 2024-04-19 13:07:56 +02:00
Daniele Gobbetti
9cc5635474 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-18 17:57:05 +02:00
José Rebelo
be66a73fd1 Garmin: Fetch activity on demand 2024-04-18 17:57:02 +02:00
José Rebelo
930bd208ae Garmin: Fix proguard rules for release builds 2024-04-18 17:50:17 +02:00
José Rebelo
6074406ccc Garmin: Allow high MTU 2024-04-18 17:50:17 +02:00
José Rebelo
c710f92dc0 Garmin protocol: Simplify FILE_TYPE 2024-04-18 17:50:17 +02:00
José Rebelo
7afb85ba03 Garmin protocol: Fix linter warnings 2024-04-18 17:50:17 +02:00
José Rebelo
4a15e1aa92 Garmin protocol: Introduce GarminCoordinator 2024-04-18 17:50:17 +02:00
José Rebelo
2dd6859648 Garmin protocol: fix crash when stopping find phone 2024-04-18 17:50:17 +02:00
Daniele Gobbetti
7829c5f1fb 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-18 17:50:17 +02:00
Daniele Gobbetti
5a273c1118 Garmin protocol: enable media volume control from watch 2024-04-18 17:50:17 +02:00
Daniele Gobbetti
2473ae2f52 Garmin protocol: store max packet size from DeviceInformationMessage
also adds messageType to the warnifleftover log message
2024-04-18 17:50:17 +02:00
Daniele Gobbetti
f94299fcc1 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-18 17:50:16 +02:00
Daniele Gobbetti
f05b7f44a9 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-18 17:50:16 +02:00
Daniele Gobbetti
fc5b8c5641 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-18 17:50:16 +02:00
Daniele Gobbetti
944b1025c2 Garmin protocol: create custom GBDeviceEvent for weather request 2024-04-18 17:50:16 +02:00
Daniele Gobbetti
e81404379e Garmin protocol: use message enum instead of id in GFDI Messages 2024-04-18 17:50:16 +02:00
Daniele Gobbetti
cebcd24c68 Garmin protocol: refactoring and fixes of BaseTypes
The boundaries are enforced on the stored value when decoding, before applying the adjustments for scale and offset.
Also add some tests for the BaseTypes
Introduce new FieldDefinition for Temperature and WeatherCondition (removing the static class)
Add accessors for field data in the containing RecordData, thus keeping the FieldData private
2024-04-18 17:50:16 +02:00
Daniele Gobbetti
1d8cd7dd1e Garmin protocol: create specific field definition for day of week 2024-04-18 17:50:16 +02:00
Daniele Gobbetti
1f7f502fe9 Garmin protocol: move field encode/decode interface to the FieldDefinition
This allows for semantic subclassing the FieldDefinition.
A FieldDefinitionTimestamp subclass is introduced as example
2024-04-18 17:50:16 +02:00
Daniele Gobbetti
d00b94f333 Garmin protocol: fix invalid signed int base type value 2024-04-18 17:50:16 +02:00
Daniele Gobbetti
16354d333e Garmin protocol: add initial support for FIT messages
note: only weather message definition and data tested so far
also enable weather support for Instinct 2S and vivomove style
also cleanup some unused constants that have been migrated to new enums in GFDIMessage
additionally switch to new local implementation of GarminTimeUtils with needed methods
2024-04-18 17:50:16 +02:00
Daniele Gobbetti
8107002a87 Garmin protocol: fixes
- fix DEVICE_SETTINGS message ID
- put all status messages in own package
- allow protobuf handler to change the returned status message to signal unsupported requests
- fix various bugs
2024-04-18 17:50:16 +02:00
Daniele Gobbetti
f1111d3790 Garmin protocol: initial refactoring and basic functionalities
This commit takes aims to bring many new garmin devices up to a working status, with basic functionalities such as:
- garmin protocol initialization
- basic message exchange
- support for some messages in Garmin own format
- support for some messages in protobuf format
2024-04-18 17:50:15 +02:00
Arjan Schrijver
a2c861f66c Add preference for hiding bottom navigation bar 2024-04-17 21:58:23 +02:00
Damien 'Psolyca' Gaignon
4059566a25
[Huawei] Fix notification length 2024-04-16 23:10:01 +02:00
José Rebelo
c0d0b4dfbe Update hamcrest-library to 2.2 2024-04-15 23:45:55 +01:00
José Rebelo
bf01d9b346 Update protobuf dependencies 2024-04-15 22:04:45 +01:00
Damien 'Psolyca' Gaignon
84070dd0ba
[Huawei] Fix TimeZone offset calculation 2024-04-15 21:37:57 +02:00
Alik Aslanyan
f0a9ab7f98 Add Armenian transliteration 2024-04-15 19:58:27 +04:00
José Rebelo
9ae02f65ed Zepp OS: Change settings category to "calls and notifications" 2024-04-13 15:11:39 +01:00
Arjan Schrijver
523d02ae7f Generalize auto-pickup and read-notifications-aloud features 2024-04-13 14:10:54 +00:00
José Rebelo
717789dc48 Fix receiving shared gpx files 2024-04-13 13:55:25 +01:00
José Rebelo
320fccbaae Xiaomi: Fix crash when deleting last widget screen 2024-04-12 22:41:11 +01:00