garmin: add experimental support for In Reach Mini 2

This commit is contained in:
Thomas Kuehne
2025-09-07 14:53:42 +02:00
committed by José Rebelo
parent 37de59fa4b
commit f5eb4a5feb
4 changed files with 68 additions and 2 deletions
@@ -0,0 +1,63 @@
/* Copyright (C) 2025 Thomas Kuehne
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.garmin.gps;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.GarminCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class GarminInReachMini2 extends GarminCoordinator {
@Override
public int getBatteryCount(final GBDevice device) {
return 1;
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_garmin_inReach_mini_2;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("^inReach Mini 2$");
}
@Override
public boolean isExperimental() {
return true;
}
@Override
public boolean supportsActivityDataFetching(final GBDevice device) {
// for gps tracks
return true;
}
@Override
public boolean supportsActivityTracks(final GBDevice device) {
return true;
}
@Override
public boolean supportsOSBatteryLevel(GBDevice device){
// uses standard Bluetooth battery level updates
// Garmin's RemoteDeviceBatteryStatusRequest isn't supported
return true;
}
}
@@ -91,8 +91,8 @@ public class BluetoothStateChangeReceiver extends BroadcastReceiver {
return; return;
} }
if (gbDevice.getState() != GBDevice.State.INITIALIZED) { if (!gbDevice.isConnected()) {
LOG.info("gbDevice {} not initialized, ignoring incoming battery information.", gbDevice); LOG.info("gbDevice {} not connected, ignoring incoming battery information.", gbDevice);
return; return;
} }
@@ -65,6 +65,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.garmin.bike.GarminEdge130Plu
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.bike.GarminEdge540Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.bike.GarminEdge540Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.bike.GarminEdgeExplore2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.bike.GarminEdgeExplore2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.gps.GarminETrexSeCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.gps.GarminETrexSeCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.gps.GarminInReachMini2;
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.hrm.GarminHrm200Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.hrm.GarminHrm200Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.descent.GarminDescentMk3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.descent.GarminDescentMk3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.enduro.GarminEnduro3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.enduro.GarminEnduro3Coordinator;
@@ -606,6 +607,7 @@ public enum DeviceType {
GARMIN_FORERUNNER_955(GarminForerunner955Coordinator.class), GARMIN_FORERUNNER_955(GarminForerunner955Coordinator.class),
GARMIN_FORERUNNER_965(GarminForerunner965Coordinator.class), GARMIN_FORERUNNER_965(GarminForerunner965Coordinator.class),
GARMIN_SWIM_2(GarminSwim2Coordinator.class), GARMIN_SWIM_2(GarminSwim2Coordinator.class),
GARMIN_INREACH_MINI_2(GarminInReachMini2.class),
GARMIN_INSTINCT(GarminInstinctCoordinator.class), GARMIN_INSTINCT(GarminInstinctCoordinator.class),
GARMIN_INSTINCT_SOLAR(GarminInstinctSolarCoordinator.class), GARMIN_INSTINCT_SOLAR(GarminInstinctSolarCoordinator.class),
GARMIN_INSTINCT_TACTICAL(GarminInstinctTacticalCoordinator.class), GARMIN_INSTINCT_TACTICAL(GarminInstinctTacticalCoordinator.class),
+1
View File
@@ -1901,6 +1901,7 @@
<string name="devicetype_garmin_fenix_7x_pro" translatable="false">Garmin Fenix 7X Pro</string> <string name="devicetype_garmin_fenix_7x_pro" translatable="false">Garmin Fenix 7X Pro</string>
<string name="devicetype_garmin_fenix_8" translatable="false">Garmin Fenix 8</string> <string name="devicetype_garmin_fenix_8" translatable="false">Garmin Fenix 8</string>
<string name="devicetype_garmin_descent_mk3" translatable="false">Garmin Descent Mk3</string> <string name="devicetype_garmin_descent_mk3" translatable="false">Garmin Descent Mk3</string>
<string name="devicetype_garmin_inReach_mini_2" translatable="false">inReach Mini 2</string>
<string name="devicetype_garmin_instinct" translatable="false">Garmin Instinct</string> <string name="devicetype_garmin_instinct" translatable="false">Garmin Instinct</string>
<string name="devicetype_garmin_instinct_solar" translatable="false">Garmin Instinct Solar</string> <string name="devicetype_garmin_instinct_solar" translatable="false">Garmin Instinct Solar</string>
<string name="devicetype_garmin_instinct_2" translatable="false">Garmin Instinct 2</string> <string name="devicetype_garmin_instinct_2" translatable="false">Garmin Instinct 2</string>