1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-04 16:02:55 +01:00
Commit Graph

233 Commits

Author SHA1 Message Date
Martin.JM
1f1fc33e43 Huawei: Fix BR partial packets
Would crash before. See added test for example.
2024-06-20 22:02:36 +00:00
Martin.JM
72dcb3250e Hauwei: Extend debug request to allow setting the sliced flag 2024-06-18 20:45:38 +00:00
José Rebelo
0e9c709a59 Xiaomi: Ignore activity files without timestamp and version
Some watches will send a sequence of zeroes, which would make activity
fetch become stuck, as the file does not exist.
2024-06-02 21:48:41 +01:00
José Rebelo
f3cc07af27 Garmin: Fix COBS encoding of long non-zero sections 2024-05-24 22:24:09 +02:00
Daniele Gobbetti
c3a6db3309 Garmin: adjust test after adding distance field 2024-05-24 22:24:09 +02:00
José Rebelo
553f6171e6 Garmin: Map all supported workout types 2024-05-24 22:24:09 +02:00
José Rebelo
0b07f36817 Garmin: Persist and display activity
- Steps, hr, intensity
- Sleep stages
- Stress
- SpO2
- Workouts
2024-05-24 22:24:08 +02:00
José Rebelo
92b838f90c Garmin: Fix logging during tests 2024-05-24 22:24:08 +02:00
José Rebelo
1b45d71cc7 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-05-24 22:24:08 +02:00
Daniele Gobbetti
01d48cde91 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-05-24 22:24:08 +02:00
Daniele Gobbetti
42e44de1ac 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-05-24 22:24:07 +02:00
Daniele Gobbetti
6cb5184e2b 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-05-24 22:24:07 +02:00
Daniele Gobbetti
e814a63590 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-05-24 22:24:07 +02:00
Daniele Gobbetti
c8c51064c3 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-05-24 22:24:07 +02:00
Daniele Gobbetti
559a73cc5e 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-05-24 22:24:07 +02:00
Alik Aslanyan
dc1ffdafcd Rework Armenian transliteration to handle more edge cases around mixed letters 2024-05-04 20:45:35 +04:00
Martin.JM
83fd09939f [Huawei] Fix PR #3742, add workout frequency and altitude 2024-05-01 16:32:27 +00:00
José Rebelo
18e08d13da Fix tests and linter 2024-04-30 20:43:23 +01:00
José Rebelo
61af26d7ce Add Serbian transliterator
As discussed in #3727
2024-04-25 17:51:45 +01:00
Daniele Gobbetti
173e2d29b0 Include Organizer and Reminders when reading calendar events
Also use the named column indexes instead of numeric ids when retrieving the contents to make it more clear and more robust in case further fields are added later.

Reminders are set as absolute timestamp.
2024-04-25 11:46:34 +02:00
Alik Aslanyan
f0a9ab7f98 Add Armenian transliteration 2024-04-15 19:58:27 +04:00
Damien 'Psolyca' Gaignon
a29187a034
[Huawei] Fix long notification and clean Notifications class 2024-04-03 23:05:53 +02:00
José Rebelo
0301d0e9a8 Sony Headphones: Merge V3 protocol into V2
The protocols are not actually different - the different messages only
depended on whether the devices supports wind noise reduction or not.
2024-03-15 22:56:11 +00:00
Daniel Dakhno
afe3c1fd50 Testing: fixed unit tests 2024-03-05 00:11:32 +01:00
Andreas Shimokawa
8b9462f521 fix tests 2024-02-12 18:31:48 +01:00
Damien 'Psolyca' Gaignon
ef06fd4d5e
[Huawei] Fix test 2024-02-09 12:03:03 +01:00
Damien 'Psolyca' Gaignon
270212a771
[Huawei] Rename authMode to deviceSupportType 2024-02-09 12:03:01 +01:00
José Rebelo
34fd18885a Zepp OS: Refactor firmware uploads
Zepp OS 3 firmware upgrades are big (200MB+). Gadgetbridge was crashing,
since the entire firmware file would be pulled into memory.

This commit unifies all the logic for Zepp OS firmware handling.

However, since the needed refactor was big, this commit duplicates some
of the code from Huami classes, namely:
- ZeppOsFirmwareUpdateOperation clones UpdateFirmwareOperation2020
- ZeppOsFwInstallHandler clones AbstractMiBandFWInstallHandler

This avoids changes to older device logic and introducing regressions.

Lost functionality:
- Repackaging firmwares as UIHH (does not seem to be needed, and was not
  used anyway). Code can be recovered from this commit if needed in the
  future
- Whitelisted firmwares by checksum (we do not have a lot of them at
  this point anyway)

Other misc changes:
- Rename ZipFile to GBZipFile not to clash with the java class

Tested by updating the Amazfit GTR 4 to Zepp OS 3.
2024-02-01 18:47:28 +00:00
José Rebelo
773132c4e1 Make all Zepp OS classes explicit
There are still some actual "Huami 2021" classes that are used in
non-ZeppOS devices, but this refactor improves the distinction.
2024-01-29 23:30:28 +00:00
José Rebelo
61116c5fc8 Upgrade to gradlew 7.6, mockito-core 2.28.2
Fixes the unit tests after the AGP upgrade from 1a92bcf8a
2024-01-29 18:50:40 +00:00
José Rebelo
5999eb01d0 Nothing CMF Watch Pro: Initial support 2024-01-28 18:46:13 +00:00
Martin.JM
704875c3c2 Update license headers 2024-01-10 18:25:20 +00:00
José Rebelo
9bfe3dcd5f Huawei: Fix tests
- Allow the calendar to be passed as parameter for tests
- Disable the setWearMessage test, for now, broken since 5b0736b751
2024-01-09 17:27:18 +00:00
Damien 'Psolyca' Gaignon
0c22ecdd51
Huawei: Add initial support for Huawei-Honor 2024-01-07 23:18:08 +01:00
mormegil
ec73b244ee Improve ASCII transliterator
We should use NFKD instead of NFD since we are flattening to US-ASCII
afterwards anyway. This allows various Unicode characters which would
end up as a question mark to be represented by their compatibility
decomposition. This applies to e.g. ligatures (e.g. U+FB01 LATIN SMALL
LIGATURE FI will now be replaced with plain fi instead of a question
mark), and also the U+00A0 NO-BREAK SPACE [NBSP] to be replaced by
a normal space instead of a question mark.

+Add Czech fancy quotes to the Czech transliterator
+Add a unit test for Multitransliterator
2023-11-28 18:24:42 +00:00
José Rebelo
096358c76f Fix unit tests 2023-11-25 23:08:02 +00:00
Kornél Schmidt
58a8484322 added test, added to defaultLanguagesIfEnabled 2023-11-25 23:03:30 +00:00
José Rebelo
d66de2f94f Xiaomi: Fix activity file id encoding 2023-11-25 21:16:52 +00:00
José Rebelo
544909a970 Mi Band 8: Activity fetching basics 2023-11-25 21:16:52 +00:00
José Rebelo
3d8ae8596c Fix unit tests 2023-10-28 15:53:47 +01:00
Davis Mosenkovs
77450efb99 Add Common Symbols transliteration 2023-10-07 17:42:52 +03:00
Daniel Dakhno
ef1d38d9d3 Device Manager: replaced getSupportedType with supports method
Huami: introduced getSupportedDeviceName

Huami: implemented getSupportedDeviceName

Huami: fixed typo

Device manager: added error on empty getSupportedDeviceName and empty supports()

Device manager: migrated more devices to getSupportedDeviceName

Device manager: simplified default supports implementation

Device manager: added caching for getSupportedDeviceName pattern

Device manager: added caching DeviceType resolution

Device manager: changed pattern matching find()->matches()

Device manager: use Candidate as caching key

Device manager: more verbose variable initialization

Device manager: fixed typo

Device manager: removed device caching from DeviceHelper

Gradle: removed protoc binary

Device manager: moved more devices to getSupportedDeviceName

Device manager: reduced usages of String.format

Device Vesc: removed multiple device types

Device management: regex improvements

Makibes HR3: fixed device recognition regex
2023-10-05 20:34:53 +00:00
José Rebelo
d1dee47186 Fix tests 2023-10-04 21:58:45 +01:00
Davis Mosenkovs
98df2d1837 Add Latvian transliteration 2023-10-04 00:30:27 +03:00
Daniel Dakhno
b97b26ce3a Device manager: moved device icons and name to Coordinator 2023-09-28 00:11:02 +03:00
José Rebelo
3716d99788 Add test to ensure no duplicated DeviceType keys 2023-08-13 13:56:57 +01:00
hrglpfrmpf
c1fd0b77ad Support for Withings Steel HR (#2831)
Co-authored-by: hrglpfrmpf <hrglpfrmpf@web.de>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2831
Co-authored-by: hrglpfrmpf <hrglpfrmpf@noreply.codeberg.org>
Co-committed-by: hrglpfrmpf <hrglpfrmpf@noreply.codeberg.org>
2023-07-26 17:20:43 +00:00
mormegil
dccb8ed1c4 Changes suggested in PR
- use `BLETypeConversions`, added the missing functions there (+ unit tests for all)
- change Java package of Protobuf definitions so that they are not discarded by Proguard
-- +add subpackages to the Proguard rules so we can subdivide the classes

+ disable device-specific settings for Vivomove (no settings yet)
2023-07-20 20:30:14 +00:00
José Rebelo
bdb904faf9 Fix character mark removal before flattening to ASCII 2023-07-17 22:42:53 +01:00
José Rebelo
853470a2bd Revert "Zepp OS: Unify support class and fw handling"
This reverts commit d59e8c3f62.

We need to refactor the Huami classes too, otherwise this needs a lot of
hacks to work properly.
2023-06-15 21:39:22 +01:00