mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-13 19:27:33 +01:00
Move MiBand3-ism to MiBand3Support
This commit is contained in:
parent
549dfce2e7
commit
435898ebc9
@ -211,10 +211,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
|
|||||||
heartRateNotifyEnabled = false;
|
heartRateNotifyEnabled = false;
|
||||||
boolean authenticate = needsAuth;
|
boolean authenticate = needsAuth;
|
||||||
needsAuth = false;
|
needsAuth = false;
|
||||||
byte authFlags = HuamiService.AUTH_BYTE;
|
byte authFlags = getAuthFlags();
|
||||||
if (gbDevice.getType() == DeviceType.MIBAND3) {
|
|
||||||
authFlags = 0x00;
|
|
||||||
}
|
|
||||||
new InitOperation(authenticate, authFlags, this, builder).perform();
|
new InitOperation(authenticate, authFlags, this, builder).perform();
|
||||||
characteristicHRControlPoint = getCharacteristic(GattCharacteristic.UUID_CHARACTERISTIC_HEART_RATE_CONTROL_POINT);
|
characteristicHRControlPoint = getCharacteristic(GattCharacteristic.UUID_CHARACTERISTIC_HEART_RATE_CONTROL_POINT);
|
||||||
characteristicChunked = getCharacteristic(HuamiService.UUID_CHARACTERISTIC_CHUNKEDTRANSFER);
|
characteristicChunked = getCharacteristic(HuamiService.UUID_CHARACTERISTIC_CHUNKEDTRANSFER);
|
||||||
@ -224,6 +221,10 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
|
|||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected byte getAuthFlags() {
|
||||||
|
return HuamiService.AUTH_BYTE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the given date/time (calendar) as a byte sequence, suitable for sending to the
|
* Returns the given date/time (calendar) as a byte sequence, suitable for sending to the
|
||||||
* Mi Band 2 (or derivative). The band appears to not handle DST offsets, so we simply add this
|
* Mi Band 2 (or derivative). The band appears to not handle DST offsets, so we simply add this
|
||||||
|
@ -37,6 +37,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband3.MiBand3Coordin
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband3.MiBand3FWHelper;
|
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband3.MiBand3FWHelper;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband3.MiBand3Service;
|
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband3.MiBand3Service;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst;
|
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipSupport;
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipSupport;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||||
@ -46,6 +47,14 @@ public class MiBand3Support extends AmazfitBipSupport {
|
|||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(MiBand3Support.class);
|
private static final Logger LOG = LoggerFactory.getLogger(MiBand3Support.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected byte getAuthFlags() {
|
||||||
|
if (gbDevice.getType() == DeviceType.MIBAND3) {
|
||||||
|
return 0x00;
|
||||||
|
}
|
||||||
|
return super.getAuthFlags();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected MiBand3Support setDisplayItems(TransactionBuilder builder) {
|
protected MiBand3Support setDisplayItems(TransactionBuilder builder) {
|
||||||
Prefs prefs = GBApplication.getPrefs();
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user