Commit Graph
100 Commits
Author SHA1 Message Date
Thomas KuehneandJosé Rebelo 01ff179071 ble: adjust TransactionBuilder's MTU logging 2025-10-14 23:27:36 +02:00
Thomas Kuehne 4355236799 ble: prepare evenrealities for online chunking PR
Adjust G1DeviceSupport and G1SideManager to limit the impact of #5218
2025-10-14 21:09:13 +02:00
Thomas KuehneandJosé Rebelo c8f6b8cfaf GxpParser: extraction more waypoint and trackpoint data (#5465) 2025-10-12 23:50:37 +02:00
Thomas KuehneandJosé Rebelo 3fd826cd79 fix: unescaped' and " as well as white space sequences in string.xml
https://developer.android.com/guide/topics/resources/string-resource#FormattingAndStyling
Escape single quotes (') and double quote (").
Unescaped characters are removed by the Android tool chain.

A string contained completely in quotes
   <string>"a b   c"</string>
triggers special white space preserving handling (a b   c) instead of the normal white space collapse (a b c).
2025-10-11 23:41:55 +02:00
Thomas KuehneandJosé Rebelo a28ed02534 Garmin: extend FIT file parsing 14 - COURSE_POINT 32 / type 4
based on https://github.com/muktihari/fit
2025-10-10 01:01:44 +02:00
Thomas KuehneandJosé Rebelo 89485c76ad GpxTrackPoint: fix NullpointerException in toString 2025-10-10 00:54:50 +02:00
Thomas Kuehne f01f7f7537 GpxParser: improve GPX file detection
Add support for byte order marks (BOM) and UTF-16 big endian / little endian.
2025-10-04 02:24:49 +02:00
Thomas KuehneandJosé Rebelo c265c0892d Garmin: extend FIT file parsing 13 - test Location encoding 2025-10-03 19:42:17 +02:00
Thomas KuehneandJosé Rebelo 36f5c8a31e Garmin: extend FIT file parsing 12 - LOCATION 29 / symbol 3 2025-10-02 20:40:13 +02:00
Thomas KuehneandJosé Rebelo a7d9088cc6 Bluetooth: log bond loss on API 36.1 / Android 16 QPR2 2025-10-01 21:31:26 +02:00
Thomas Kuehne 933ba53a65 Garmin: extend FIT file parsing 11 - DEVICE_STATUS 104 / battery_level 2
Persist the gadget's battery level encoded in FitDeviceStatus.getBatteryLevel.
ACTIVITY FIT files seem to frequently use this.
2025-09-30 19:42:48 +02:00
Thomas Kuehne 94279f388a Garmin: extend FIT file parsing 10 2025-09-29 16:15:40 +02:00
Thomas Kuehne bed17b4a17 Garmin: extend FIT file parsing 9 2025-09-28 19:16:00 +02:00
Thomas Kuehne 4e915647d1 Garmin: extend FIT file parsing 8 - sports 2025-09-27 17:57:29 +02:00
Thomas KuehneandJosé Rebelo f03ac358fa ble: standardize server actions (#5157) 2025-09-26 22:39:53 +02:00
Thomas KuehneandJosé Rebelo 643fc0c7ef Garmin: extend FIT file parsing 7 2025-09-24 00:19:57 +02:00
Thomas Kuehne 76d16b6829 Garmin: extend FIT file parsing 6 2025-09-23 14:39:49 +02:00
Thomas KuehneandJosé Rebelo faa00faafb Garmin: extend FIT file parsing 5 2025-09-22 20:22:54 +02:00
Thomas Kuehne d61292b831 Gradle: housekeeping update to improve build performance 2025-09-22 19:06:35 +02:00
Thomas Kuehne ca081c062f Garmin: extend FIT file parsing 4 2025-09-21 15:24:05 +02:00
Thomas KuehneandJosé Rebelo 0e5c493cea Garmin: add debug support to fetch the DEVICE_XML
`Debug / Fetch device Debug Logs` now fetches the FILETYPE.DEVICE_XML instead of triggering a normal fetch.
On some devices this file is readily available via USB on others this is the only way to retrieve it.

Note:
The features listed in DEVICE_XML and device.fit sometimes differ substantially and don't necessarily reflect the supported features.
So far there is no known way to retrieve device.fit via Bluetooth.
2025-09-20 22:34:06 +02:00
Thomas Kuehne ddf008327c Garmin: prepare for more complex FIT upload scenarios 2025-09-19 22:28:31 +02:00
Thomas KuehneandJosé Rebelo 7f5a6e7f93 Garmin: extend FIT file parsing 3
The encoding of some BIKE_PROFILE fields has changed over the years (UINT8 vs ENUM). Use the modern encoding.
2025-09-19 21:47:25 +02:00
Thomas Kuehne ba70067aad Garmin: update FILETYPE comments and names
SLP_DISR is present on various devices (folder SlpDisr) and seems to stand for sleep disruptions.
2025-09-19 19:18:55 +02:00
Thomas KuehneandJosé Rebelo b1323b6fd1 Garmin: extend FIT file parsing 2 2025-09-18 21:13:36 +02:00
Thomas KuehneandJosé Rebelo 24fbbe854c Garmin: more targeted log for unknown message type
old log output:
n.f.g.s.d.g.m.GFDIMessage - Unknown message type 5023, message [12, 0, -97, 19, 50, -7, -1, -1, -1, -1, 50, 64]
n.f.g.s.d.g.m.GFDIMessage - Leftover bytes when parsing message type 5023. Bytes: 32F9FFFFFFFF, complete message: 0C009F1332F9FFFFFFFF3240

new log output:
n.f.g.s.d.g.m.GFDIMessage - Unknown message type 5023. Bytes: 32F9FFFFFFFF
2025-09-16 21:06:02 +02:00
Thomas Kuehne 47e7ef7e33 Garmin: update our ConfigurationMessage payload 2025-09-16 20:59:07 +02:00
Thomas KuehneandJosé Rebelo 62d458255b Garmin: add the "Unit ID" (device serial number) to the device details 2025-09-16 20:44:20 +02:00
Thomas KuehneandJosé Rebelo b12fd1027f Garmin: add FILETYPE 8/255 (device XML) 2025-09-16 20:44:09 +02:00
Thomas KuehneandJosé Rebelo 80aeaead1a garmin: extend FIT file parsing (#5339)
This updates the parser to interpret more FIT information and display it in the FIT file viewer.
Actually using the available information isn't part of this PR.
2025-09-16 20:12:52 +02:00
Thomas Kuehne 1becb9f6b3 btle+btbr: remove deprecated methods
DeviceSupports in master already use the modern methods.
DeviceSupports outside of the master branch either already use the modern methods or have know fix-ups (#5318).
2025-09-14 18:04:06 +02:00
Thomas Kuehne 1507553247 Garmin: HRM-Pro Plus - native support (#5353) 2025-09-14 16:49:15 +02:00
Thomas KuehneandJosé Rebelo 71116173f8 strings: Bluetooth is a proper name 2025-09-14 14:00:31 +02:00
Thomas KuehneandJosé Rebelo d414ae17b1 fix: NullPointerException in DeviceSpecificSettingsFragment.setChangeListener
Add a "CMF Watch Pro 2" test device manually and then open device specific settings results in following exception because supportedLanguages is null:

Uncaught exception in mainjava.lang.NullPointerException: Attempt to get length of null array
at nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsFragment.setChangeListener(DeviceSpecificSettingsFragment.java:419)
at nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsFragment.onCreatePreferences(DeviceSpecificSettingsFragment.java:244)
at androidx.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:161)
at nodomain.freeyourgadget.gadgetbridge.activities.AbstractPreferenceFragment.onCreate(AbstractPreferenceFragment.java:81)
2025-09-11 20:16:35 +02:00
Thomas Kuehne fc03ac11aa Garmin: fix NullPointerException in getActivityKind 2025-09-07 17:54:00 +02:00
Thomas KuehneandJosé Rebelo f5eb4a5feb garmin: add experimental support for In Reach Mini 2 2025-09-07 14:53:42 +02:00
Thomas Kuehne 06925b2384 garmin: add missing DAOs to getAllDeviceDao 2025-09-07 10:58:12 +02:00
Thomas Kuehne eba83f93ad change daily sleep goal from hours to minutes (#1312) 2025-08-31 10:27:24 +02:00
Thomas KuehneandJosé Rebelo e112a51c1e garmin: add FitDebug to improve logging of unsupported global field numbers 2025-08-27 19:44:46 +02:00
Thomas Kuehne 0500a6ee41 zip backup: add zip archive comment to ease human identification
example comment:
data export from Android application nodomain.freeyourgadget.gadgetbridge version 0.86.1 from 2025-08-26T23:59:45Z
2025-08-26 22:47:13 +02:00
Thomas KuehneandJosé Rebelo 0f54f2c6e0 zip backup: sort the external files by name to improve comparability 2025-08-26 22:02:07 +02:00
Thomas KuehneandJosé Rebelo 42033aad18 ultrahuman: redesign device support 2025-08-26 21:38:51 +02:00
Thomas KuehneandJosé Rebelo f5e015ff57 ui: optionally disable fetching new data from connected devices when swiping down
1) add new preference Settings / User interface / refresh on swipe
2) adjusted ControlCenterv2, AbstractChartsActivity and WorkoutListActivity
2025-08-26 21:17:04 +02:00
Thomas KuehneandJosé Rebelo 805bc35299 ui: use app:useSimpleSummaryProvider="true" instead of android:summary="%s"
fixes ListPreference's logcat warning:
`Setting a summary with a String formatting marker is no longer supported. You should use a SummaryProvider instead.`

https://developer.android.com/develop/ui/views/components/settings/customize-your-settings#summaries
2025-08-25 22:03:45 +02:00
Thomas KuehneandJosé Rebelo deef1c9d12 device settings: use icons / use more specific icons 2025-08-18 11:31:30 +02:00
Thomas KuehneandJosé Rebelo 5b1a4b237b WeightScale: add btle profile and generic device coordinator / device support (#5225)
Adds support for receiving weights from standard Bluetooth Weight scales:
0000181d-0000-1000-8000-00805f9b34fb - org.bluetooth.service.weight_scale
00002a9d-0000-1000-8000-00805f9b34fb - org.bluetooth.characteristic.weight_measurement
https://www.bluetooth.com/specifications/specs/weight-scale-service-1-0-1/
2025-08-18 11:23:52 +02:00
Thomas Kuehne be12a9d794 ble: add new Bluetooth standard mapping to BleNamesResolver 2025-08-17 19:21:45 +02:00
Thomas KuehneandJosé Rebelo 78b78de8e6 delete export files when deleting a device (#5216) 2025-08-14 23:08:14 +02:00
Thomas Kuehne 3b5ea9bf7f weather: try to reduce risk of TransactionTooLargeException 2025-08-14 09:49:32 +02:00
Thomas Kuehne 21a272cd74 weather: add compressed WeatherGz support to ACTION_GENERIC_WEATHER (#5239)
When receiving the broad cast action `nodomain.freeyourgadget.gadgetbridge.ACTION_GENERIC_WEATHER`

Try to decode bundle extra `WeatherGz` (ByteArray containing GZiped UTF-8 encoded JSON array of weather specifications) first.
If not present fall back to bundle extras `WeatherJson`  (String containing one JSON weather specification) and optional `WeatherSecondaryJson` (String containing JSON array of weather specifications).
2025-08-14 08:35:03 +02:00
Thomas Kuehne 32204ce606 debug: enable sharing an existing log file even if file logging is currently disabled (#4659) 2025-08-12 21:12:36 +02:00
Thomas Kuehne 00d3e9b23d implement getAllDeviceDao to enable device specific database exports (#5230) 2025-08-12 11:43:07 +02:00
Thomas KuehneandJosé Rebelo 111b705963 add missing @Override annotations 2025-08-11 21:41:25 +02:00
Thomas Kuehne bb710bae92 fix: BatteryInfoProfile complaining about unexpected characteristics 2025-08-10 18:16:58 +02:00
Thomas Kuehne 6966f80f3d ble: use UUID version of TransactionBuilder.read/write/notify (#5222)
Using the UUID version instead of BluetoothGattCharacteristic version ensures that, if a characteristic is missing on the gadget GB actually logs what characteristic is missing.
2025-08-09 18:05:22 +02:00
Thomas Kuehne 5fa2372fce DeviceCoordinator: add missing device argument and @NonNull annotation for all supports[...] methods (#5214) 2025-08-09 11:17:10 +02:00
Thomas Kuehne 696a7c73a5 ble: improve error logging in TransactionBuilder.notify(UUID, boolean) 2025-08-06 05:10:50 +02:00
Thomas Kuehne 3ba16cb38e icons: refresh further icons from the "Material Symbols" set 2025-08-05 22:21:19 +02:00
Thomas KuehneandJosé Rebelo 5d9d547250 icons: add icons for Settings / Automations 2025-08-05 21:44:29 +02:00
Thomas KuehneandJosé Rebelo 6634302353 implement getAllDeviceDao to delete device specific data when deleting the device 2025-08-05 21:40:21 +02:00
Thomas KuehneandJosé Rebelo 9ef4a5881a icons: use distinctive icons for weather and package names 2025-08-03 23:40:07 +02:00
Thomas KuehneandJosé Rebelo cff19b3959 icons: use a distinctive icon for track color 2025-08-03 23:39:55 +02:00
Thomas KuehneandJosé Rebelo 9d110b99eb icons: use a material icon for "donation" 2025-08-03 23:39:44 +02:00
Thomas KuehneandJosé Rebelo a38d9056d4 strings: use standardized straight quotes " and en dash – (#5112)
also cleanup left-over quotes " from string.xml creation
2025-08-03 23:37:07 +02:00
Thomas KuehneandJosé Rebelo d5d2d3d3be icons: refresh icons from the "Material Symbols" set 2025-07-30 23:54:32 +02:00
Thomas KuehneandJosé Rebelo a28603be87 icons: add icons to Settings / User interface 2025-07-29 20:59:20 +02:00
Thomas KuehneandJosé Rebelo bba747cb6c ui: optionally prevent screen shots and insecure displays (#5166)
Introduce new Settings / User interface / Screenshots to optionally prevent screenshots and viewing on non-secure displays.
Toggling this setting requires a GB restart to become fully effective.
2025-07-29 20:57:27 +02:00
Thomas Kuehne 28e39edea1 settings: fix a potential resource leak 2025-07-29 08:24:50 +02:00
Thomas KuehneandJosé Rebelo b2e9a468bf log: add severity DEBUG to GB.log 2025-07-28 21:15:19 +02:00
Thomas KuehneandJosé Rebelo ff29112eac ble: improve logging WriteAction failures when using SDK < 33 2025-07-28 10:53:05 +02:00
Thomas KuehneandJosé Rebelo 8905fb9eb3 ble: use calcMaxWriteChunk instead of MTU-3 (#5156)
Starting with version 14 Android tries to negotiate MTU 517 when GB requests any MTU > 23.
If the negotiated MTU is larger than 515 the DeviceSupports may try to write 513 or 514 (MTU-3) bytes at once.
Writing more than 512 bytes into a characteristic with one BLE write action is always going to fail (Bluetooth specification).
2025-07-27 22:08:53 +02:00
Thomas KuehneandJosé Rebelo 7a30829bb6 ble+bt: use common time format for logging actions 2025-07-27 22:00:50 +02:00
Thomas KuehneandJosé Rebelo 7bee3aa8c7 ble: reduce exposure to BtLEAction subclasses 2025-07-27 11:54:17 +02:00
Thomas KuehneandJosé Rebelo 9de76bafef garmin: fix getDeviceNameResource value for Fenix 3 2025-07-26 20:23:42 +02:00
Thomas KuehneandJosé Rebelo 8794e11720 ble: MTU handling in TransactionBuilder including MTUs > 515 (#5146)
This is especially relevant for Android 14
https://developer.android.com/about/versions/14/behavior-changes-all#mtu-set-to-517

AbstractBTLEDeviceSupport.calcMaxWriteChunk:
new function to properly calculate chunk size

TransactionBuilder.writeChunkedData:
if required automatically resize the chunk size

TransactionBuilder.write and TransactionBuilder.writeLegacy:
for now log an error but still attempt to write the data
2025-07-26 10:23:22 +02:00
Thomas KuehneandJosé Rebelo 11e25b68aa log: use specific log instead of generic GB.log to streamline debugging 2025-07-25 01:25:46 +02:00
Thomas KuehneandJosé Rebelo 741aad0674 log: improve start/finish logging of essential device support threads 2025-07-24 22:40:54 +02:00
Thomas KuehneandJosé Rebelo 556a89b9a8 ble: throw an exception in BtLEQueue.connect if this queue is so broken that it can no longer be re-used 2025-07-22 21:28:43 +02:00
Thomas KuehneandJosé Rebelo a370b00a91 settings: use central GBPrefs.syncTime() instead of custom "datetime_synconconnect" checks 2025-07-22 21:23:42 +02:00
Thomas Kuehne b2d65cce0d garmin: honour the datetime_synconconnect preference instead of hardcoding a time sync for each connection 2025-07-22 20:18:20 +02:00
Thomas KuehneandJosé Rebelo 0b761558bd log: exception handling toast should, if not already logged, log the exception stack trace (#5115) 2025-07-19 16:29:49 +02:00
Thomas Kuehne 23a06dc3fd Ultrahuman: UltrahumanDeviceCoordinator housekeeping update 2025-07-19 01:09:56 +02:00
Thomas Kuehne 35276c5cfd btle+br: switch performConnected/performImmediately to queueConnected/queueImmediately (#5107)
1) replace DeviceSupport's performConnected and performImmediately with TransactionBuilder's queueConnected and queueImmediately - perform* couldn't prevent repeatedly queueing the same transaction
2) improve JavaDoc for btle+br TransactionBuilders
3) improve error handling for btle's TransactionBuilder
2025-07-18 22:27:29 +02:00
Thomas KuehneandJosé Rebelo 9f168fa350 use actual MTU instead of fixed size for TransactionBuilder.writeChunkedData 2025-07-18 19:56:30 +02:00
Thomas Kuehne ae1d5b1f01 btle: fix BtLEQueue.insert concurrency (#5103) 2025-07-18 15:57:30 +02:00
Thomas KuehneandJosé Rebelo 69874ad535 btle+br: use modernized TransactionBuilder methods (#5101) 2025-07-18 00:07:09 +02:00
Thomas Kuehne afd529fbf3 btle+br: remove the queue argument from TransactionBuilder.queue (#5099) 2025-07-15 16:07:17 +02:00
Thomas Kuehne 8daa0178ce ble+btbr: add TransactionBuilder.setProgress (#5098) 2025-07-14 19:04:38 +02:00
Thomas KuehneandJosé Rebelo 7dac462f7d FunctionAction: enhance Transaction.run to streamline one-off actions (#5081) 2025-07-14 00:12:16 +02:00
Thomas Kuehne 78578cc86d btle+br: use DeviceSupport.createTransactionBuilder instead of TransactionBuilder's constructor to prepare for queue isolation 2025-07-13 21:06:04 +02:00
Thomas Kuehne a67613072c asteroidos: fix concurrency issue between initializeDevice and onSetTime 2025-07-13 19:00:33 +02:00
Thomas Kuehne d8a4773c15 ble: use thread safe parameter in onCharacteristic instead of characteristic.getValue 2025-07-12 09:51:50 +02:00
Thomas KuehneandJosé Rebelo fdb1367434 toasts: use Throwable.getLocalizedMessage instead of getMessage 2025-07-11 22:07:04 +02:00
Thomas KuehneandJosé Rebelo 956adf72d9 TransactionBuilder: simplify the writing of single byte values 2025-07-11 22:05:17 +02:00
Thomas Kuehne 0b42950ac9 log when Service.onTimeout gets called for foreground services
GB sometimes gets killed without any obvious cause in gadgetbridge.log. This a companion of PR #5036 to figure out potential causes.
2025-07-10 23:54:05 +02:00
Thomas KuehneandJosé Rebelo 57b39f4e09 ble: use old writeCharacteristic API for writeLegacy
Some vendors customized timing aspects so that the old and new writeCharacteristic calls behave differently.
On vanilla Android there is no difference.
2025-07-10 23:27:33 +02:00
Thomas KuehneandJosé Rebelo de5a1afed1 logging: handle null buffers in GB.hexdump
Enable dumping null buffers like Logging.formatBytes already supports.
2025-07-10 23:26:54 +02:00
Thomas Kuehne a810fa8a36 log: improve logging of Bluetooth adapter changes 2025-07-06 15:05:00 +02:00
Thomas Kuehne 46d3f461e9 Timers: use fixed delay instead of fixed rate
from lint:
Use of scheduleAtFixedRate is strongly discouraged because it can lead to unexpected behaviour when Android processes become cached (tasks may unexpectedly execute hundreds or thousands of times in quick succession when a process changes from cached to uncached).
2025-07-06 09:43:30 +02:00
Thomas KuehneandJosé Rebelo 32e1b8a538 setBusyTask - ensure that busy task names are translated (#5043) 2025-07-05 20:21:45 +02:00