Search in sources :

Example 1 with KeepAliveTx

use of com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx in project xDrip-plus by jamorham.

the class InPenService method keepAlive.

private void keepAlive() {
    I.connection.writeCharacteristic(KEEPALIVE, new KeepAliveTx().getBytes()).subscribe(value -> {
        UserError.Log.d(TAG, "Sent KeepAlive ok: ");
        changeNextState();
    }, throwable -> {
        UserError.Log.e(TAG, "Could not write keepAlive " + throwable);
    });
}
Also used : KeepAliveTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx)

Example 2 with KeepAliveTx

use of com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx in project xDrip by NightscoutFoundation.

the class InPenService method getRecords.

private void getRecords(final int firstIndex, final int lastIndex) {
    final int numberOfRecords = lastIndex - firstIndex;
    if (numberOfRecords > 30) {
        I.connection.writeCharacteristic(KEEPALIVE, new KeepAliveTx().getBytes()).subscribe(value -> {
            UserError.Log.d(TAG, "Wrote keep alive for " + numberOfRecords);
        }, throwable -> {
            UserError.Log.d(TAG, "Got exception in keep alive" + throwable);
        });
    }
    final RecordTx packet = new RecordTx(firstIndex, lastIndex);
    UserError.Log.d(TAG, "getRecords called, loading: " + firstIndex + " to " + lastIndex);
    I.connection.setupIndication(RECORD_INDICATE).doOnNext(notificationObservable -> {
        I.connection.writeCharacteristic(RECORD_START, packet.startBytes()).subscribe(valueS -> {
            UserError.Log.d(TAG, "Wrote record start: " + bytesToHex(valueS));
            I.connection.writeCharacteristic(RECORD_END, packet.endBytes()).subscribe(valueE -> {
                UserError.Log.d(TAG, "Wrote record end: " + bytesToHex(valueE));
                I.connection.writeCharacteristic(RECORD_REQUEST, packet.triggerBytes()).subscribe(characteristicValue -> {
                    if (D)
                        UserError.Log.d(TAG, "Wrote record request request: " + bytesToHex(characteristicValue));
                }, throwable -> {
                    UserError.Log.e(TAG, "Failed to write record request: " + throwable);
                    if (throwable instanceof BleGattCharacteristicException) {
                        final int status = ((BleGattCharacteristicException) throwable).getStatus();
                        UserError.Log.e(TAG, "Got status message: " + Helper.getStatusName(status));
                    }
                });
            }, throwable -> {
                UserError.Log.d(TAG, "Throwable in Record End write: " + throwable);
            });
        }, throwable -> {
            UserError.Log.d(TAG, "Throwable in Record Start write: " + throwable);
        // throws BleGattCharacteristicException status = 128 for "no resources" eg nothing matches
        });
    }).flatMap(notificationObservable -> notificationObservable).timeout(120, TimeUnit.SECONDS).observeOn(Schedulers.newThread()).subscribe(bytes -> {
        records.add(bytes);
        UserError.Log.d(TAG, "INDICATE INDICATE: " + HexDump.dumpHexString(bytes));
    }, throwable -> {
        if (!(throwable instanceof OperationSuccess)) {
            if (throwable instanceof BleDisconnectedException) {
                UserError.Log.d(TAG, "Disconnected when waiting to receive indication: " + throwable);
            } else {
                UserError.Log.e(TAG, "Error receiving indication: " + throwable);
            }
            Inevitable.task("check-records-queue", 100, this::processRecordsQueue);
        }
    });
}
Also used : KeepAliveTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx) Arrays(java.util.Arrays) TypeToken(com.google.gson.reflect.TypeToken) AdvertRx(com.eveningoutpost.dexdrip.insulin.inpen.messages.AdvertRx) ProcessPenData(com.eveningoutpost.dexdrip.insulin.shared.ProcessPenData) GsonBuilder(com.google.gson.GsonBuilder) Inevitable(com.eveningoutpost.dexdrip.UtilityModels.Inevitable) Pref(com.eveningoutpost.dexdrip.UtilityModels.Pref) HexDump.dumpHexString(com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.util.HexDump.dumpHexString) Map(java.util.Map) BleGattCharacteristicException(com.polidea.rxandroidble2.exceptions.BleGattCharacteristicException) TargetApi(android.annotation.TargetApi) INFO_CHARACTERISTICS(com.eveningoutpost.dexdrip.insulin.inpen.Constants.INFO_CHARACTERISTICS) RECORD_INDEX(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_INDEX) DEFAULT_BOND_UNITS(com.eveningoutpost.dexdrip.insulin.inpen.InPen.DEFAULT_BOND_UNITS) RECORD_REQUEST(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_REQUEST) JoH(com.eveningoutpost.dexdrip.Models.JoH) JoH.bytesToHex(com.eveningoutpost.dexdrip.Models.JoH.bytesToHex) BOND_NONE(android.bluetooth.BluetoothDevice.BOND_NONE) STORE_INPEN_ADVERT(com.eveningoutpost.dexdrip.insulin.inpen.InPen.STORE_INPEN_ADVERT) RecordRx(com.eveningoutpost.dexdrip.insulin.inpen.messages.RecordRx) BATTERY(com.eveningoutpost.dexdrip.insulin.inpen.Constants.BATTERY) PenData(com.eveningoutpost.dexdrip.Models.PenData) STORE_INPEN_BATTERY(com.eveningoutpost.dexdrip.insulin.inpen.InPen.STORE_INPEN_BATTERY) BluetoothGattCharacteristic(android.bluetooth.BluetoothGattCharacteristic) WakeLockTrampoline(com.eveningoutpost.dexdrip.utils.framework.WakeLockTrampoline) BatteryRx(com.eveningoutpost.dexdrip.insulin.inpen.messages.BatteryRx) GOOD(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.GOOD) BONDCONTROL(com.eveningoutpost.dexdrip.insulin.inpen.Constants.BONDCONTROL) HexDump(com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.util.HexDump) ArrayList(java.util.ArrayList) BOND_AUTHORITY(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.BOND_AUTHORITY) Helper(com.eveningoutpost.dexdrip.utils.bt.Helper) Observable(io.reactivex.Observable) JamBaseBluetoothSequencer(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer) RxBleDeviceServices(com.polidea.rxandroidble2.RxBleDeviceServices) BONDAGE(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.BONDAGE) BondTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.BondTx) Converters(com.eveningoutpost.dexdrip.utils.math.Converters) JoH.ratelimit(com.eveningoutpost.dexdrip.Models.JoH.ratelimit) JoH.quietratelimit(com.eveningoutpost.dexdrip.Models.JoH.quietratelimit) RecordTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.RecordTx) RECORD_END(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_END) GET_AUTH_STATE(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_AUTH_STATE) UserError(com.eveningoutpost.dexdrip.Models.UserError) PersistentStore(com.eveningoutpost.dexdrip.UtilityModels.PersistentStore) HEXDUMP_INFO_CHARACTERISTICS(com.eveningoutpost.dexdrip.insulin.inpen.Constants.HEXDUMP_INFO_CHARACTERISTICS) InPenEntry.isStarted(com.eveningoutpost.dexdrip.insulin.inpen.InPenEntry.isStarted) PendingIntent(android.app.PendingIntent) INIT(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer.BaseState.INIT) PEN_ATTACH_TIME(com.eveningoutpost.dexdrip.insulin.inpen.Constants.PEN_ATTACH_TIME) GET_BATTERY(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_BATTERY) PowerManager(android.os.PowerManager) StatusItem(com.eveningoutpost.dexdrip.UtilityModels.StatusItem) KEEP_ALIVE(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.KEEP_ALIVE) Gson(com.google.gson.Gson) Schedulers(io.reactivex.schedulers.Schedulers) GET_INDEX(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_INDEX) BAD(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.BAD) GET_RECORDS(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_RECORDS) INPEN_SERVICE_FAILOVER_ID(com.eveningoutpost.dexdrip.UtilityModels.Constants.INPEN_SERVICE_FAILOVER_ID) CLOSE(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer.BaseState.CLOSE) NORMAL(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.NORMAL) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) KEEPALIVE(com.eveningoutpost.dexdrip.insulin.inpen.Constants.KEEPALIVE) Helper.getCharactersticName(com.eveningoutpost.dexdrip.utils.bt.Helper.getCharactersticName) UUID(java.util.UUID) GET_TIME(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_TIME) List(java.util.List) Disposable(io.reactivex.disposables.Disposable) BleDisconnectedException(com.polidea.rxandroidble2.exceptions.BleDisconnectedException) R(com.eveningoutpost.dexdrip.R) REMAINING_INDEX(com.eveningoutpost.dexdrip.insulin.inpen.Constants.REMAINING_INDEX) Queue(java.util.Queue) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) BluetoothDevice(android.bluetooth.BluetoothDevice) GET_AUTH_STATE2(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_AUTH_STATE2) RECORD_INDICATE(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_INDICATE) Intent(android.content.Intent) HashMap(java.util.HashMap) GET_A_TIME(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_A_TIME) JoH.dateTimeText(com.eveningoutpost.dexdrip.Models.JoH.dateTimeText) JoH.hourMinuteString(com.eveningoutpost.dexdrip.Models.JoH.hourMinuteString) Scheduler(io.reactivex.Scheduler) BleGattException(com.polidea.rxandroidble2.exceptions.BleGattException) ID_INPEN(com.eveningoutpost.dexdrip.insulin.inpen.InPenEntry.ID_INPEN) STORE_INPEN_INFOS(com.eveningoutpost.dexdrip.insulin.inpen.InPen.STORE_INPEN_INFOS) Build(android.os.Build) TimeRx(com.eveningoutpost.dexdrip.insulin.inpen.messages.TimeRx) SlidingWindowConstraint(com.eveningoutpost.dexdrip.utils.time.SlidingWindowConstraint) AUTHENTICATION(com.eveningoutpost.dexdrip.insulin.inpen.Constants.AUTHENTICATION) PRINTABLE_INFO_CHARACTERISTICS(com.eveningoutpost.dexdrip.insulin.inpen.Constants.PRINTABLE_INFO_CHARACTERISTICS) JoH.emptyString(com.eveningoutpost.dexdrip.Models.JoH.emptyString) BluetoothGattService(android.bluetooth.BluetoothGattService) PEN_TIME(com.eveningoutpost.dexdrip.insulin.inpen.Constants.PEN_TIME) RECORD_START(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_START) GET_IDENTITY(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_IDENTITY) JoH.msSince(com.eveningoutpost.dexdrip.Models.JoH.msSince) TimeUnit(java.util.concurrent.TimeUnit) BOND_BONDED(android.bluetooth.BluetoothDevice.BOND_BONDED) KeepAliveTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx) SECOND_IN_MS(com.eveningoutpost.dexdrip.UtilityModels.Constants.SECOND_IN_MS) MINUTE_IN_MS(com.eveningoutpost.dexdrip.UtilityModels.Constants.MINUTE_IN_MS) BleGattCharacteristicException(com.polidea.rxandroidble2.exceptions.BleGattCharacteristicException) RecordTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.RecordTx) BleDisconnectedException(com.polidea.rxandroidble2.exceptions.BleDisconnectedException) SlidingWindowConstraint(com.eveningoutpost.dexdrip.utils.time.SlidingWindowConstraint)

Example 3 with KeepAliveTx

use of com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx in project xDrip by NightscoutFoundation.

the class InPenService method keepAlive.

private void keepAlive() {
    I.connection.writeCharacteristic(KEEPALIVE, new KeepAliveTx().getBytes()).subscribe(value -> {
        UserError.Log.d(TAG, "Sent KeepAlive ok: ");
        changeNextState();
    }, throwable -> {
        UserError.Log.e(TAG, "Could not write keepAlive " + throwable);
    });
}
Also used : KeepAliveTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx)

Example 4 with KeepAliveTx

use of com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx in project xDrip-plus by jamorham.

the class InPenService method getRecords.

private void getRecords(final int firstIndex, final int lastIndex) {
    final int numberOfRecords = lastIndex - firstIndex;
    if (numberOfRecords > 30) {
        I.connection.writeCharacteristic(KEEPALIVE, new KeepAliveTx().getBytes()).subscribe(value -> {
            UserError.Log.d(TAG, "Wrote keep alive for " + numberOfRecords);
        }, throwable -> {
            UserError.Log.d(TAG, "Got exception in keep alive" + throwable);
        });
    }
    final RecordTx packet = new RecordTx(firstIndex, lastIndex);
    UserError.Log.d(TAG, "getRecords called, loading: " + firstIndex + " to " + lastIndex);
    I.connection.setupIndication(RECORD_INDICATE).doOnNext(notificationObservable -> {
        I.connection.writeCharacteristic(RECORD_START, packet.startBytes()).subscribe(valueS -> {
            UserError.Log.d(TAG, "Wrote record start: " + bytesToHex(valueS));
            I.connection.writeCharacteristic(RECORD_END, packet.endBytes()).subscribe(valueE -> {
                UserError.Log.d(TAG, "Wrote record end: " + bytesToHex(valueE));
                I.connection.writeCharacteristic(RECORD_REQUEST, packet.triggerBytes()).subscribe(characteristicValue -> {
                    if (D)
                        UserError.Log.d(TAG, "Wrote record request request: " + bytesToHex(characteristicValue));
                }, throwable -> {
                    UserError.Log.e(TAG, "Failed to write record request: " + throwable);
                    if (throwable instanceof BleGattCharacteristicException) {
                        final int status = ((BleGattCharacteristicException) throwable).getStatus();
                        UserError.Log.e(TAG, "Got status message: " + Helper.getStatusName(status));
                    }
                });
            }, throwable -> {
                UserError.Log.d(TAG, "Throwable in Record End write: " + throwable);
            });
        }, throwable -> {
            UserError.Log.d(TAG, "Throwable in Record Start write: " + throwable);
        // throws BleGattCharacteristicException status = 128 for "no resources" eg nothing matches
        });
    }).flatMap(notificationObservable -> notificationObservable).timeout(120, TimeUnit.SECONDS).observeOn(Schedulers.newThread()).subscribe(bytes -> {
        records.add(bytes);
        UserError.Log.d(TAG, "INDICATE INDICATE: " + HexDump.dumpHexString(bytes));
    }, throwable -> {
        if (!(throwable instanceof OperationSuccess)) {
            if (throwable instanceof BleDisconnectedException) {
                UserError.Log.d(TAG, "Disconnected when waiting to receive indication: " + throwable);
            } else {
                UserError.Log.e(TAG, "Error receiving indication: " + throwable);
            }
            Inevitable.task("check-records-queue", 100, this::processRecordsQueue);
        }
    });
}
Also used : KeepAliveTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx) Arrays(java.util.Arrays) TypeToken(com.google.gson.reflect.TypeToken) AdvertRx(com.eveningoutpost.dexdrip.insulin.inpen.messages.AdvertRx) ProcessPenData(com.eveningoutpost.dexdrip.insulin.shared.ProcessPenData) GsonBuilder(com.google.gson.GsonBuilder) Inevitable(com.eveningoutpost.dexdrip.UtilityModels.Inevitable) Pref(com.eveningoutpost.dexdrip.UtilityModels.Pref) HexDump.dumpHexString(com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.util.HexDump.dumpHexString) Map(java.util.Map) BleGattCharacteristicException(com.polidea.rxandroidble2.exceptions.BleGattCharacteristicException) TargetApi(android.annotation.TargetApi) INFO_CHARACTERISTICS(com.eveningoutpost.dexdrip.insulin.inpen.Constants.INFO_CHARACTERISTICS) RECORD_INDEX(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_INDEX) DEFAULT_BOND_UNITS(com.eveningoutpost.dexdrip.insulin.inpen.InPen.DEFAULT_BOND_UNITS) RECORD_REQUEST(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_REQUEST) JoH(com.eveningoutpost.dexdrip.Models.JoH) JoH.bytesToHex(com.eveningoutpost.dexdrip.Models.JoH.bytesToHex) BOND_NONE(android.bluetooth.BluetoothDevice.BOND_NONE) STORE_INPEN_ADVERT(com.eveningoutpost.dexdrip.insulin.inpen.InPen.STORE_INPEN_ADVERT) RecordRx(com.eveningoutpost.dexdrip.insulin.inpen.messages.RecordRx) BATTERY(com.eveningoutpost.dexdrip.insulin.inpen.Constants.BATTERY) PenData(com.eveningoutpost.dexdrip.Models.PenData) STORE_INPEN_BATTERY(com.eveningoutpost.dexdrip.insulin.inpen.InPen.STORE_INPEN_BATTERY) BluetoothGattCharacteristic(android.bluetooth.BluetoothGattCharacteristic) WakeLockTrampoline(com.eveningoutpost.dexdrip.utils.framework.WakeLockTrampoline) BatteryRx(com.eveningoutpost.dexdrip.insulin.inpen.messages.BatteryRx) GOOD(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.GOOD) BONDCONTROL(com.eveningoutpost.dexdrip.insulin.inpen.Constants.BONDCONTROL) HexDump(com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.util.HexDump) ArrayList(java.util.ArrayList) BOND_AUTHORITY(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.BOND_AUTHORITY) Helper(com.eveningoutpost.dexdrip.utils.bt.Helper) Observable(io.reactivex.Observable) JamBaseBluetoothSequencer(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer) RxBleDeviceServices(com.polidea.rxandroidble2.RxBleDeviceServices) BONDAGE(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.BONDAGE) BondTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.BondTx) Converters(com.eveningoutpost.dexdrip.utils.math.Converters) JoH.ratelimit(com.eveningoutpost.dexdrip.Models.JoH.ratelimit) JoH.quietratelimit(com.eveningoutpost.dexdrip.Models.JoH.quietratelimit) RecordTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.RecordTx) RECORD_END(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_END) GET_AUTH_STATE(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_AUTH_STATE) UserError(com.eveningoutpost.dexdrip.Models.UserError) PersistentStore(com.eveningoutpost.dexdrip.UtilityModels.PersistentStore) HEXDUMP_INFO_CHARACTERISTICS(com.eveningoutpost.dexdrip.insulin.inpen.Constants.HEXDUMP_INFO_CHARACTERISTICS) InPenEntry.isStarted(com.eveningoutpost.dexdrip.insulin.inpen.InPenEntry.isStarted) PendingIntent(android.app.PendingIntent) INIT(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer.BaseState.INIT) PEN_ATTACH_TIME(com.eveningoutpost.dexdrip.insulin.inpen.Constants.PEN_ATTACH_TIME) GET_BATTERY(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_BATTERY) PowerManager(android.os.PowerManager) StatusItem(com.eveningoutpost.dexdrip.UtilityModels.StatusItem) KEEP_ALIVE(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.KEEP_ALIVE) Gson(com.google.gson.Gson) Schedulers(io.reactivex.schedulers.Schedulers) GET_INDEX(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_INDEX) BAD(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.BAD) GET_RECORDS(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_RECORDS) INPEN_SERVICE_FAILOVER_ID(com.eveningoutpost.dexdrip.UtilityModels.Constants.INPEN_SERVICE_FAILOVER_ID) CLOSE(com.eveningoutpost.dexdrip.Services.JamBaseBluetoothSequencer.BaseState.CLOSE) NORMAL(com.eveningoutpost.dexdrip.UtilityModels.StatusItem.Highlight.NORMAL) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) KEEPALIVE(com.eveningoutpost.dexdrip.insulin.inpen.Constants.KEEPALIVE) Helper.getCharactersticName(com.eveningoutpost.dexdrip.utils.bt.Helper.getCharactersticName) UUID(java.util.UUID) GET_TIME(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_TIME) List(java.util.List) Disposable(io.reactivex.disposables.Disposable) BleDisconnectedException(com.polidea.rxandroidble2.exceptions.BleDisconnectedException) R(com.eveningoutpost.dexdrip.R) REMAINING_INDEX(com.eveningoutpost.dexdrip.insulin.inpen.Constants.REMAINING_INDEX) Queue(java.util.Queue) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) BluetoothDevice(android.bluetooth.BluetoothDevice) GET_AUTH_STATE2(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_AUTH_STATE2) RECORD_INDICATE(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_INDICATE) Intent(android.content.Intent) HashMap(java.util.HashMap) GET_A_TIME(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_A_TIME) JoH.dateTimeText(com.eveningoutpost.dexdrip.Models.JoH.dateTimeText) JoH.hourMinuteString(com.eveningoutpost.dexdrip.Models.JoH.hourMinuteString) Scheduler(io.reactivex.Scheduler) BleGattException(com.polidea.rxandroidble2.exceptions.BleGattException) ID_INPEN(com.eveningoutpost.dexdrip.insulin.inpen.InPenEntry.ID_INPEN) STORE_INPEN_INFOS(com.eveningoutpost.dexdrip.insulin.inpen.InPen.STORE_INPEN_INFOS) Build(android.os.Build) TimeRx(com.eveningoutpost.dexdrip.insulin.inpen.messages.TimeRx) SlidingWindowConstraint(com.eveningoutpost.dexdrip.utils.time.SlidingWindowConstraint) AUTHENTICATION(com.eveningoutpost.dexdrip.insulin.inpen.Constants.AUTHENTICATION) PRINTABLE_INFO_CHARACTERISTICS(com.eveningoutpost.dexdrip.insulin.inpen.Constants.PRINTABLE_INFO_CHARACTERISTICS) JoH.emptyString(com.eveningoutpost.dexdrip.Models.JoH.emptyString) BluetoothGattService(android.bluetooth.BluetoothGattService) PEN_TIME(com.eveningoutpost.dexdrip.insulin.inpen.Constants.PEN_TIME) RECORD_START(com.eveningoutpost.dexdrip.insulin.inpen.Constants.RECORD_START) GET_IDENTITY(com.eveningoutpost.dexdrip.insulin.inpen.InPenService.InPenState.GET_IDENTITY) JoH.msSince(com.eveningoutpost.dexdrip.Models.JoH.msSince) TimeUnit(java.util.concurrent.TimeUnit) BOND_BONDED(android.bluetooth.BluetoothDevice.BOND_BONDED) KeepAliveTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx) SECOND_IN_MS(com.eveningoutpost.dexdrip.UtilityModels.Constants.SECOND_IN_MS) MINUTE_IN_MS(com.eveningoutpost.dexdrip.UtilityModels.Constants.MINUTE_IN_MS) BleGattCharacteristicException(com.polidea.rxandroidble2.exceptions.BleGattCharacteristicException) RecordTx(com.eveningoutpost.dexdrip.insulin.inpen.messages.RecordTx) BleDisconnectedException(com.polidea.rxandroidble2.exceptions.BleDisconnectedException) SlidingWindowConstraint(com.eveningoutpost.dexdrip.utils.time.SlidingWindowConstraint)

Aggregations

KeepAliveTx (com.eveningoutpost.dexdrip.insulin.inpen.messages.KeepAliveTx)4 TargetApi (android.annotation.TargetApi)2 PendingIntent (android.app.PendingIntent)2 BluetoothDevice (android.bluetooth.BluetoothDevice)2 BOND_BONDED (android.bluetooth.BluetoothDevice.BOND_BONDED)2 BOND_NONE (android.bluetooth.BluetoothDevice.BOND_NONE)2 BluetoothGattCharacteristic (android.bluetooth.BluetoothGattCharacteristic)2 BluetoothGattService (android.bluetooth.BluetoothGattService)2 Intent (android.content.Intent)2 Build (android.os.Build)2 PowerManager (android.os.PowerManager)2 HexDump (com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.util.HexDump)2 HexDump.dumpHexString (com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.util.HexDump.dumpHexString)2 JoH (com.eveningoutpost.dexdrip.Models.JoH)2 JoH.bytesToHex (com.eveningoutpost.dexdrip.Models.JoH.bytesToHex)2 JoH.dateTimeText (com.eveningoutpost.dexdrip.Models.JoH.dateTimeText)2 JoH.emptyString (com.eveningoutpost.dexdrip.Models.JoH.emptyString)2 JoH.hourMinuteString (com.eveningoutpost.dexdrip.Models.JoH.hourMinuteString)2 JoH.msSince (com.eveningoutpost.dexdrip.Models.JoH.msSince)2 JoH.quietratelimit (com.eveningoutpost.dexdrip.Models.JoH.quietratelimit)2