Search in sources :

Example 26 with Subscription

use of com.eveningoutpost.dexdrip.utils.bt.Subscription in project xDrip by NightscoutFoundation.

the class MedtrumCollectionService method enable_features_and_listen.

private synchronized void enable_features_and_listen() {
    UserError.Log.d(TAG, "enable features - enter");
    stopListening();
    if (connection != null) {
        notificationSubscription = new Subscription(connection.setupNotification(Const.CGM_CHARACTERISTIC_NOTIFY).timeout(LISTEN_STASIS_SECONDS, // WARN
        TimeUnit.SECONDS).observeOn(Schedulers.newThread()).doOnNext(notificationObservable -> {
            UserError.Log.d(TAG, "Notifications enabled");
        }).flatMap(notificationObservable -> notificationObservable).subscribe(bytes -> {
            final PowerManager.WakeLock wl = JoH.getWakeLock("medtrum-receive-n", 60000);
            try {
                UserError.Log.d(TAG, "Received notification bytes: " + JoH.bytesToHex(bytes));
                lastInteractionTime = JoH.tsl();
                setFailOverTimer();
                lastAnnex = new AnnexARx(bytes);
                UserError.Log.d(TAG, "Notification: " + lastAnnex.toS());
                createRecordFromAnnexData(lastAnnex);
                backFillIfNeeded(lastAnnex);
            } finally {
                JoH.releaseWakeLock(wl);
            }
        }, throwable -> {
            UserError.Log.d(TAG, "notification throwable: " + throwable);
        }));
        final InboundStream inboundStream = new InboundStream();
        indicationSubscription = new Subscription(connection.setupIndication(CGM_CHARACTERISTIC_INDICATE).timeout(LISTEN_STASIS_SECONDS, // WARN
        TimeUnit.SECONDS).observeOn(Schedulers.newThread()).doOnNext(notificationObservable -> {
            UserError.Log.d(TAG, "Indications enabled");
            sendTx(new AuthTx(serial));
        }).flatMap(notificationObservable -> notificationObservable).subscribe(bytes -> {
            final PowerManager.WakeLock wl = JoH.getWakeLock("medtrum-receive-i", 60000);
            try {
                UserError.Log.d(TAG, "Received indication bytes: " + JoH.bytesToHex(bytes));
                if (inboundStream.hasSomeData() && msSince(lastInteractionTime) > Constants.SECOND_IN_MS * 10) {
                    UserError.Log.d(TAG, "Resetting stream due to earlier timeout");
                }
                lastInteractionTime = JoH.tsl();
                inboundStream.push(bytes);
                if (!checkAndProcessInboundStream(inboundStream)) {
                    Inevitable.task("mt-reset-stream-no-data", 3000, () -> {
                        if (inboundStream.hasSomeData()) {
                            UserError.Log.d(TAG, "Resetting stream as incomplete after 3s");
                            inboundStream.reset();
                        }
                    });
                }
            } finally {
                JoH.releaseWakeLock(wl);
            }
        }, throwable -> {
            UserError.Log.d(TAG, "indication throwable: " + throwable);
        }));
    } else {
        UserError.Log.e(TAG, "Connection null when trying to set notifications");
    }
}
Also used : PersistentStore(com.eveningoutpost.dexdrip.UtilityModels.PersistentStore) com.eveningoutpost.dexdrip.xdrip(com.eveningoutpost.dexdrip.xdrip) AuthTx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.AuthTx) PendingIntent(android.app.PendingIntent) Inevitable(com.eveningoutpost.dexdrip.UtilityModels.Inevitable) Pref(com.eveningoutpost.dexdrip.UtilityModels.Pref) PowerManager(android.os.PowerManager) StatusItem(com.eveningoutpost.dexdrip.UtilityModels.StatusItem) TimeKeeper.timeStampFromTickCounter(com.eveningoutpost.dexdrip.cgm.medtrum.TimeKeeper.timeStampFromTickCounter) BtCallBack(com.eveningoutpost.dexdrip.utils.BtCallBack) BackFillRx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.BackFillRx) InboundStream(com.eveningoutpost.dexdrip.cgm.medtrum.messages.InboundStream) Schedulers(io.reactivex.schedulers.Schedulers) Ok(com.eveningoutpost.dexdrip.cgm.medtrum.SensorState.Ok) RxBleClient(com.polidea.rxandroidble2.RxBleClient) CALIBRATE(com.eveningoutpost.dexdrip.cgm.medtrum.MedtrumCollectionService.STATE.CALIBRATE) AnnexARx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.AnnexARx) CLOSE(com.eveningoutpost.dexdrip.cgm.medtrum.MedtrumCollectionService.STATE.CLOSE) BAD(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.BAD) NotCalibrated(com.eveningoutpost.dexdrip.cgm.medtrum.SensorState.NotCalibrated) OPCODE_CALI_REPLY(com.eveningoutpost.dexdrip.cgm.medtrum.Const.OPCODE_CALI_REPLY) ENABLE(com.eveningoutpost.dexdrip.cgm.medtrum.MedtrumCollectionService.STATE.ENABLE) BgReading.bgReadingInsertMedtrum(com.eveningoutpost.dexdrip.Models.BgReading.bgReadingInsertMedtrum) BgReading(com.eveningoutpost.dexdrip.Models.BgReading) NORMAL(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.NORMAL) CalibrateRx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.CalibrateRx) MEDTRUM_SERVICE_RETRY_ID(com.eveningoutpost.dexdrip.UtilityModels.Constants.MEDTRUM_SERVICE_RETRY_ID) TransmitterData(com.eveningoutpost.dexdrip.Models.TransmitterData) TimeTx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.TimeTx) JoH(com.eveningoutpost.dexdrip.Models.JoH) List(java.util.List) Disposable(io.reactivex.disposables.Disposable) ConnParamTx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.ConnParamTx) StatusRx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.StatusRx) R(com.eveningoutpost.dexdrip.R) Subscription(com.eveningoutpost.dexdrip.utils.bt.Subscription) Home(com.eveningoutpost.dexdrip.Home) BgGraphBuilder(com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder) BaseMessage(com.eveningoutpost.dexdrip.cgm.medtrum.messages.BaseMessage) JoH.msTill(com.eveningoutpost.dexdrip.Models.JoH.msTill) OPCODE_AUTH_REPLY(com.eveningoutpost.dexdrip.cgm.medtrum.Const.OPCODE_AUTH_REPLY) INIT(com.eveningoutpost.dexdrip.cgm.medtrum.MedtrumCollectionService.STATE.INIT) WakeLockTrampoline(com.eveningoutpost.dexdrip.utils.framework.WakeLockTrampoline) Constants(com.eveningoutpost.dexdrip.UtilityModels.Constants) Pair(android.util.Pair) AuthRx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.AuthRx) ActiveBluetoothDevice(com.eveningoutpost.dexdrip.Models.ActiveBluetoothDevice) RxBleConnection(com.polidea.rxandroidble2.RxBleConnection) MEDTRUM_SERVICE_FAILOVER_ID(com.eveningoutpost.dexdrip.UtilityModels.Constants.MEDTRUM_SERVICE_FAILOVER_ID) Intent(android.content.Intent) HOUR_IN_MS(com.eveningoutpost.dexdrip.UtilityModels.Constants.HOUR_IN_MS) CRITICAL(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.CRITICAL) GOOD(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.GOOD) HexDump(com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.util.HexDump) InvalidAlgorithmParameterException(java.security.InvalidAlgorithmParameterException) ArrayList(java.util.ArrayList) CGM_CHARACTERISTIC_INDICATE(com.eveningoutpost.dexdrip.cgm.medtrum.Const.CGM_CHARACTERISTIC_INDICATE) BackFillTx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.BackFillTx) OPCODE_CONN_REPLY(com.eveningoutpost.dexdrip.cgm.medtrum.Const.OPCODE_CONN_REPLY) SuppressLint(android.annotation.SuppressLint) Prediction(com.eveningoutpost.dexdrip.Models.Prediction) Scheduler(io.reactivex.Scheduler) Observable(io.reactivex.Observable) OPCODE_TIME_REPLY(com.eveningoutpost.dexdrip.cgm.medtrum.Const.OPCODE_TIME_REPLY) Build(android.os.Build) CLOSED(com.eveningoutpost.dexdrip.cgm.medtrum.MedtrumCollectionService.STATE.CLOSED) JamBaseBluetoothService(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothService) SET_CONN_PARAM(com.eveningoutpost.dexdrip.cgm.medtrum.MedtrumCollectionService.STATE.SET_CONN_PARAM) SCAN(com.eveningoutpost.dexdrip.cgm.medtrum.MedtrumCollectionService.STATE.SCAN) SpannableString(android.text.SpannableString) com.eveningoutpost.dexdrip.xdrip.gs(com.eveningoutpost.dexdrip.xdrip.gs) JoH.msSince(com.eveningoutpost.dexdrip.Models.JoH.msSince) CalibrateTx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.CalibrateTx) TimeRx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.TimeRx) Medtrum.getSerial(com.eveningoutpost.dexdrip.cgm.medtrum.Medtrum.getSerial) TimeUnit(java.util.concurrent.TimeUnit) StatusTx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.StatusTx) CONNECT(com.eveningoutpost.dexdrip.cgm.medtrum.MedtrumCollectionService.STATE.CONNECT) JoH.quietratelimit(com.eveningoutpost.dexdrip.Models.JoH.quietratelimit) RxBleProvider(com.eveningoutpost.dexdrip.UtilityModels.RxBleProvider) DexCollectionType(com.eveningoutpost.dexdrip.utils.DexCollectionType) ConnParamRx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.ConnParamRx) OPCODE_STAT_REPLY(com.eveningoutpost.dexdrip.cgm.medtrum.Const.OPCODE_STAT_REPLY) DisconnectReceiver(com.eveningoutpost.dexdrip.utils.DisconnectReceiver) OPCODE_BACK_REPLY(com.eveningoutpost.dexdrip.cgm.medtrum.Const.OPCODE_BACK_REPLY) UserError(com.eveningoutpost.dexdrip.Models.UserError) Span(com.eveningoutpost.dexdrip.ui.helpers.Span) RxBleDevice(com.polidea.rxandroidble2.RxBleDevice) MINUTE_IN_MS(com.eveningoutpost.dexdrip.UtilityModels.Constants.MINUTE_IN_MS) PowerManager(android.os.PowerManager) AnnexARx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.AnnexARx) Subscription(com.eveningoutpost.dexdrip.utils.bt.Subscription) InboundStream(com.eveningoutpost.dexdrip.cgm.medtrum.messages.InboundStream) AuthTx(com.eveningoutpost.dexdrip.cgm.medtrum.messages.AuthTx)

Example 27 with Subscription

use of com.eveningoutpost.dexdrip.utils.bt.Subscription in project xDrip by NightscoutFoundation.

the class Ob1G5CollectionService method connect_to_device.

private synchronized void connect_to_device(boolean auto) {
    if ((state == CONNECT) || (state == CONNECT_NOW)) {
        // TODO check mac
        if (transmitterMAC == null) {
            tryLoadingSavedMAC();
        }
        final String localTransmitterMAC = transmitterMAC;
        if (localTransmitterMAC != null) {
            msg("Connect request");
            if (state == CONNECT_NOW) {
                if (connection_linger != null)
                    JoH.releaseWakeLock(connection_linger);
                connection_linger = JoH.getWakeLock("jam-g5-pconnect", 60000);
            }
            if (d)
                UserError.Log.d(TAG, "Local bonding state: " + (isDeviceLocallyBonded() ? "BONDED" : "NOT Bonded"));
            stopConnect();
            try {
                bleDevice = rxBleClient.getBleDevice(localTransmitterMAC);
                // / / Listen for connection state changes
                stateSubscription = new Subscription(bleDevice.observeConnectionStateChanges().subscribeOn(Schedulers.io()).subscribe(this::onConnectionStateChange, throwable -> {
                    UserError.Log.wtf(TAG, "Got Error from state subscription: " + throwable);
                }));
                last_connect_started = JoH.tsl();
                // Attempt to establish a connection // TODO does this need different connection timeout for auto vs normal?
                connectionSubscription = new Subscription(bleDevice.establishConnection(auto).timeout(7, TimeUnit.MINUTES).subscribeOn(Schedulers.io()).subscribe(this::onConnectionReceived, this::onConnectionFailure));
            } catch (IllegalArgumentException e) {
                UserError.Log.e(TAG, "Caught IllegalArgument Exception: " + e + " retry on next run");
                // TODO if this is due to concurrent access then changing state again may be a bad idea
                state = SCAN;
                // note backoff
                backoff_automata();
            }
        } else {
            UserError.Log.wtf(TAG, "No transmitter mac address!");
            state = SCAN;
            // note backoff
            backoff_automata();
        }
    } else {
        UserError.Log.wtf(TAG, "Attempt to connect when not in CONNECT state");
    }
}
Also used : SpannableString(android.text.SpannableString) Subscription(com.eveningoutpost.dexdrip.utils.bt.Subscription)

Example 28 with Subscription

use of com.eveningoutpost.dexdrip.utils.bt.Subscription in project xDrip by NightscoutFoundation.

the class Ob1G5CollectionService method discover_services.

private synchronized void discover_services() {
    if (state == DISCOVER) {
        if (connection != null) {
            if (d)
                UserError.Log.d(TAG, "Local bonding state: " + (isDeviceLocallyBonded() ? "BONDED" : "NOT Bonded"));
            stopDiscover();
            discoverSubscription = new Subscription(connection.discoverServices(10, TimeUnit.SECONDS).subscribe(this::onServicesDiscovered, this::onDiscoverFailed));
        } else {
            UserError.Log.e(TAG, "No connection when in DISCOVER state - reset");
            state = INIT;
            background_automata();
        }
    } else {
        UserError.Log.wtf(TAG, "Attempt to discover when not in DISCOVER state");
    }
}
Also used : Subscription(com.eveningoutpost.dexdrip.utils.bt.Subscription)

Example 29 with Subscription

use of com.eveningoutpost.dexdrip.utils.bt.Subscription in project xDrip-plus by jamorham.

the class JamBaseBluetoothSequencer method discover_services.

// service discovery
public synchronized void discover_services() {
    // if (state == DISCOVER) {
    if (I.discoverOnce && I.isDiscoveryComplete) {
        UserError.Log.d(TAG, "Skipping service discovery as already completed");
        changeNextState();
    } else {
        if (I.connection != null) {
            UserError.Log.d(TAG, "Discovering services");
            stopDiscover();
            I.discoverSubscription = new Subscription(I.connection.discoverServices(10, TimeUnit.SECONDS).subscribe(this::onServicesDiscovered, this::onDiscoverFailed));
        } else {
            UserError.Log.e(TAG, "No connection when in DISCOVER state - reset");
            // These are normally just ghosts that get here, not really connected
            if (I.resetWhenAlreadyConnected) {
                if (JoH.ratelimit("jam-sequencer-reset", 10)) {
                    changeState(CLOSE);
                }
            }
        }
    // } else {
    // UserError.Log.wtf(TAG, "Attempt to discover when not in DISCOVER state");
    // }
    }
}
Also used : Subscription(com.eveningoutpost.dexdrip.utils.bt.Subscription)

Example 30 with Subscription

use of com.eveningoutpost.dexdrip.utils.bt.Subscription in project xDrip-plus by jamorham.

the class MiBandService method installWatchface.

@SuppressLint("CheckResult")
private void installWatchface() {
    // TODO decrease display brightness before uploading watchface to minimize battery consumption
    RxBleConnection connection = I.connection;
    if (d)
        UserError.Log.d(TAG, "Install WatchFace");
    if (I.connection == null) {
        if (d)
            UserError.Log.d(TAG, "Cannot enable as connection is null!");
        return;
    }
    try {
        WatchFaceGenerator wfGen = new WatchFaceGenerator(getBaseContext().getAssets());
        byte[] fwArray = wfGen.genWatchFace();
        if (fwArray == null || fwArray.length == 0) {
            resetFirmwareState(false, "Empty image");
            return;
        }
        firmware = new FirmwareOperations(fwArray);
    } catch (Exception e) {
        resetFirmwareState(false, "FirmwareOperations error " + e.getMessage());
        return;
    }
    if (d)
        UserError.Log.d(TAG, "Begin uploading Watchface, lenght: " + firmware.getSize());
    if (d)
        UserError.Log.d(TAG, "Requesting to enable notifications for installWatchface");
    watchfaceSubscription = new Subscription(connection.setupNotification(firmware.getFirmwareCharacteristicUUID()).timeout(400, // WARN
    TimeUnit.SECONDS).doOnNext(notificationObservable -> {
        if (d)
            UserError.Log.d(TAG, "Notification for firmware enabled");
        firmware.nextSequence();
        processFirmwareCommands(null, true);
    }).flatMap(notificationObservable -> notificationObservable).subscribe(bytes -> {
        // incoming notifications
        if (d)
            UserError.Log.d(TAG, "Received firmware notification bytes: " + bytesToHex(bytes));
        processFirmwareCommands(bytes, false);
    }, throwable -> {
        UserError.Log.d(TAG, "Throwable in firmware Notification: " + throwable);
        if (throwable instanceof BleCharacteristicNotFoundException) {
            // maybe legacy - ignore for now but needs better handling
            UserError.Log.d(TAG, "Characteristic not found for notification");
        } else if (throwable instanceof BleCannotSetCharacteristicNotificationException) {
            UserError.Log.e(TAG, "Problems setting notifications - disconnecting");
        } else if (throwable instanceof BleDisconnectedException) {
            UserError.Log.d(TAG, "Disconnected while enabling notifications");
        } else if (throwable instanceof TimeoutException) {
            UserError.Log.d(TAG, "Timeout");
        }
        resetFirmwareState(false);
    }));
}
Also used : AUTHORIZE_FAILED(com.eveningoutpost.dexdrip.watch.miband.MiBandService.MiBandState.AUTHORIZE_FAILED) AUTH_REQUEST_RANDOM_AUTH_NUMBER(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.AUTH_REQUEST_RANDOM_AUTH_NUMBER) AuthMessages(com.eveningoutpost.dexdrip.watch.miband.message.AuthMessages) Arrays(java.util.Arrays) com.eveningoutpost.dexdrip.xdrip(com.eveningoutpost.dexdrip.xdrip) Date(java.util.Date) TimeoutException(java.util.concurrent.TimeoutException) PendingIntent(android.app.PendingIntent) CLOSED(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer.BaseState.CLOSED) INIT(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer.BaseState.INIT) Inevitable(com.eveningoutpost.dexdrip.UtilityModels.Inevitable) BleCannotSetCharacteristicNotificationException(com.polidea.rxandroidble2.exceptions.BleCannotSetCharacteristicNotificationException) PowerManager(android.os.PowerManager) HeartRate(com.eveningoutpost.dexdrip.Models.HeartRate) StatusItem(com.eveningoutpost.dexdrip.UtilityModels.StatusItem) BleCharacteristicNotFoundException(com.polidea.rxandroidble2.exceptions.BleCharacteristicNotFoundException) COMMAND_ACK_FIND_PHONE_IN_PROGRESS(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.COMMAND_ACK_FIND_PHONE_IN_PROGRESS) AUTH_FAIL(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.AUTH_FAIL) Schedulers(io.reactivex.schedulers.Schedulers) AUTH_MIBAND4_CODE_FAIL(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.AUTH_MIBAND4_CODE_FAIL) AUTH_RESPONSE(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.AUTH_RESPONSE) AUTH_SEND_KEY(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.AUTH_SEND_KEY) ActiveBgAlert(com.eveningoutpost.dexdrip.Models.ActiveBgAlert) FeaturesControllMessage(com.eveningoutpost.dexdrip.watch.miband.message.FeaturesControllMessage) MIBAND_NOTIFY_TYPE_ALARM(com.eveningoutpost.dexdrip.watch.miband.Const.MIBAND_NOTIFY_TYPE_ALARM) CLOSE(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer.BaseState.CLOSE) BgReading(com.eveningoutpost.dexdrip.Models.BgReading) PrefBindingFactory(com.eveningoutpost.dexdrip.watch.PrefBindingFactory) UUID(java.util.UUID) JoH.getResourceURI(com.eveningoutpost.dexdrip.Models.JoH.getResourceURI) UNKNOWN(com.eveningoutpost.dexdrip.watch.miband.MiBand.MiBandType.UNKNOWN) JoH(com.eveningoutpost.dexdrip.Models.JoH) List(java.util.List) BleDisconnectedException(com.polidea.rxandroidble2.exceptions.BleDisconnectedException) JoH.bytesToHex(com.eveningoutpost.dexdrip.Models.JoH.bytesToHex) MIBAND_NOTIFY_TYPE_CANCEL(com.eveningoutpost.dexdrip.watch.miband.Const.MIBAND_NOTIFY_TYPE_CANCEL) R(com.eveningoutpost.dexdrip.R) Subscription(com.eveningoutpost.dexdrip.utils.bt.Subscription) PREFERRED_MTU_SIZE(com.eveningoutpost.dexdrip.watch.miband.Const.PREFERRED_MTU_SIZE) AlertLevelMessage(com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage) JoH.msTill(com.eveningoutpost.dexdrip.Models.JoH.msTill) AUTH_SUCCESS(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.AUTH_SUCCESS) Getter(lombok.Getter) BluetoothGattCharacteristic(android.bluetooth.BluetoothGattCharacteristic) WakeLockTrampoline(com.eveningoutpost.dexdrip.utils.framework.WakeLockTrampoline) Constants(com.eveningoutpost.dexdrip.UtilityModels.Constants) AUTH_SEND_ENCRYPTED_AUTH_NUMBER(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.AUTH_SEND_ENCRYPTED_AUTH_NUMBER) Pair(android.util.Pair) FirmwareOperations(com.eveningoutpost.dexdrip.watch.miband.Firmware.FirmwareOperations) DisplayControllMessageMiband3_4(com.eveningoutpost.dexdrip.watch.miband.message.DisplayControllMessageMiband3_4) RxBleConnection(com.polidea.rxandroidble2.RxBleConnection) Intent(android.content.Intent) MediaPlayer(android.media.MediaPlayer) ArrayList(java.util.ArrayList) JoH.niceTimeScalar(com.eveningoutpost.dexdrip.Models.JoH.niceTimeScalar) SuppressLint(android.annotation.SuppressLint) Calendar(java.util.Calendar) DeviceEvent(com.eveningoutpost.dexdrip.watch.miband.message.DeviceEvent) DisplayControllMessageMiBand2(com.eveningoutpost.dexdrip.watch.miband.message.DisplayControllMessageMiBand2) DisplayControllMessage(com.eveningoutpost.dexdrip.watch.miband.message.DisplayControllMessage) COMMAND_DISABLE_CALL(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.COMMAND_DISABLE_CALL) JamBaseBluetoothSequencer(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer) AlertMessage(com.eveningoutpost.dexdrip.watch.miband.message.AlertMessage) MI_BAND4(com.eveningoutpost.dexdrip.watch.miband.MiBand.MiBandType.MI_BAND4) Sheduled(com.eveningoutpost.dexdrip.watch.miband.message.DisplayControllMessageMiband3_4.NightMode.Sheduled) RxBleDeviceServices(com.polidea.rxandroidble2.RxBleDeviceServices) MI_BAND2(com.eveningoutpost.dexdrip.watch.miband.MiBand.MiBandType.MI_BAND2) JoH.emptyString(com.eveningoutpost.dexdrip.Models.JoH.emptyString) SLEEP(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer.BaseState.SLEEP) BluetoothGattService(android.bluetooth.BluetoothGattService) com.eveningoutpost.dexdrip.xdrip.gs(com.eveningoutpost.dexdrip.xdrip.gs) AUTH_MIBAND4_FAIL(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes.AUTH_MIBAND4_FAIL) WatchFaceGenerator(com.eveningoutpost.dexdrip.watch.miband.Firmware.WatchFaceGenerator) AlertPlayer(com.eveningoutpost.dexdrip.UtilityModels.AlertPlayer) PoorMansConcurrentLinkedDeque(com.eveningoutpost.dexdrip.utils.framework.PoorMansConcurrentLinkedDeque) TimeUnit(java.util.concurrent.TimeUnit) MIBAND_NOTIFY_TYPE_MESSAGE(com.eveningoutpost.dexdrip.watch.miband.Const.MIBAND_NOTIFY_TYPE_MESSAGE) OperationCodes(com.eveningoutpost.dexdrip.watch.miband.message.OperationCodes) UserError(com.eveningoutpost.dexdrip.Models.UserError) MIBAND_NOTIFY_TYPE_CALL(com.eveningoutpost.dexdrip.watch.miband.Const.MIBAND_NOTIFY_TYPE_CALL) FirmwareOperations(com.eveningoutpost.dexdrip.watch.miband.Firmware.FirmwareOperations) BleCannotSetCharacteristicNotificationException(com.polidea.rxandroidble2.exceptions.BleCannotSetCharacteristicNotificationException) BleCharacteristicNotFoundException(com.polidea.rxandroidble2.exceptions.BleCharacteristicNotFoundException) BleDisconnectedException(com.polidea.rxandroidble2.exceptions.BleDisconnectedException) RxBleConnection(com.polidea.rxandroidble2.RxBleConnection) Subscription(com.eveningoutpost.dexdrip.utils.bt.Subscription) TimeoutException(java.util.concurrent.TimeoutException) BleCannotSetCharacteristicNotificationException(com.polidea.rxandroidble2.exceptions.BleCannotSetCharacteristicNotificationException) BleCharacteristicNotFoundException(com.polidea.rxandroidble2.exceptions.BleCharacteristicNotFoundException) BleDisconnectedException(com.polidea.rxandroidble2.exceptions.BleDisconnectedException) WatchFaceGenerator(com.eveningoutpost.dexdrip.watch.miband.Firmware.WatchFaceGenerator) TimeoutException(java.util.concurrent.TimeoutException) SuppressLint(android.annotation.SuppressLint)

Aggregations

Subscription (com.eveningoutpost.dexdrip.utils.bt.Subscription)34 SuppressLint (android.annotation.SuppressLint)10 Intent (android.content.Intent)10 PowerManager (android.os.PowerManager)10 Pair (android.util.Pair)10 BgReading (com.eveningoutpost.dexdrip.Models.BgReading)10 JoH (com.eveningoutpost.dexdrip.Models.JoH)10 JoH.msTill (com.eveningoutpost.dexdrip.Models.JoH.msTill)10 UserError (com.eveningoutpost.dexdrip.Models.UserError)10 R (com.eveningoutpost.dexdrip.R)10 Constants (com.eveningoutpost.dexdrip.UtilityModels.Constants)10 Inevitable (com.eveningoutpost.dexdrip.UtilityModels.Inevitable)10 StatusItem (com.eveningoutpost.dexdrip.UtilityModels.StatusItem)10 WakeLockTrampoline (com.eveningoutpost.dexdrip.utils.framework.WakeLockTrampoline)10 com.eveningoutpost.dexdrip.xdrip (com.eveningoutpost.dexdrip.xdrip)10 com.eveningoutpost.dexdrip.xdrip.gs (com.eveningoutpost.dexdrip.xdrip.gs)10 BleCharacteristicNotFoundException (com.polidea.rxandroidble2.exceptions.BleCharacteristicNotFoundException)10 Schedulers (io.reactivex.schedulers.Schedulers)10 ArrayList (java.util.ArrayList)10 List (java.util.List)10