mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-27 10:07:32 +01:00
Garmin: Add V0 characteristics
As seen in btsnoops from Vivovit / Forerunner 620
This commit is contained in:
parent
a6de977d50
commit
4169c8319a
@ -105,7 +105,8 @@ public class GarminSupport extends AbstractBTLEDeviceSupport implements ICommuni
|
|||||||
|
|
||||||
public GarminSupport() {
|
public GarminSupport() {
|
||||||
super(LOG);
|
super(LOG);
|
||||||
addSupportedService(CommunicatorV1.UUID_SERVICE_GARMIN_GFDI);
|
addSupportedService(CommunicatorV1.UUID_SERVICE_GARMIN_GFDI_V0);
|
||||||
|
addSupportedService(CommunicatorV1.UUID_SERVICE_GARMIN_GFDI_V1);
|
||||||
addSupportedService(CommunicatorV2.UUID_SERVICE_GARMIN_ML_GFDI);
|
addSupportedService(CommunicatorV2.UUID_SERVICE_GARMIN_ML_GFDI);
|
||||||
protocolBufferHandler = new ProtocolBufferHandler(this);
|
protocolBufferHandler = new ProtocolBufferHandler(this);
|
||||||
fileTransferHandler = new FileTransferHandler(this);
|
fileTransferHandler = new FileTransferHandler(this);
|
||||||
|
@ -17,9 +17,15 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.communicator.
|
|||||||
public class CommunicatorV1 implements ICommunicator {
|
public class CommunicatorV1 implements ICommunicator {
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(CommunicatorV1.class);
|
private static final Logger LOG = LoggerFactory.getLogger(CommunicatorV1.class);
|
||||||
|
|
||||||
public static final UUID UUID_SERVICE_GARMIN_GFDI = UUID.fromString("6A4E2401-667B-11E3-949A-0800200C9A66");
|
// Seen in Vivovit / Forerunner 620
|
||||||
public static final UUID UUID_CHARACTERISTIC_GARMIN_GFDI_SEND = UUID.fromString("6A4E4C80-667B-11E3-949A-0800200C9A66");
|
public static final UUID UUID_SERVICE_GARMIN_GFDI_V0 = UUID.fromString("9B012401-BC30-CE9A-E111-0F67E491ABDE");
|
||||||
public static final UUID UUID_CHARACTERISTIC_GARMIN_GFDI_RECEIVE = UUID.fromString("6A4ECD28-667B-11E3-949A-0800200C9A66");
|
public static final UUID UUID_CHARACTERISTIC_GARMIN_GFDI_V0_SEND = UUID.fromString("DF334C80-E6A7-D082-274D-78FC66F85E16");
|
||||||
|
public static final UUID UUID_CHARACTERISTIC_GARMIN_GFDI_V0_RECEIVE = UUID.fromString("4ACBCD28-7425-868E-F447-915C8F00D0CB");
|
||||||
|
|
||||||
|
// Seen in Vivomove HR
|
||||||
|
public static final UUID UUID_SERVICE_GARMIN_GFDI_V1 = UUID.fromString("6A4E2401-667B-11E3-949A-0800200C9A66");
|
||||||
|
public static final UUID UUID_CHARACTERISTIC_GARMIN_GFDI_V1_SEND = UUID.fromString("6A4E4C80-667B-11E3-949A-0800200C9A66");
|
||||||
|
public static final UUID UUID_CHARACTERISTIC_GARMIN_GFDI_V1_RECEIVE = UUID.fromString("6A4ECD28-667B-11E3-949A-0800200C9A66");
|
||||||
|
|
||||||
private BluetoothGattCharacteristic characteristicSend;
|
private BluetoothGattCharacteristic characteristicSend;
|
||||||
private BluetoothGattCharacteristic characteristicReceive;
|
private BluetoothGattCharacteristic characteristicReceive;
|
||||||
@ -41,11 +47,16 @@ public class CommunicatorV1 implements ICommunicator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean initializeDevice(final TransactionBuilder builder) {
|
public boolean initializeDevice(final TransactionBuilder builder) {
|
||||||
characteristicSend = mSupport.getCharacteristic(UUID_CHARACTERISTIC_GARMIN_GFDI_SEND);
|
characteristicSend = mSupport.getCharacteristic(UUID_CHARACTERISTIC_GARMIN_GFDI_V1_SEND);
|
||||||
characteristicReceive = mSupport.getCharacteristic(UUID_CHARACTERISTIC_GARMIN_GFDI_RECEIVE);
|
characteristicReceive = mSupport.getCharacteristic(UUID_CHARACTERISTIC_GARMIN_GFDI_V1_RECEIVE);
|
||||||
|
|
||||||
if (characteristicSend == null || characteristicReceive == null) {
|
if (characteristicSend == null || characteristicReceive == null) {
|
||||||
LOG.warn("Failed to find V1 GFDI characteristics");
|
characteristicSend = mSupport.getCharacteristic(UUID_CHARACTERISTIC_GARMIN_GFDI_V0_SEND);
|
||||||
|
characteristicReceive = mSupport.getCharacteristic(UUID_CHARACTERISTIC_GARMIN_GFDI_V0_RECEIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (characteristicSend == null || characteristicReceive == null) {
|
||||||
|
LOG.warn("Failed to find V0/V1 GFDI characteristics");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user