From ea80eb3c9bf26b9da929457ab784cd7437ae34f8 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Sun, 12 Jul 2020 20:15:11 +0100 Subject: [PATCH] - created 2 modules: rileylink and medtronic - refactored some classes --- app/build.gradle | 2 + app/src/main/AndroidManifest.xml | 11 +- .../activities/MyPreferenceFragment.kt | 2 +- .../androidaps/db/DatabaseHelperProvider.java | 24 +++ .../dependencyInjection/ActivitiesModule.kt | 5 +- .../dependencyInjection/FragmentsModule.kt | 12 +- .../dependencyInjection/MedtronicModule.kt | 44 ++--- .../dependencyInjection/PluginsModule.kt | 2 +- .../dependencyInjection/ReceiversModule.kt | 4 +- .../dependencyInjection/ServicesModule.kt | 5 +- .../automation/actions/ActionLoopResume.kt | 1 - .../plugins/pump/combo/ComboPlugin.java | 1 - .../pump/medtronic/defs/PumpDeviceState.java | 30 --- .../EventMedtronicDeviceStatusChange.kt | 30 --- .../plugins/pump/omnipod/OmnipodFragment.kt | 18 +- .../pump/omnipod/OmnipodPumpPlugin.java | 5 + .../comm/OmnipodCommunicationManager.java | 2 +- .../omnipod/comm/message/OmnipodPacket.java | 2 - .../omnipod/data/RLHistoryItemOmnipod.java | 40 ++++ .../OmnipodCommunicationManagerInterface.java | 1 - .../pump/omnipod/defs/PodDeviceState.java | 2 +- .../omnipod/driver/OmnipodPumpStatus.java | 23 ++- .../driver/db/PodHistoryEntryType.java | 1 - .../events/EventOmnipodDeviceStatusChange.kt | 6 +- .../service/RileyLinkOmnipodService.java | 2 +- .../pump/omnipod/util/OmnipodUtil.java | 9 +- .../comm/OmnipodDashCommunicationManager.java | 1 - .../plugins/treatments/TreatmentsPlugin.java | 7 +- app/src/main/jniLibs/README.md | 1 + .../jniLibs/arm64-v8a/libBleCommandUtil.so | Bin 0 -> 14000 bytes .../jniLibs/armeabi-v7a/libBleCommandUtil.so | Bin 0 -> 13728 bytes .../main/jniLibs/armeabi/libBleCommandUtil.so | Bin 0 -> 13724 bytes .../main/jniLibs/mips/libBleCommandUtil.so | Bin 0 -> 71484 bytes .../main/jniLibs/mips64/libBleCommandUtil.so | Bin 0 -> 14808 bytes app/src/main/jniLibs/x86/libBleCommandUtil.so | Bin 0 -> 13668 bytes .../main/jniLibs/x86_64/libBleCommandUtil.so | Bin 0 -> 14272 bytes app/src/main/res/values/strings.xml | 178 ++---------------- .../pump/common/utils/DateTimeUtilUTest.java | 2 - .../comm/MedtronicConverterUTest.java | 9 - .../comm/MedtronicHistoryDataUTest.java | 13 -- .../MedtronicPumpHistoryDecoderUTest.java | 2 - .../history/pump/PumpHistoryEntryUTest.java | 1 - .../medtronic/data/dto/BasalProfileUTest.java | 11 -- core/build.gradle | 3 + .../events/EventCustomActionsChanged.kt | 0 .../androidaps/events/EventRefreshOverview.kt | 0 .../interfaces/DatabaseHelperInterface.kt | 12 +- .../interfaces/TreatmentsInterface.java | 3 + .../pump/common/PumpPluginAbstract.java | 12 +- .../plugins/pump/common/data/PumpStatus.java | 13 +- .../pump/common/data/TempBasalPair.java | 5 - .../pump/common/defs/PumpDeviceState.java | 29 +++ .../common/defs/PumpHistoryEntryGroup.java | 23 +-- .../common/dialog/RefreshableInterface.java | 0 .../common}/events/EventRefreshButtonState.kt | 2 +- .../plugins/pump/common/utils/ByteUtil.java | 0 .../plugins/pump/common/utils/CRC.java | 0 .../pump/common/utils/DateTimeUtil.java | 5 - .../pump/common/utils/ProfileUtil.java | 0 .../plugins/pump/common/utils/StringUtil.java | 0 .../plugins/pump/common/utils/ThreadUtil.java | 0 .../treatments/TreatmentUpdateReturn.java | 27 +++ core/src/main/res/values/strings.xml | 53 ++++++ medtronic/.gitignore | 1 + medtronic/build.gradle | 83 ++++++++ medtronic/consumer-rules.pro | 0 medtronic/proguard-rules.pro | 21 +++ .../medtronic/ExampleInstrumentedTest.java | 27 +++ medtronic/src/main/AndroidManifest.xml | 2 + .../pump/medtronic/MedtronicFragment.kt | 66 +++---- .../pump/medtronic/MedtronicPumpPlugin.java | 20 +- .../comm/MedtronicCommunicationManager.java | 7 +- .../medtronic/comm/MedtronicConverter.java | 0 .../comm/history/MedtronicHistoryDecoder.java | 0 .../MedtronicHistoryDecoderInterface.java | 0 .../comm/history/MedtronicHistoryEntry.java | 1 - .../MedtronicHistoryEntryInterface.java | 0 .../comm/history/RawHistoryPage.java | 0 .../comm/history/RecordDecodeStatus.java | 0 .../comm/history/cgms/CGMSHistoryEntry.java | 0 .../history/cgms/CGMSHistoryEntryType.java | 0 .../cgms/MedtronicCGMSHistoryDecoder.java | 0 .../pump/MedtronicPumpHistoryDecoder.java | 0 .../comm/history/pump/PumpHistoryEntry.java | 0 .../history/pump/PumpHistoryEntryType.java | 0 .../comm/history/pump/PumpHistoryResult.java | 0 .../comm/message/CarelinkLongMessageBody.java | 0 .../message/CarelinkShortMessageBody.java | 0 .../GetHistoryPageCarelinkMessageBody.java | 0 .../medtronic/comm/message/MessageBody.java | 0 .../medtronic/comm/message/PacketType.java | 0 .../comm/message/PumpAckMessageBody.java | 0 .../medtronic/comm/message/PumpMessage.java | 0 .../comm/message/UnknownMessageBody.java | 0 .../medtronic/comm/ui/MedtronicUIComm.java | 0 .../comm/ui/MedtronicUIPostprocessor.java | 0 .../medtronic/comm/ui/MedtronicUITask.java | 8 +- .../medtronic/data/MedtronicHistoryData.java | 38 ++-- .../pump/medtronic/data/dto/BasalProfile.java | 1 - .../medtronic/data/dto/BasalProfileEntry.java | 0 .../medtronic/data/dto/BatteryStatusDTO.java | 0 .../pump/medtronic/data/dto/BolusDTO.java | 0 .../medtronic/data/dto/BolusWizardDTO.java | 0 .../pump/medtronic/data/dto/ClockDTO.java | 0 .../medtronic/data/dto/DailyTotalsDTO.java | 60 +++--- .../medtronic/data/dto/PumpSettingDTO.java | 0 .../data/dto/PumpTimeStampedRecord.java | 0 .../data/dto/RLHistoryItemMedtronic.java | 41 ++++ .../medtronic/data/dto/TempBasalPair.java | 1 - .../data/dto/TempBasalProcessDTO.java | 0 .../medtronic/defs/BasalProfileStatus.java | 0 .../pump/medtronic/defs/BatteryType.java | 4 +- .../defs/CommandValueDefinitionMDTType.java | 0 .../medtronic/defs/MedtronicCommandType.java | 2 +- .../defs/MedtronicCustomActionType.java | 0 .../medtronic/defs/MedtronicDeviceType.java | 0 .../defs/MedtronicNotificationType.java | 6 +- .../defs/MedtronicStatusRefreshType.java | 0 .../defs/MedtronicUIResponseType.java | 0 .../pump/medtronic/defs/PumpBolusType.java | 0 .../defs/PumpConfigurationGroup.java | 0 .../dialog/MedtronicHistoryActivity.java | 2 +- .../RileyLinkStatusDeviceMedtronic.java | 2 +- .../medtronic/driver/MedtronicPumpStatus.java | 33 +++- .../EventMedtronicPumpConfigurationChanged.kt | 0 .../events/EventMedtronicPumpValuesChanged.kt | 0 .../service/RileyLinkMedtronicService.java | 14 +- .../pump/medtronic/util/MedtronicConst.java | 4 +- .../pump/medtronic/util/MedtronicUtil.java | 17 +- .../main/res/layout/medtronic_fragment.xml | 0 .../res/layout/medtronic_history_activity.xml | 0 .../res/layout/medtronic_history_item.xml | 0 medtronic/src/main/res/values/strings.xml | 117 ++++++++++++ .../src/main/res/xml/pref_medtronic.xml | 0 .../pump/medtronic/ExampleUnitTest.java | 17 ++ rileylink/.gitignore | 1 + rileylink/build.gradle | 81 ++++++++ rileylink/consumer-rules.pro | 0 rileylink/proguard-rules.pro | 21 +++ .../pump/common/ExampleInstrumentedTest.java | 27 +++ rileylink/src/main/AndroidManifest.xml | 20 ++ .../dialog/RileyLinkBLEScanActivity.java | 26 +-- .../EventRileyLinkDeviceStatusChange.kt | 28 +++ .../RileyLinkCommunicationManager.java | 2 +- .../common/hw/rileylink/RileyLinkConst.java | 12 +- .../common/hw/rileylink/RileyLinkUtil.java | 0 .../pump/common/hw/rileylink/ble/RFSpy.java | 9 +- .../common/hw/rileylink/ble/RFSpyReader.java | 0 .../common/hw/rileylink/ble/RileyLinkBLE.java | 0 .../ble/RileyLinkCommunicationException.java | 0 .../hw/rileylink/ble/command/GetVersion.java | 0 .../hw/rileylink/ble/command/Reset.java | 0 .../ble/command/ResetRadioConfig.java | 0 .../ble/command/RileyLinkCommand.java | 0 .../rileylink/ble/command/SendAndListen.java | 1 - .../ble/command/SetHardwareEncoding.java | 0 .../hw/rileylink/ble/command/SetPreamble.java | 1 - .../rileylink/ble/command/UpdateRegister.java | 0 .../ble/data/FrequencyScanResults.java | 0 .../hw/rileylink/ble/data/FrequencyTrial.java | 0 .../hw/rileylink/ble/data/GattAttributes.java | 0 .../hw/rileylink/ble/data/RFSpyResponse.java | 0 .../hw/rileylink/ble/data/RLMessage.java | 0 .../hw/rileylink/ble/data/RLMessageType.java | 0 .../hw/rileylink/ble/data/RadioPacket.java | 0 .../hw/rileylink/ble/data/RadioResponse.java | 2 +- .../ble/data/encoding/Encoding4b6b.java | 0 .../data/encoding/Encoding4b6bAbstract.java | 0 .../ble/data/encoding/Encoding4b6bGeoff.java | 1 - .../ble/data/encoding/Encoding4b6bGo.java | 1 - .../ble/data/encoding/Encoding4b6bLoop.java | 1 - .../hw/rileylink/ble/defs/CC111XRegister.java | 0 .../hw/rileylink/ble/defs/RFSpyCommand.java | 0 .../rileylink/ble/defs/RFSpyRLResponse.java | 0 .../hw/rileylink/ble/defs/RLMessageType.java | 0 .../hw/rileylink/ble/defs/RXFilterMode.java | 0 .../rileylink/ble/defs/RileyLinkBLEError.java | 0 .../ble/defs/RileyLinkCommandType.java | 0 .../ble/defs/RileyLinkEncodingType.java | 4 +- .../ble/defs/RileyLinkFirmwareVersion.java | 5 +- .../ble/defs/RileyLinkTargetFrequency.java | 0 .../ble/operations/BLECommOperation.java | 0 .../operations/BLECommOperationResult.java | 0 .../CharacteristicReadOperation.java | 0 .../CharacteristicWriteOperation.java | 0 .../operations/DescriptorWriteOperation.java | 0 .../hw/rileylink/data/BleAdvertisedData.java | 0 .../data/CommandValueDefinition.java | 0 .../hw/rileylink/data/RLHistoryItem.java | 67 ++++--- .../defs/CommandValueDefinitionRLType.java | 0 .../defs/CommandValueDefinitionType.java | 0 .../hw/rileylink/defs/RileyLinkError.java | 3 +- .../rileylink/defs/RileyLinkPumpDevice.java | 2 + .../rileylink/defs/RileyLinkServiceState.java | 3 +- .../rileylink/defs/RileyLinkTargetDevice.java | 3 +- .../dialog/RileyLinkStatusActivity.java | 3 +- .../dialog/RileyLinkStatusDevice.java | 3 +- .../RileyLinkStatusGeneralFragment.java | 45 ++--- .../RileyLinkStatusHistoryFragment.java | 6 +- .../RileyLinkBluetoothStateReceiver.kt | 0 .../service/RileyLinkBroadcastReceiver.java | 7 - .../rileylink/service/RileyLinkService.java | 4 +- .../service/RileyLinkServiceData.java | 6 +- .../service/data/ServiceCommand.java | 0 .../service/data/ServiceMessage.java | 0 .../service/data/ServiceNotification.java | 0 .../rileylink/service/data/ServiceResult.java | 0 .../service/data/ServiceTransport.java | 0 .../service/data/ServiceTransportType.java | 0 .../tasks/DiscoverGattServicesTask.java | 0 .../tasks/InitializePumpManagerTask.java | 0 .../hw/rileylink/service/tasks/PumpTask.java | 0 .../ResetRileyLinkConfigurationTask.java | 4 +- .../rileylink/service/tasks/ServiceTask.java | 0 .../service/tasks/ServiceTaskExecutor.java | 0 .../service/tasks/WakeAndTuneTask.java | 4 +- .../res/layout/rileylink_scan_activity.xml | 0 .../main/res/layout/rileylink_scan_item.xml | 0 .../src/main/res/layout/rileylink_status.xml | 0 .../res/layout/rileylink_status_device.xml | 0 .../layout/rileylink_status_device_item.xml | 0 .../res/layout/rileylink_status_general.xml | 0 .../res/layout/rileylink_status_history.xml | 0 .../layout/rileylink_status_history_item.xml | 0 .../main/res/menu/menu_rileylink_ble_scan.xml | 0 rileylink/src/main/res/values/strings.xml | 89 +++++++++ .../plugins/pump/common/ExampleUnitTest.java | 17 ++ settings.gradle | 3 +- 228 files changed, 1165 insertions(+), 638 deletions(-) delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpDeviceState.java delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicDeviceStatusChange.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/data/RLHistoryItemOmnipod.java create mode 100644 app/src/main/jniLibs/README.md create mode 100644 app/src/main/jniLibs/arm64-v8a/libBleCommandUtil.so create mode 100644 app/src/main/jniLibs/armeabi-v7a/libBleCommandUtil.so create mode 100644 app/src/main/jniLibs/armeabi/libBleCommandUtil.so create mode 100644 app/src/main/jniLibs/mips/libBleCommandUtil.so create mode 100644 app/src/main/jniLibs/mips64/libBleCommandUtil.so create mode 100644 app/src/main/jniLibs/x86/libBleCommandUtil.so create mode 100644 app/src/main/jniLibs/x86_64/libBleCommandUtil.so rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventCustomActionsChanged.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventRefreshOverview.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java (97%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java (91%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/TempBasalPair.java (93%) create mode 100644 core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.java rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.java (72%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RefreshableInterface.java (100%) rename {app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic => core/src/main/java/info/nightscout/androidaps/plugins/pump/common}/events/EventRefreshButtonState.kt (63%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/CRC.java (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java (98%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.java (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java (100%) create mode 100644 core/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentUpdateReturn.java create mode 100644 medtronic/.gitignore create mode 100644 medtronic/build.gradle create mode 100644 medtronic/consumer-rules.pro create mode 100644 medtronic/proguard-rules.pro create mode 100644 medtronic/src/androidTest/java/info/nightscout/androidaps/plugins/pump/medtronic/ExampleInstrumentedTest.java create mode 100644 medtronic/src/main/AndroidManifest.xml rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt (79%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java (99%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.java (99%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoderInterface.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.java (99%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntryInterface.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RecordDecodeStatus.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntryType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkLongMessageBody.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkShortMessageBody.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PacketType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpAckMessageBody.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/UnknownMessageBody.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.java (95%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java (97%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.java (99%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusWizardDTO.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/ClockDTO.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.java (83%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpSettingDTO.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.java (100%) create mode 100644 medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.java rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.java (98%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BasalProfileStatus.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java (91%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/CommandValueDefinitionMDTType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCommandType.java (99%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicDeviceType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.java (89%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicStatusRefreshType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicUIResponseType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpBolusType.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpConfigurationGroup.java (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java (99%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java (98%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java (87%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt (100%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java (96%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.java (94%) rename {app => medtronic}/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java (95%) rename {app => medtronic}/src/main/res/layout/medtronic_fragment.xml (100%) rename {app => medtronic}/src/main/res/layout/medtronic_history_activity.xml (100%) rename {app => medtronic}/src/main/res/layout/medtronic_history_item.xml (100%) create mode 100644 medtronic/src/main/res/values/strings.xml rename {app => medtronic}/src/main/res/xml/pref_medtronic.xml (100%) create mode 100644 medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/ExampleUnitTest.java create mode 100644 rileylink/.gitignore create mode 100644 rileylink/build.gradle create mode 100644 rileylink/consumer-rules.pro create mode 100644 rileylink/proguard-rules.pro create mode 100644 rileylink/src/androidTest/java/info/nightscout/androidaps/plugins/pump/common/ExampleInstrumentedTest.java create mode 100644 rileylink/src/main/AndroidManifest.xml rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java (95%) create mode 100644 rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java (99%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkConst.java (86%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java (98%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/GetVersion.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/Reset.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/ResetRadioConfig.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/RileyLinkCommand.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java (97%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetHardwareEncoding.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetPreamble.java (94%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/UpdateRegister.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyScanResults.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyTrial.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/GattAttributes.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RFSpyResponse.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessage.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessageType.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java (98%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6b.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java (99%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGo.java (99%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bLoop.java (99%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/CC111XRegister.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyCommand.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyRLResponse.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RLMessageType.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RXFilterMode.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkBLEError.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkCommandType.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java (95%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java (95%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkTargetFrequency.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperation.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperationResult.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/BleAdvertisedData.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/CommandValueDefinition.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java (62%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionRLType.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionType.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkError.java (95%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkPumpDevice.java (89%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkServiceState.java (98%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkTargetDevice.java (91%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java (98%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java (98%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java (79%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.java (97%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java (97%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java (97%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java (94%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceCommand.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceMessage.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceNotification.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceResult.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransport.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransportType.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/PumpTask.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java (91%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.java (100%) rename {app => rileylink}/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java (84%) rename {app => rileylink}/src/main/res/layout/rileylink_scan_activity.xml (100%) rename {app => rileylink}/src/main/res/layout/rileylink_scan_item.xml (100%) rename {app => rileylink}/src/main/res/layout/rileylink_status.xml (100%) rename {app => rileylink}/src/main/res/layout/rileylink_status_device.xml (100%) rename {app => rileylink}/src/main/res/layout/rileylink_status_device_item.xml (100%) rename {app => rileylink}/src/main/res/layout/rileylink_status_general.xml (100%) rename {app => rileylink}/src/main/res/layout/rileylink_status_history.xml (100%) rename {app => rileylink}/src/main/res/layout/rileylink_status_history_item.xml (100%) rename {app => rileylink}/src/main/res/menu/menu_rileylink_ble_scan.xml (100%) create mode 100644 rileylink/src/main/res/values/strings.xml create mode 100644 rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/ExampleUnitTest.java diff --git a/app/build.gradle b/app/build.gradle index 5ceed5c438..7bb7e61aec 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -239,6 +239,8 @@ dependencies { implementation project(':dana') implementation project(':danars') implementation project(':danar') + implementation project(':rileylink') + implementation project(':medtronic') implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.google.android.gms:play-services-wearable:17.0.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cb31b1ce3c..3dbee4a29c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -256,16 +256,7 @@ android:name=".plugins.pump.medtronic.service.RileyLinkMedtronicService" android:enabled="true" android:exported="true" /> - - - - - - - + diff --git a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt index 1d8740f631..706ad90ecb 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -76,7 +76,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang @Inject lateinit var insulinOrefFreePeakPlugin: InsulinOrefFreePeakPlugin @Inject lateinit var loopPlugin: LoopPlugin @Inject lateinit var localInsightPlugin: LocalInsightPlugin - @Inject lateinit var medtronicPumpPlugin: MedtronicPumpPlugin + @Inject lateinit var medtronicPumpPlugin: info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin @Inject lateinit var nsClientPlugin: NSClientPlugin @Inject lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin @Inject lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelperProvider.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelperProvider.java index d174f170f5..e888727984 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelperProvider.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelperProvider.java @@ -69,4 +69,28 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface { @Override public long roundDateToSec(long date) { return MainApp.getDbHelper().roundDateToSec(date); } + + @Override public void createOrUpdateTDD(@NotNull TDD record) { + MainApp.getDbHelper().createOrUpdateTDD(record); + } + + @Override public void createOrUpdate(@NotNull TemporaryBasal tempBasal) { + MainApp.getDbHelper().createOrUpdate(tempBasal); + } + + @NotNull @Override public TemporaryBasal findTempBasalByPumpId(long id) { + return MainApp.getDbHelper().findTempBasalByPumpId(id); + } + + @NotNull @Override public List getTemporaryBasalsDataFromTime(long mills, boolean ascending) { + return MainApp.getDbHelper().getTemporaryBasalsDataFromTime(mills, ascending); + } + + @NotNull @Override public CareportalEvent getCareportalEventFromTimestamp(long timestamp) { + return MainApp.getDbHelper().getCareportalEventFromTimestamp(timestamp); + } + + @NotNull @Override public List getTDDsForLastXDays(int days) { + return MainApp.getDbHelper().getTDDsForLastXDays(days); + } } diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt index 593d1e09e1..8608d86269 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt @@ -10,7 +10,6 @@ import info.nightscout.androidaps.plugins.general.maintenance.activities.PrefImp import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity import info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity import info.nightscout.androidaps.plugins.pump.common.dialog.RileyLinkBLEScanActivity -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity @@ -27,11 +26,11 @@ abstract class ActivitiesModule { @ContributesAndroidInjector abstract fun contributesInsightPairingInformationActivity(): InsightPairingInformationActivity @ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity @ContributesAndroidInjector abstract fun contributeMainActivity(): MainActivity - @ContributesAndroidInjector abstract fun contributesMedtronicHistoryActivity(): MedtronicHistoryActivity + @ContributesAndroidInjector abstract fun contributesMedtronicHistoryActivity(): info.nightscout.androidaps.plugins.pump.medtronic.dialog.MedtronicHistoryActivity @ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity @ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity @ContributesAndroidInjector abstract fun contributesRequestDexcomPermissionActivity(): RequestDexcomPermissionActivity - @ContributesAndroidInjector abstract fun contributesRileyLinkStatusActivity(): RileyLinkStatusActivity + @ContributesAndroidInjector abstract fun contributesRileyLinkStatusActivity(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity @ContributesAndroidInjector abstract fun contributesRileyLinkBLEScanActivity(): RileyLinkBLEScanActivity @ContributesAndroidInjector abstract fun contributesSetupWizardActivity(): SetupWizardActivity @ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt index 3fb97d8a32..46028b4161 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt @@ -10,7 +10,6 @@ import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBFragment import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderFragment import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog -import info.nightscout.androidaps.dialogs.NtpProgressDialog import info.nightscout.androidaps.plugins.general.actions.ActionsFragment import info.nightscout.androidaps.plugins.general.automation.AutomationFragment import info.nightscout.androidaps.plugins.general.automation.dialogs.ChooseActionDialog @@ -30,9 +29,6 @@ import info.nightscout.androidaps.plugins.insulin.InsulinFragment import info.nightscout.androidaps.plugins.profile.local.LocalProfileFragment import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment import info.nightscout.androidaps.plugins.pump.combo.ComboFragment -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusGeneralFragment -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment -import info.nightscout.androidaps.danars.dialogs.PairingProgressDialog import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic @@ -67,7 +63,7 @@ abstract class FragmentsModule { @ContributesAndroidInjector abstract fun contributesLocalInsightFragment(): LocalInsightFragment @ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment - @ContributesAndroidInjector abstract fun contributesMedtronicFragment(): MedtronicFragment + @ContributesAndroidInjector abstract fun contributesMedtronicFragment(): info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment @ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodFragment @ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment @ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment @@ -110,7 +106,7 @@ abstract class FragmentsModule { @ContributesAndroidInjector abstract fun contributesPasswordCheck(): PasswordCheck - @ContributesAndroidInjector abstract fun contributesRileyLinkStatusGeneral(): RileyLinkStatusGeneralFragment - @ContributesAndroidInjector abstract fun contributesRileyLinkStatusHistoryFragment(): RileyLinkStatusHistoryFragment - @ContributesAndroidInjector abstract fun contributesRileyLinkStatusDeviceMedtronic(): RileyLinkStatusDeviceMedtronic + @ContributesAndroidInjector abstract fun contributesRileyLinkStatusGeneral(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusGeneralFragment + @ContributesAndroidInjector abstract fun contributesRileyLinkStatusHistoryFragment(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment + @ContributesAndroidInjector abstract fun contributesRileyLinkStatusDeviceMedtronic(): info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/MedtronicModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/MedtronicModule.kt index 7166906611..454ef6800c 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/MedtronicModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/MedtronicModule.kt @@ -2,39 +2,25 @@ package info.nightscout.androidaps.dependencyInjection import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.plugins.general.automation.AutomationEvent -import info.nightscout.androidaps.plugins.general.automation.actions.* -import info.nightscout.androidaps.plugins.general.automation.elements.* -import info.nightscout.androidaps.plugins.general.automation.triggers.* -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SendAndListen -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SetPreamble -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.* import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask -import info.nightscout.androidaps.queue.CommandQueue -import info.nightscout.androidaps.queue.commands.* @Module @Suppress("unused") abstract class MedtronicModule { - @ContributesAndroidInjector abstract fun rileyLinkCommunicationManagerProvider(): RileyLinkCommunicationManager - @ContributesAndroidInjector abstract fun medtronicCommunicationManagerProvider(): MedtronicCommunicationManager - @ContributesAndroidInjector abstract fun medtronicUITaskProvider(): MedtronicUITask - @ContributesAndroidInjector abstract fun serviceTaskProvider(): ServiceTask - @ContributesAndroidInjector abstract fun pumpTaskProvider(): PumpTask - @ContributesAndroidInjector abstract fun discoverGattServicesTaskProvider(): DiscoverGattServicesTask - @ContributesAndroidInjector abstract fun initializePumpManagerTaskProvider(): InitializePumpManagerTask - @ContributesAndroidInjector abstract fun resetRileyLinkConfigurationTaskProvider(): ResetRileyLinkConfigurationTask - @ContributesAndroidInjector abstract fun wakeAndTuneTaskProvider(): WakeAndTuneTask - @ContributesAndroidInjector abstract fun radioResponseProvider(): RadioResponse - @ContributesAndroidInjector abstract fun rileyLinkBLEProvider(): RileyLinkBLE - @ContributesAndroidInjector abstract fun rfSpyProvider(): RFSpy - @ContributesAndroidInjector abstract fun sendAndListenProvider(): SendAndListen - @ContributesAndroidInjector abstract fun setPreambleProvider(): SetPreamble - @ContributesAndroidInjector abstract fun radioPacketProvider(): RadioPacket + @ContributesAndroidInjector abstract fun rileyLinkCommunicationManagerProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager + @ContributesAndroidInjector abstract fun medtronicCommunicationManagerProvider(): info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager + @ContributesAndroidInjector abstract fun medtronicUITaskProvider(): info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask + @ContributesAndroidInjector abstract fun serviceTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTask + @ContributesAndroidInjector abstract fun pumpTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.PumpTask + @ContributesAndroidInjector abstract fun discoverGattServicesTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.DiscoverGattServicesTask + @ContributesAndroidInjector abstract fun initializePumpManagerTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.InitializePumpManagerTask + @ContributesAndroidInjector abstract fun resetRileyLinkConfigurationTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask + @ContributesAndroidInjector abstract fun wakeAndTuneTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask + @ContributesAndroidInjector abstract fun radioResponseProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse + @ContributesAndroidInjector abstract fun rileyLinkBLEProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE + @ContributesAndroidInjector abstract fun rfSpyProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy + @ContributesAndroidInjector abstract fun sendAndListenProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SendAndListen + @ContributesAndroidInjector abstract fun setPreambleProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SetPreamble + @ContributesAndroidInjector abstract fun radioPacketProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/PluginsModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/PluginsModule.kt index f179580a55..40e2e91bd7 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/PluginsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/PluginsModule.kt @@ -145,7 +145,7 @@ abstract class PluginsModule { @PumpDriver @IntoMap @IntKey(150) - abstract fun bindMedtronicPumpPlugin(plugin: MedtronicPumpPlugin): PluginBase + abstract fun bindMedtronicPumpPlugin(plugin: info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin): PluginBase @Binds @NotNSClient diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ReceiversModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ReceiversModule.kt index 4c6e67608c..d92bc9262a 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ReceiversModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ReceiversModule.kt @@ -16,9 +16,9 @@ abstract class ReceiversModule { @ContributesAndroidInjector abstract fun contributesChargingStateReceiver(): ChargingStateReceiver @ContributesAndroidInjector abstract fun contributesDataReceiver(): DataReceiver @ContributesAndroidInjector abstract fun contributesKeepAliveReceiver(): KeepAliveReceiver - @ContributesAndroidInjector abstract fun contributesRileyLinkBluetoothStateReceiver(): RileyLinkBluetoothStateReceiver + @ContributesAndroidInjector abstract fun contributesRileyLinkBluetoothStateReceiver(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkBluetoothStateReceiver @ContributesAndroidInjector abstract fun contributesSmsReceiver(): SmsReceiver @ContributesAndroidInjector abstract fun contributesTimeDateOrTZChangeReceiver(): TimeDateOrTZChangeReceiver @ContributesAndroidInjector abstract fun contributesCarbSuggestionReceiver(): CarbSuggestionReceiver - @ContributesAndroidInjector abstract fun contributesRileyLinkBroadcastReceiver(): RileyLinkBroadcastReceiver + @ContributesAndroidInjector abstract fun contributesRileyLinkBroadcastReceiver(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkBroadcastReceiver } diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ServicesModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ServicesModule.kt index f961c3a863..fbf47a9ed2 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ServicesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ServicesModule.kt @@ -6,7 +6,6 @@ import info.nightscout.androidaps.plugins.general.nsclient.services.NSClientServ import info.nightscout.androidaps.plugins.general.overview.notifications.DismissNotificationService import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService import info.nightscout.androidaps.plugins.general.wear.wearintegration.WatchUpdaterService -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService @@ -28,7 +27,7 @@ abstract class ServicesModule { @ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): WatchUpdaterService @ContributesAndroidInjector abstract fun contributesInsightAlertService(): InsightAlertService @ContributesAndroidInjector abstract fun contributesInsightConnectionService(): InsightConnectionService - @ContributesAndroidInjector abstract fun contributesRileyLinkService(): RileyLinkService - @ContributesAndroidInjector abstract fun contributesRileyLinkMedtronicService(): RileyLinkMedtronicService + @ContributesAndroidInjector abstract fun contributesRileyLinkService(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService + @ContributesAndroidInjector abstract fun contributesRileyLinkMedtronicService(): info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService @ContributesAndroidInjector abstract fun contributesRileyLinkOmnipodService(): RileyLinkOmnipodService } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResume.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResume.kt index 4e155bcdcc..051e1c8bb0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResume.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResume.kt @@ -8,7 +8,6 @@ import info.nightscout.androidaps.events.EventRefreshOverview import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin -import info.nightscout.androidaps.plugins.general.nsclient.NSUpload import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.resources.ResourceHelper import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 50f40318d9..e443ac4657 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -20,7 +20,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.BuildConfig; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.DetailedBolusInfo; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpDeviceState.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpDeviceState.java deleted file mode 100644 index ba86963869..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpDeviceState.java +++ /dev/null @@ -1,30 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.medtronic.defs; - -import info.nightscout.androidaps.R; - -/** - * Created by andy on 6/11/18. - */ - -public enum PumpDeviceState { - - NeverContacted(R.string.medtronic_pump_status_never_contacted), // - Sleeping(R.string.medtronic_pump_status_sleeping), // - WakingUp(R.string.medtronic_pump_status_waking_up), // - Active(R.string.medtronic_pump_status_active), // - ErrorWhenCommunicating(R.string.medtronic_pump_status_error_comm), // - TimeoutWhenCommunicating(R.string.medtronic_pump_status_timeout_comm), // - // ProblemContacting(R.string.medtronic_pump_status_problem_contacting), // - PumpUnreachable(R.string.medtronic_pump_status_pump_unreachable), // - InvalidConfiguration(R.string.medtronic_pump_status_invalid_config); - - Integer resourceId; - - PumpDeviceState(int resourceId) { - this.resourceId = resourceId; - } - - public Integer getResourceId() { - return resourceId; - } -} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicDeviceStatusChange.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicDeviceStatusChange.kt deleted file mode 100644 index 37e6649252..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicDeviceStatusChange.kt +++ /dev/null @@ -1,30 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.medtronic.events - -import info.nightscout.androidaps.events.Event -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState - -class EventMedtronicDeviceStatusChange : Event { - - private var rileyLinkServiceState: RileyLinkServiceState? = null - private var rileyLinkError: RileyLinkError? = null - - private var pumpDeviceState: PumpDeviceState? = null - private var errorDescription: String? = null - - - constructor(rileyLinkServiceState: RileyLinkServiceState?, rileyLinkError: RileyLinkError?) { - this.rileyLinkServiceState = rileyLinkServiceState - this.rileyLinkError = rileyLinkError - } - - constructor(pumpDeviceState: PumpDeviceState?) { - this.pumpDeviceState = pumpDeviceState - } - - constructor(pumpDeviceState: PumpDeviceState?, errorDescription: String?) { - this.pumpDeviceState = pumpDeviceState - this.errorDescription = errorDescription - } -} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt index 843beed61f..000d6651c6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt @@ -85,7 +85,7 @@ class OmnipodFragment : DaggerFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - omnipod_rl_status.text = resourceHelper.gs(RileyLinkServiceState.NotStarted.getResourceId(RileyLinkTargetDevice.Omnipod)) + omnipod_rl_status.text = resourceHelper.gs(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState.NotStarted.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.Omnipod)) omnipod_pod_status.setTextColor(Color.WHITE) omnipod_pod_status.text = "{fa-bed}" @@ -114,7 +114,7 @@ class OmnipodFragment : DaggerFragment() { omnipod_stats.setOnClickListener { if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) { - startActivity(Intent(context, RileyLinkStatusActivity::class.java)) + startActivity(Intent(context, info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity::class.java)) } else { displayNotConfiguredDialog() } @@ -211,16 +211,16 @@ class OmnipodFragment : DaggerFragment() { aapsLogger.info(LTag.PUMP, "setDeviceStatus: [pumpStatus={}]", omnipodPumpStatus) - val resourceId = omnipodPumpStatus.rileyLinkServiceState.getResourceId(RileyLinkTargetDevice.Omnipod) + val resourceId = omnipodPumpStatus.rileyLinkServiceState.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.Omnipod) val rileyLinkError = omnipodPumpPlugin.rileyLinkService?.error omnipod_rl_status.text = when { - omnipodPumpStatus.rileyLinkServiceState == RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId) - omnipodPumpStatus.rileyLinkServiceState.isConnecting -> "{fa-bluetooth-b spin} " + resourceHelper.gs(resourceId) - omnipodPumpStatus.rileyLinkServiceState.isError && rileyLinkError == null -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId) - omnipodPumpStatus.rileyLinkServiceState.isError && rileyLinkError != null -> "{fa-bluetooth-b} " + resourceHelper.gs(rileyLinkError.getResourceId(RileyLinkTargetDevice.MedtronicPump)) - else -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId) + omnipodPumpStatus.rileyLinkServiceState == info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId) + omnipodPumpStatus.rileyLinkServiceState.isConnecting -> "{fa-bluetooth-b spin} " + resourceHelper.gs(resourceId) + omnipodPumpStatus.rileyLinkServiceState.isError && rileyLinkError == null -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId) + omnipodPumpStatus.rileyLinkServiceState.isError && rileyLinkError != null -> "{fa-bluetooth-b} " + resourceHelper.gs(rileyLinkError.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump)) + else -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId) } omnipod_rl_status.setTextColor(if (rileyLinkError != null) Color.RED else Color.WHITE) @@ -229,7 +229,7 @@ class OmnipodFragment : DaggerFragment() { omnipod_errors.text = omnipodPumpStatus.rileyLinkError?.let { - resourceHelper.gs(it.getResourceId(RileyLinkTargetDevice.Omnipod)) + resourceHelper.gs(it.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.Omnipod)) } ?: "-" val driverState = omnipodUtil.getDriverState(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index 76d39f7318..236d084ca8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -418,6 +418,11 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump rileyLinkOmnipodService.doTuneUpDevice(); } + @Override + public void triggerPumpConfigurationChangedEvent() { + rxBus.send(new EventOmnipodPumpValuesChanged()); + } + @Override public RileyLinkOmnipodService getRileyLinkService() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/OmnipodCommunicationManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/OmnipodCommunicationManager.java index 89b6a43559..31d3fbd531 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/OmnipodCommunicationManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/OmnipodCommunicationManager.java @@ -9,6 +9,7 @@ import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; @@ -17,7 +18,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMe import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkBLEError; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.OmnipodAction; import info.nightscout.androidaps.plugins.pump.omnipod.comm.exception.CommunicationException; import info.nightscout.androidaps.plugins.pump.omnipod.comm.exception.IllegalMessageAddressException; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/OmnipodPacket.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/OmnipodPacket.java index 157e72e51b..3764cf7b60 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/OmnipodPacket.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/OmnipodPacket.java @@ -1,7 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.comm.message; -import java.util.Arrays; - import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PacketType; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/data/RLHistoryItemOmnipod.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/data/RLHistoryItemOmnipod.java new file mode 100644 index 0000000000..ed4dcb6255 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/data/RLHistoryItemOmnipod.java @@ -0,0 +1,40 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.data; + +import org.joda.time.LocalDateTime; + +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; +import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType; +import info.nightscout.androidaps.utils.resources.ResourceHelper; + +public class RLHistoryItemOmnipod extends RLHistoryItem { + + private OmnipodCommandType omnipodCommandType; + + public RLHistoryItemOmnipod(OmnipodCommandType omnipodCommandType) { + super(new LocalDateTime(), RLHistoryItemSource.OmnipodCommand, RileyLinkTargetDevice.Omnipod); + this.omnipodCommandType = omnipodCommandType; + } + + public String getDescription(ResourceHelper resourceHelper) { + + switch (this.source) { + case RileyLink: + return "State: " + resourceHelper.gs(serviceState.getResourceId(targetDevice)) + + (this.errorCode == null ? "" : ", Error Code: " + errorCode); + + case MedtronicPump: + return resourceHelper.gs(pumpDeviceState.getResourceId()); + + case OmnipodCommand: + return omnipodCommandType.name(); + + default: + return "Unknown Description"; + } + } + + + +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java index d345a3c385..7ad3b58799 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java @@ -5,7 +5,6 @@ import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentPulseLog; -import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus; public interface OmnipodCommunicationManagerInterface { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodDeviceState.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodDeviceState.java index 5e903b5ae4..2670f63295 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodDeviceState.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodDeviceState.java @@ -5,7 +5,7 @@ import info.nightscout.androidaps.R; /** * Created by andy on 4.8.2019 */ - +// TODO remove this class and use PumpDeviceState instead public enum PodDeviceState { // FIXME diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/OmnipodPumpStatus.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/OmnipodPumpStatus.java index 1262304203..67fae56e08 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/OmnipodPumpStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/OmnipodPumpStatus.java @@ -8,14 +8,14 @@ import javax.inject.Singleton; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus; import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicDeviceStatusChange; +import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodDeviceState; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodConst; @@ -53,7 +53,7 @@ public class OmnipodPumpStatus extends PumpStatus { public String podNumber; public PodDeviceState podDeviceState = PodDeviceState.NeverContacted; - public boolean podAvailable = false; + public Boolean podAvailable = false; public boolean podAvailibityChecked = false; public boolean ackAlertsAvailable = false; public String ackAlertsText = null; @@ -101,6 +101,21 @@ public class OmnipodPumpStatus extends PumpStatus { return (this.errorDescription == null) ? "-" : this.errorDescription; } + @Override + public E getCustomData(String key, Class clazz) { + switch(key) { + case "POD_LOT_NUMBER": + return (E)podLotNumber; + + case "POD_AVAILABLE": + return (E)podAvailable; + + default: + return null; + } + + } + // public boolean setNotInPreInit() { // this.inPreInit = false; @@ -187,7 +202,7 @@ public class OmnipodPumpStatus extends PumpStatus { rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItem(pumpDeviceState, RileyLinkTargetDevice.Omnipod)); - rxBus.send(new EventMedtronicDeviceStatusChange(pumpDeviceState)); + rxBus.send(new EventRileyLinkDeviceStatusChange(pumpDeviceState)); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/db/PodHistoryEntryType.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/db/PodHistoryEntryType.java index e776de681f..981796b497 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/db/PodHistoryEntryType.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/db/PodHistoryEntryType.java @@ -1,6 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.db; -import androidx.annotation.IdRes; import androidx.annotation.StringRes; import java.util.HashMap; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/events/EventOmnipodDeviceStatusChange.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/events/EventOmnipodDeviceStatusChange.kt index db46550a05..4100ee3a8c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/events/EventOmnipodDeviceStatusChange.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/events/EventOmnipodDeviceStatusChange.kt @@ -11,14 +11,14 @@ import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionStat */ class EventOmnipodDeviceStatusChange : Event { - var rileyLinkServiceState: RileyLinkServiceState? = null - var rileyLinkError: RileyLinkError? = null + var rileyLinkServiceState: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState? = null + var rileyLinkError: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError? = null var podSessionState: PodSessionState? = null var errorDescription: String? = null var podDeviceState: PodDeviceState? = null @JvmOverloads - constructor(rileyLinkServiceState: RileyLinkServiceState?, rileyLinkError: RileyLinkError? = null) { + constructor(rileyLinkServiceState: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState?, rileyLinkError: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError? = null) { this.rileyLinkServiceState = rileyLinkServiceState this.rileyLinkError = rileyLinkError } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java index 908748b991..61fd548f7b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java @@ -14,6 +14,7 @@ import javax.inject.Inject; import info.nightscout.androidaps.R; import info.nightscout.androidaps.logging.LTag; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; @@ -23,7 +24,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.Rile import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin; import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodCommunicationManager; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/util/OmnipodUtil.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/util/OmnipodUtil.java index dfaa18bcaa..c79aa9fdb6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/util/OmnipodUtil.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/util/OmnipodUtil.java @@ -1,7 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.util; -import android.content.Context; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonDeserializer; @@ -17,8 +15,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.MainApp; -import info.nightscout.androidaps.R; import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; @@ -27,14 +23,15 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodManager; +import info.nightscout.androidaps.plugins.pump.omnipod.data.RLHistoryItemOmnipod; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodPodType; + import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodDeviceState; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodDriverState; import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus; import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodDeviceStatusChange; -import info.nightscout.androidaps.utils.alertDialogs.OKDialog; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.sharedPreferences.SP; @@ -103,7 +100,7 @@ public class OmnipodUtil { this.currentCommand = currentCommand; if (currentCommand != null) - rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItem(currentCommand)); + rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItemOmnipod(currentCommand)); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java index 39ccadd308..3247f02c8d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java @@ -12,7 +12,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunication import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitActionType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitReceiver; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; -import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus; /** * Created by andy on 4.8.2019 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPlugin.java index 68d1be2f23..3b49779bd3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPlugin.java @@ -8,7 +8,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.google.firebase.analytics.FirebaseAnalytics; -import com.google.gson.GsonBuilder; import org.jetbrains.annotations.NotNull; @@ -605,6 +604,12 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface return newRecordCreated; } + public TreatmentUpdateReturn createOrUpdateMedtronic(Treatment treatment, boolean fromNightScout) { + TreatmentService.UpdateReturn resultRecord = getService().createOrUpdateMedtronic(treatment, fromNightScout); + + return new TreatmentUpdateReturn(resultRecord.success, resultRecord.newRecord); + } + // return true if new record is created @Override public boolean addToHistoryTreatment(DetailedBolusInfo detailedBolusInfo, boolean allowUpdate) { diff --git a/app/src/main/jniLibs/README.md b/app/src/main/jniLibs/README.md new file mode 100644 index 0000000000..7041df4e10 --- /dev/null +++ b/app/src/main/jniLibs/README.md @@ -0,0 +1 @@ +# danars-support-lib \ No newline at end of file diff --git a/app/src/main/jniLibs/arm64-v8a/libBleCommandUtil.so b/app/src/main/jniLibs/arm64-v8a/libBleCommandUtil.so new file mode 100644 index 0000000000000000000000000000000000000000..69e283b5feb97bb8a055667ad99ef5a9da19f549 GIT binary patch literal 14000 zcmeHO3vg7|c|Lb9g1dXQ((a-Mh{rDY5orZND3I(nlWK+RB342Mq1dU1&ay~rY0>*( z2TX{BJx(Q-D%!>gX>kj7#uI6g08eGdZqgdujEf?NB2#-htvi72W`qUi5sX`x4m#6*zU&l%-<6`kYZ1^G*P0>r~y zYzF?%VCh=jr0YeWNWFNs&JvVqE%g7VqiFMDy?paxT?R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`(%!%JPz|&;6(c7cFpjKrsX>*uiFDRio*z|F!4)vLh zakV~i{wfOcnV`v_b3iSicF;8D?##Hp7GI-&GSJT*9`}0|yz!!+oUfoB`~*t(;Y~jq zz6A5}r7xL_!vQ7Ard`Z2( zv1ZA-_SRry%{TBn?Hu_V>+u5|eQ)yCJF(biP}jv+tPk{GL63kQ{9PpzC934@x0TCro;@f=S<EEeD1STLUV+;y zaC-%AufXjU_ybx2?nba0o)Gz#gnUOr{?8NgKS; zEi3=*b@KZ)I_D`^bTawP+Iile_!fK?Pl#`z`wV&m^1CQRd3{ySYTp)96274p4ldCv z@Mf%+^M!xKKQq<7S*D^+&Jg@so)EqQ|J-!)+hvg#ly}cQj>VcN&BbHac)o=92UqWg z^7A}z!4hKR@4khMR2tzYOZf*dH6yX|F<@2UxwxdYJCs2;(J+NZ8hqP9Lozf2HSo9)>i)(mWOYA zgCdR2{0+e>jMRi)^gi%$Da*sBwhe*CcClQ)Hzj>1RS|l9ge#h$Qy-$euoLp*i7(mgHL7Sq*pbLD zLxOBbv=??GD3wzX@{4+c7NLx6QsjkQ3hJQ72qZs^E#xO21$={{m5KHOCj=Gq6yuBb zg8v|Izk)hL5V#|#z$t2vw~Wd0MSCB3B$vR&M0@Q-S$q&UD`+(ed)f$WZ$N&OCUho)EN<^97;06a;PMX|aA&{XLA<2>&IH-*aYprIOFbdhKc0%Qf}A}!hp_J0EflR^Ff literal 0 HcmV?d00001 diff --git a/app/src/main/jniLibs/armeabi-v7a/libBleCommandUtil.so b/app/src/main/jniLibs/armeabi-v7a/libBleCommandUtil.so new file mode 100644 index 0000000000000000000000000000000000000000..0c717bc3e836ca2b3bc7a546fa4d7779e1f52334 GIT binary patch literal 13728 zcmeHOeRNdSwLkaHon$hZBsU)@hNw3o(%~!I0M@9iItgJC5bH<)(ZQ%j7FFDqhf*$<+y6BFJ75MLVSfod^ci*W)o#t3LU zzQ$~{<4}lxg80}is=F4=uN93ydNH*{HZvB7N^}s!=P$ziMEQ1Lj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Hwu}2 zmXO1Z<1W>W=W_Wg_yTScSI)7bwmN)=>~=0^MNQ3aR}sDuE?T~_zM*z{eJv}h?PzN2 zXpCZaD=VsVw$(9>CMNy`4LfGg{MeWs6QDdXiB?(~+^h&6eB*D3SA+^J8?Dlp$VIKq zwe$&b5k4cYw>w)~ogJ(QRd>7&PR_>q8m!U`9#L9+Xv~W6>3E~734LQaka4Du2}x@> z-MAMlU+H$W!9M?Np_qZIXy584{(p)1e2N_^`=7*d?DQI*PqX0O}(; zia`R3!FVBBDn$T_QyQY!B*5=}S{q2?M?7Z(C|-z;Vv6AVsK;3nCMX3^oKc-(j)3Ad zQ9d-84M1^7bQFsO66zPz;ddkLyJ(`L+(S@_I<={gY?OoQ0OYe}0Lobel*5RQ@=u(u z0d>+H!((xI9QAl1Ix6=7;&hZF2^?2yL)u?)I{a>^(a}0PzZZp`ugJ7@so4bpzZSxY z|DT2Sl1f~@UesybnE=Wu1cj)_3yl$M2H>5g*-QKXIoL?DL%hW0+lCIxpJZ3cl@8Fw z$B34AQP~9`n-HD$|9L=X#vrw+#O3=9>NJP?>D%u0GZ=HD9xrj;uc0GO$1G^b7p@zp zJAfgQoA?P90O-b}9xrjax6wiTFsv1#bH(a}XpG>G0E(k{X#gGhU%bTm9YF`yY>D@; a1zkzJ0ZhE85RTh`+WnyWD^+48PWL~3K&c}D literal 0 HcmV?d00001 diff --git a/app/src/main/jniLibs/armeabi/libBleCommandUtil.so b/app/src/main/jniLibs/armeabi/libBleCommandUtil.so new file mode 100644 index 0000000000000000000000000000000000000000..a51a8c7d9a16654b7d0e34c9d6e15b1a866b74f9 GIT binary patch literal 13724 zcmeHOeRNaTk-zUrwq;qyGPV}ukom}_UDzW^nq^b6wVUjooF+Zh2WlL{wjz**HU{l) zo+P3;X}jIC``^Bt@!Yw0?%bKVGjs0~FPraKY2i4Ir5_bDvNW{>oySf1!?UaI0VJ2kc_1sstr#aT zVvK;s(`zgNorX&E6Qsvh#e8ibKl3Q^(Tl0xJ@X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DCUWJ~ zkt^3+rGTp zcnQZ=XN~#%{f{j|@!r8Lq%cTt1vO>*GTD)=(M?U?`F7{cO-6URr{Cz!P}4}N zH$B)hL`{Q3*;EtCG<9!D_b2}#ousBdBhyDs$?b!g?E|*Xj*ykdnJ=>fain2-aeivb zrnY6BZ)LJuy7@yxNh51eQ>riCGhz&+;(bXJa6{CT9!zKB#>j}Votkc9F%1TId3b3+sOIY z=CPbYUN$!z$9dTHwL{qcaU9!77PgJ9LlMh$;4j-PPGXzIaxMJa7IqxZavOy09Q)bU zv1sr^S@xa3%dQVn4dHxjb6J>!TOa3RhJOO#HgI{i4=h~_)p6Vhc6UJBd~DBHEF*2D z+WlqkE+^j_Xn%t(-{J(vaUCpw?r3gbC-Sjug5Py+KORH`=jVKfkcXv}BOK@E+mA5s zTg;mGEEYG7v%3BX_<0#}KHke%n1k!we1C@sX2Rb+i99SV_%6q><9uB1IE0(S_3^&I z;xec$O(?)Z?bz8@;>I36~Ld)+S&bZi?Fu(>SXLfzIWY1&~Co}1MRzcO#lD@ literal 0 HcmV?d00001 diff --git a/app/src/main/jniLibs/mips64/libBleCommandUtil.so b/app/src/main/jniLibs/mips64/libBleCommandUtil.so new file mode 100644 index 0000000000000000000000000000000000000000..a8a292ea13037eccfe791f25e6526e8947b64a24 GIT binary patch literal 14808 zcmeHO4RBo5bw2OyYPB-{Sz{T5G5D>tE3XYJFUD!s#8Y-9gB=1?fT6C3X0_V4`YHO^ zN^3`ETv*u-XeMM>8N2iY7zl2gCL$0l0{Hbi z@7=q4T1(hYXs6S1HBaZ>bMLwL+;h)8_niCQ-hIvW*Q$y_GC9aiW@)yCiHM5+E3Hha zlX4LXQyE3*BB~$fLS~Z-fp2u zLP>WM=y-l-n>?c7&0@Tn+?MPNTDHo!MOI5|9pi1_qi20_7o|?Aj16E7f z&M=G*&Zgb8Z5S!~WBHZifj-i@8*in)!=HK8*-yMt_2++b(?|CiL*GbL+>5FLpIZgP zlJ6ZwI-cvzRp z@URX_J(!0)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;)Le~sp+8<-~w!#5V|uY1DsLqJ2zLD)#wAh9f8*N=#xO3mokWYD4e~`yk*TU+`qVC@YqY zup9pb9MuVaVLt>E_5&nl68lG#bC4mEBKU=U5%8y+P}Gb5#W)tBp7x%o7yDPhh12*2 zoq!(H)7}x*o1N-zc~K{JT46PG(OQL z-Bl1jeJ4lBSTGgx&B zk5QrEq4}jG&L{DII6_ZW?WF!ic{?(6)(L)be%*hAMIq)(&`&S_3KcYWf?u2q;{Tk) z|1*ht!7t>ZceJ?=E8b1?+98Tx&o5nBYbHZE;PN$z<-UBki z3HejPreconditions: - - Operation not supported by pump and/or driver. - Operation not YET supported by pump. - - - Medtronic - MDT - Pump integration for Medtronic, requires RileyLink device and specific Pump Model - - - pref_medtronic_serial - pref_medtronic_pump_type - pref_medtronic_frequency - pref_medtronic_max_bolus - pref_medtronic_max_basal - pref_medtronic_bolus_delay - pref_medtronic_encoding - pref_medtronic_battery_type - pref_medtronic_bolus_debug - pref_rileylink_mac_address - medtronic_pump_frequency_us_ca - medtronic_pump_frequency_worldwide - medtronic_pump_encoding_4b6b_local - medtronic_pump_encoding_4b6b_rileylink - medtronic_pump_battery_no - medtronic_pump_battery_alkaline - medtronic_pump_battery_lithium - medtronic_pump_battery_nizn - medtronic_pump_battery_nimh - - Pump Serial Number - Pump Type - Pump Frequency - Delay before Bolus is started (s) - Max Bolus on Pump (U) - Max Basal on Pump (U/h) - Medtronic Encoding - US & Canada (916 MHz) - Worldwide (868 Mhz) - Software 4b6b Encoding - Hardware 4b6b Encoding - Wake and Tune Up - Clear Bolus Block - Reset RileyLink Config - Battery Type (Power View) - Not selected (Simple view) - Alkaline (Extended view) - Lithium (Extended view) - NiZn (Extended view) - NiMH (Extended view) - Bolus/Treatments Debugging - - - SCAN - STOP - Selected - RileyLink Scan - Enable - No - Scanning - Scanning finished - Scanning error: %1$d - Never - - - Settings - History - RileyLink Status - Pump Status - RileyLink Settings - RileyLink - Configured Address - Connected Device - Connection Status - Connection Error - Device - Device Type - Device Model - Last used frequency - Last device contact - RL Firmware - - Bluetooth Initializing… - Bluetooth Error - Bluetooth Ready - Not Started - RileyLink Initialization… - RileyLink Error - Tuning up RileyLink and Pump - Problem connecting to Pump - Connected - - - Device is not RileyLink - RileyLink unreachable - Bluetooth disabled - No Bluetooth Adapter - TuneUp Failed - Pump unreachable - Pod unreachable - - - Medtronic Pump - Omnipod - - - - Errors - Serial # not set. - Serial # invalid. - Pump Type not set. - Pump Type unsupported. - Pump Frequency not set. - Pump Frequency unsupported. - RileyLink Address invalid. - Pump type detected is not the same as configured type. - - Basal profiles/patterns setting is not enabled on pump. Enable it on the pump. - Basal profile set on pump is incorrect (must be STD). - Wrong TBR type set on pump (must be Absolute). - Wrong Max Bolus set on Pump (must be %1$.2f). - Wrong Max Basal set on Pump (must be %1$.2f). - Operation is not possible.\n\n You need to configure Medtronic Pump first, before you can use this operation. - Over 24h Time change was requested. - - - Basals - Configurations - Notifications - Statistics - Unknowns - All - Medtronic Pump History - - - - Never contacted - Waking up - Error with communication - Timeout on communication - Pump unreachable - Invalid configuration - Active - Sleeping - - - You cancelled Bolus, after it was already set on Pump. Since Medtronic Pump doesn\'t support cancel, you will need to manually cancel it. Put the Pump into Suspend mode and then do Resume (if you still want to cancel). Application will pick up changes, on next update (in less than 5 minutes). - Could not read current TBR. - Could not cancel current TBR. Stopping operation. - Profile set failed, because following patterns, have too big basal rate: %1$s - Bolus could not be delivered. - Bolus could not be delivered, because available insulin amount (%1$.2f) is less than bolus required (%2$.2f). - TBR could not be set. - Could not cancel current TBR. - Basal profile could not be set. - Basal profile is the same, so it will not be set again. - - Get History - Page %1$d (%2$d/16) - Get History - Page %1$d - Get Pump Time - Get Settings - Get Pump Model - Get Basal Profile - Set Basal Profile - Get Temporary Basal - Set Temporary Basal - Set Bolus Change profile to Change profile to %1$s Last connection to pump @@ -1565,6 +1398,17 @@ Skin + + Never contacted + Waking up + Error with communication + Timeout on communication + Pump unreachable + Invalid configuration + Active + Sleeping + + diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtilUTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtilUTest.java index 5d069f0345..7b79c62e82 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtilUTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtilUTest.java @@ -6,8 +6,6 @@ import junit.framework.Assert; import org.junit.Test; -import static org.junit.Assert.*; - public class DateTimeUtilUTest { @Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverterUTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverterUTest.java index 1e10544e88..be499cdc97 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverterUTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverterUTest.java @@ -1,15 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm; -import java.util.Map; - import org.junit.Ignore; -import org.junit.Test; - -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType; -import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; /** * Created by andy on 1/30/19. diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.java index 824d9a3f1e..e02c4bab20 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.java @@ -1,18 +1,5 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm; -import android.util.Log; - -import org.junit.Before; - -import java.util.List; - -import info.nightscout.androidaps.R; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage; -import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder; -import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry; - -import static org.mockito.Mockito.when; //import uk.org.lidalia.slf4jtest.TestLogger; //import uk.org.lidalia.slf4jtest.TestLoggerFactory; diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.java index 0420dba922..3cfd7dc067 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.java @@ -1,10 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump; -import org.junit.Before; import org.junit.Ignore; import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; /** * Created by andy on 11/1/18. diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryUTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryUTest.java index c668f53f06..af8c7b0d0a 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryUTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryUTest.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump; import org.junit.Assert; -import org.junit.Test; import java.util.Date; diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileUTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileUTest.java index 21b98660d6..8b2eaa3e7e 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileUTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileUTest.java @@ -1,20 +1,9 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto; -import junit.framework.Assert; - -import org.junit.Before; import org.junit.Ignore; -import org.junit.Test; -import org.powermock.api.mockito.PowerMockito; -import info.nightscout.androidaps.interfaces.PumpDescription; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; -import info.nightscout.androidaps.utils.DateUtil; -import info.nightscout.androidaps.utils.T; - -import static org.mockito.Mockito.when; /** * Created by andy on 6/16/18. diff --git a/core/build.gradle b/core/build.gradle index 5f2fed073e..3b10b7b96f 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -75,6 +75,9 @@ dependencies { implementation "com.j256.ormlite:ormlite-core:${ormLiteVersion}" implementation "com.j256.ormlite:ormlite-android:${ormLiteVersion}" + // pumpCommon + implementation "com.google.code.gson:gson:2.8.6" + testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventCustomActionsChanged.kt b/core/src/main/java/info/nightscout/androidaps/events/EventCustomActionsChanged.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventCustomActionsChanged.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventCustomActionsChanged.kt diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventRefreshOverview.kt b/core/src/main/java/info/nightscout/androidaps/events/EventRefreshOverview.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventRefreshOverview.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventRefreshOverview.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/DatabaseHelperInterface.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/DatabaseHelperInterface.kt index fbaab3d3db..35226a2537 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/DatabaseHelperInterface.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/DatabaseHelperInterface.kt @@ -1,11 +1,7 @@ package info.nightscout.androidaps.interfaces import com.j256.ormlite.dao.CloseableIterator -import info.nightscout.androidaps.db.BgReading -import info.nightscout.androidaps.db.CareportalEvent -import info.nightscout.androidaps.db.DanaRHistoryRecord -import info.nightscout.androidaps.db.DbRequest -import info.nightscout.androidaps.db.TDD +import info.nightscout.androidaps.db.* interface DatabaseHelperInterface { @@ -21,4 +17,10 @@ interface DatabaseHelperInterface { fun deleteDbRequestbyMongoId(action: String, _id: String) fun getDbRequestInterator(): CloseableIterator fun roundDateToSec(date: Long): Long + fun createOrUpdateTDD(record: TDD) + fun createOrUpdate(tempBasal: TemporaryBasal) + fun findTempBasalByPumpId(id: Long) : TemporaryBasal + fun getTemporaryBasalsDataFromTime(mills: Long, ascending: Boolean) : List + fun getCareportalEventFromTimestamp(timestamp: Long): CareportalEvent + fun getTDDsForLastXDays(days: Int): List } \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/TreatmentsInterface.java b/core/src/main/java/info/nightscout/androidaps/interfaces/TreatmentsInterface.java index 8856f8a74e..8c8d7f026f 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/TreatmentsInterface.java +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/TreatmentsInterface.java @@ -14,6 +14,7 @@ import info.nightscout.androidaps.db.ProfileSwitch; import info.nightscout.androidaps.db.TempTarget; import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.db.Treatment; +import info.nightscout.androidaps.plugins.treatments.TreatmentUpdateReturn; /** * Created by mike on 14.06.2016. @@ -84,4 +85,6 @@ public interface TreatmentsInterface { long oldestDataAvailable(); + TreatmentUpdateReturn createOrUpdateMedtronic(Treatment treatment, boolean fromNightScout); + } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java index 6227d2ea2a..a4475886f6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java @@ -13,8 +13,7 @@ import org.json.JSONObject; import java.util.Date; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.BuildConfig; -import info.nightscout.androidaps.R; +import info.nightscout.androidaps.core.R; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.PumpEnactResult; @@ -37,7 +36,6 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewB import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus; import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; -import info.nightscout.androidaps.plugins.pump.medtronic.data.MedtronicHistoryData; import info.nightscout.androidaps.db.Treatment; import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.DecimalFormatter; @@ -118,7 +116,7 @@ public abstract class PumpPluginAbstract extends PumpPluginBase implements PumpI @Override protected void onStart() { super.onStart(); - // TODO: moved from constructor .... test if it works + initPumpStatusData(); Intent intent = new Intent(context, getServiceClass()); @@ -418,8 +416,8 @@ public abstract class PumpPluginAbstract extends PumpPluginBase implements PumpI // bolus needed, ask pump to deliver it return deliverBolus(detailedBolusInfo); } else { - if (MedtronicHistoryData.doubleBolusDebug) - aapsLogger.debug("DoubleBolusDebug: deliverTreatment::(carb only entry)"); + //if (MedtronicHistoryData.doubleBolusDebug) + // aapsLogger.debug("DoubleBolusDebug: deliverTreatment::(carb only entry)"); // no bolus required, carb only treatment activePlugin.getActiveTreatments().addToHistoryTreatment(detailedBolusInfo, true); @@ -433,7 +431,7 @@ public abstract class PumpPluginAbstract extends PumpPluginBase implements PumpI aapsLogger.debug(LTag.PUMP, "deliverTreatment: Carb only treatment."); return new PumpEnactResult(getInjector()).success(true).enacted(true).bolusDelivered(0d) - .carbsDelivered(detailedBolusInfo.carbs).comment(getResourceHelper().gs(R.string.virtualpump_resultok)); + .carbsDelivered(detailedBolusInfo.carbs).comment(getResourceHelper().gs(R.string.common_resultok)); } } finally { triggerUIChange(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java index 3c51b484e8..08c8e60d56 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java @@ -49,7 +49,7 @@ public abstract class PumpStatus { public int tempBasalRatio = 0; public int tempBasalRemainMin = 0; public Date tempBasalStart; - private PumpType pumpType; + public PumpType pumpType; //protected PumpDescription pumpDescription; @@ -69,9 +69,20 @@ public abstract class PumpStatus { this.lastConnection = System.currentTimeMillis(); } + public void setLastFailedCommunicationToNow() { this.lastErrorConnection = System.currentTimeMillis(); } + public abstract String getErrorInfo(); + + + public abstract E getCustomData(String key, Class clazz); + + public String getCustomDataAsString(String key) { + return getCustomData(key, String.class); + } + + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/TempBasalPair.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/TempBasalPair.java similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/TempBasalPair.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/TempBasalPair.java index 08ff0c3b49..5a1e0b4249 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/TempBasalPair.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/TempBasalPair.java @@ -2,11 +2,6 @@ package info.nightscout.androidaps.plugins.pump.common.data; import com.google.gson.annotations.Expose; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import info.nightscout.androidaps.logging.L; - public class TempBasalPair { @Expose diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.java new file mode 100644 index 0000000000..4a9814c490 --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.java @@ -0,0 +1,29 @@ +package info.nightscout.androidaps.plugins.pump.common.defs; + +import info.nightscout.androidaps.core.R; + +/** + * Created by andy on 6/11/18. + */ +public enum PumpDeviceState { + + NeverContacted(R.string.pump_status_never_contacted), // + Sleeping(R.string.pump_status_sleeping), // + WakingUp(R.string.pump_status_waking_up), // + Active(R.string.pump_status_active), // + ErrorWhenCommunicating(R.string.pump_status_error_comm), // + TimeoutWhenCommunicating(R.string.pump_status_timeout_comm), // + // ProblemContacting(R.string.medtronic_pump_status_problem_contacting), // + PumpUnreachable(R.string.pump_status_pump_unreachable), // + InvalidConfiguration(R.string.pump_status_invalid_config); + + Integer resourceId; + + PumpDeviceState(int resourceId) { + this.resourceId = resourceId; + } + + public Integer getResourceId() { + return resourceId; + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.java similarity index 72% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.java index 9958d290e4..d17244615f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.java @@ -3,7 +3,8 @@ package info.nightscout.androidaps.plugins.pump.common.defs; import java.util.ArrayList; import java.util.List; -import info.nightscout.androidaps.R; + +import info.nightscout.androidaps.core.R; import info.nightscout.androidaps.utils.resources.ResourceHelper; @@ -16,16 +17,16 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper; public enum PumpHistoryEntryGroup { - All(R.string.medtronic_history_group_all), - Bolus(R.string.danar_history_bolus), - Basal(R.string.medtronic_history_group_basal), - Prime(R.string.danar_history_prime), - Configuration(R.string.medtronic_history_group_configuration), - Alarm(R.string.danar_history_alarm), - Glucose(R.string.danar_history_glucose), - Notification(R.string.medtronic_history_group_notification), - Statistic(R.string.medtronic_history_group_statistic), - Unknown(R.string.medtronic_history_group_unknown), + All(R.string.history_group_all), + Bolus(R.string.history_group_bolus), + Basal(R.string.history_group_basal), + Prime(R.string.history_group_prime), + Configuration(R.string.history_group_configuration), + Alarm(R.string.history_group_alarm), + Glucose(R.string.history_group_glucose), + Notification(R.string.history_group_notification), + Statistic(R.string.history_group_statistic), + Unknown(R.string.history_group_unknown), ; private int resourceId; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RefreshableInterface.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RefreshableInterface.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RefreshableInterface.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RefreshableInterface.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventRefreshButtonState.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRefreshButtonState.kt similarity index 63% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventRefreshButtonState.kt rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRefreshButtonState.kt index 81b9af4ff3..54f4773141 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventRefreshButtonState.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRefreshButtonState.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.medtronic.events +package info.nightscout.androidaps.plugins.pump.common.events import info.nightscout.androidaps.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/CRC.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/CRC.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/CRC.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/CRC.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java index 20c19c644c..96063673da 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java @@ -6,15 +6,10 @@ package info.nightscout.androidaps.plugins.pump.common.utils; import org.joda.time.LocalDateTime; import org.joda.time.Minutes; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.Calendar; import java.util.GregorianCalendar; -import info.nightscout.androidaps.logging.L; -import info.nightscout.androidaps.logging.StacktraceLoggerWrapper; - /** * This is simple version of ATechDate, limited only to one format (yyyymmddHHMIss) */ diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentUpdateReturn.java b/core/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentUpdateReturn.java new file mode 100644 index 0000000000..42b71b0217 --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentUpdateReturn.java @@ -0,0 +1,27 @@ +package info.nightscout.androidaps.plugins.treatments; + +import info.nightscout.androidaps.db.Treatment; + +public class TreatmentUpdateReturn { + + public TreatmentUpdateReturn(boolean success, boolean newRecord) { + this.success = success; + this.newRecord = newRecord; + } + + boolean newRecord; + boolean success; + + @Override + public String toString() { + return "UpdateReturn [" + + "newRecord=" + newRecord + + ", success=" + success + + ']'; + } + +} + + + + diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 6a5bcfd214..e893703cea 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -220,4 +220,57 @@ Time detection + + Operation not supported by pump and/or driver. + Operation not YET supported by pump. + OK + + + Never contacted + Waking up + Error with communication + Timeout on communication + Pump unreachable + Invalid configuration + Active + Sleeping + + + Basals + Configurations + Notifications + Statistics + Unknowns + All + Boluses + Prime + Alarms + Glucose + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/medtronic/.gitignore b/medtronic/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/medtronic/.gitignore @@ -0,0 +1 @@ +/build diff --git a/medtronic/build.gradle b/medtronic/build.gradle new file mode 100644 index 0000000000..9551210275 --- /dev/null +++ b/medtronic/build.gradle @@ -0,0 +1,83 @@ +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-kapt' + +android { + compileSdkVersion 28 + + defaultConfig { + minSdkVersion 24 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles 'consumer-rules.pro' + } + + kotlinOptions { + jvmTarget = '1.8' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + debug { + testCoverageEnabled(project.hasProperty('coverage')) + } + firebaseDisable { + System.setProperty("disableFirebase", "true") + ext.enableCrashlytics = false + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation project(':core') + implementation project(':rileylink') + + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion" + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.legacy:legacy-support-v13:1.0.0' + implementation 'androidx.core:core-ktx:1.2.0' + implementation "androidx.preference:preference-ktx:1.1.1" + implementation "androidx.activity:activity-ktx:${activityVersion}" + implementation 'com.google.android.material:material:1.1.0' + + implementation "io.reactivex.rxjava2:rxandroid:${rxandroid_version}" + + // Graphview cannot be upgraded + implementation "com.jjoe64:graphview:4.0.1" + + implementation "com.joanzapata.iconify:android-iconify-fontawesome:2.2.2" + + // medtronic - start + implementation 'org.apache.commons:commons-lang3:3.10' + implementation 'net.danlew:android.joda:2.10.6' + implementation 'org.slf4j:slf4j-api:1.7.30' + implementation "com.google.code.gson:gson:2.8.6" + // medtronic - end + + implementation "com.google.dagger:dagger-android:$dagger_version" + implementation "com.google.dagger:dagger-android-support:$dagger_version" + annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version" + annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version" + kapt "com.google.dagger:dagger-android-processor:$dagger_version" + kapt "com.google.dagger:dagger-compiler:$dagger_version" + + testImplementation 'junit:junit:4.13' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} diff --git a/medtronic/consumer-rules.pro b/medtronic/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/medtronic/proguard-rules.pro b/medtronic/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/medtronic/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/medtronic/src/androidTest/java/info/nightscout/androidaps/plugins/pump/medtronic/ExampleInstrumentedTest.java b/medtronic/src/androidTest/java/info/nightscout/androidaps/plugins/pump/medtronic/ExampleInstrumentedTest.java new file mode 100644 index 0000000000..63cded8fe7 --- /dev/null +++ b/medtronic/src/androidTest/java/info/nightscout/androidaps/plugins/pump/medtronic/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package info.nightscout.androidaps.plugins.pump.medtronic; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("info.nightscout.androidaps.plugins.pump.medtronic.test", appContext.getPackageName()); + } +} diff --git a/medtronic/src/main/AndroidManifest.xml b/medtronic/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..35ba1d4ce4 --- /dev/null +++ b/medtronic/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt similarity index 79% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index da9a2321f6..079ab51586 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -8,8 +8,6 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.MainApp -import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventExtendedBolusChange import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.events.EventTempBasalChange @@ -18,20 +16,14 @@ import info.nightscout.androidaps.interfaces.CommandQueueProvider import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBusWrapper -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.medtronic.dialog.MedtronicHistoryActivity import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicDeviceStatusChange +import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventRefreshButtonState +import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.queue.events.EventQueueChanged @@ -49,7 +41,7 @@ import javax.inject.Inject class MedtronicFragment : DaggerFragment() { @Inject lateinit var aapsLogger: AAPSLogger - @Inject lateinit var mainApp: MainApp + //@Inject lateinit var mainApp: MainApp @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var resourceHelper: ResourceHelper @Inject lateinit var rxBus: RxBusWrapper @@ -57,10 +49,10 @@ class MedtronicFragment : DaggerFragment() { @Inject lateinit var activePlugin: ActivePluginProvider @Inject lateinit var medtronicPumpPlugin: MedtronicPumpPlugin @Inject lateinit var warnColors: WarnColors - @Inject lateinit var rileyLinkUtil: RileyLinkUtil + @Inject lateinit var rileyLinkUtil: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil @Inject lateinit var medtronicUtil: MedtronicUtil @Inject lateinit var medtronicPumpStatus: MedtronicPumpStatus - @Inject lateinit var rileyLinkServiceData: RileyLinkServiceData + @Inject lateinit var rileyLinkServiceData: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData private var disposable: CompositeDisposable = CompositeDisposable() @@ -83,7 +75,7 @@ class MedtronicFragment : DaggerFragment() { medtronic_pumpstatus.setBackgroundColor(resourceHelper.gc(R.color.colorInitializingBorder)) - medtronic_rl_status.text = resourceHelper.gs(RileyLinkServiceState.NotStarted.getResourceId(RileyLinkTargetDevice.MedtronicPump)) + medtronic_rl_status.text = resourceHelper.gs(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState.NotStarted.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump)) medtronic_pump_status.setTextColor(Color.WHITE) medtronic_pump_status.text = "{fa-bed}" @@ -112,7 +104,7 @@ class MedtronicFragment : DaggerFragment() { medtronic_stats.setOnClickListener { if (medtronicPumpPlugin.rileyLinkService?.verifyConfiguration() == true) { - startActivity(Intent(context, RileyLinkStatusActivity::class.java)) + startActivity(Intent(context, info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity::class.java)) } else { displayNotConfiguredDialog() } @@ -128,7 +120,7 @@ class MedtronicFragment : DaggerFragment() { .observeOn(AndroidSchedulers.mainThread()) .subscribe({ medtronic_refresh.isEnabled = it.newState }, { fabricPrivacy.logException(it) }) disposable += rxBus - .toObservable(EventMedtronicDeviceStatusChange::class.java) + .toObservable(EventRileyLinkDeviceStatusChange::class.java) .observeOn(AndroidSchedulers.mainThread()) .subscribe({ aapsLogger.debug(LTag.PUMP, "onStatusEvent(EventMedtronicDeviceStatusChange): $it") @@ -175,34 +167,34 @@ class MedtronicFragment : DaggerFragment() { @Synchronized private fun setDeviceStatus() { - val resourceId = rileyLinkServiceData.rileyLinkServiceState.getResourceId(RileyLinkTargetDevice.MedtronicPump) + val resourceId = rileyLinkServiceData.rileyLinkServiceState.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump) val rileyLinkError = medtronicPumpPlugin.rileyLinkService?.error medtronic_rl_status.text = when { - rileyLinkServiceData.rileyLinkServiceState == RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId) - rileyLinkServiceData.rileyLinkServiceState.isConnecting -> "{fa-bluetooth-b spin} " + resourceHelper.gs(resourceId) - rileyLinkServiceData.rileyLinkServiceState.isError && rileyLinkError == null -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId) - rileyLinkServiceData.rileyLinkServiceState.isError && rileyLinkError != null -> "{fa-bluetooth-b} " + resourceHelper.gs(rileyLinkError.getResourceId(RileyLinkTargetDevice.MedtronicPump)) - else -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId) + rileyLinkServiceData.rileyLinkServiceState == info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId) + rileyLinkServiceData.rileyLinkServiceState.isConnecting -> "{fa-bluetooth-b spin} " + resourceHelper.gs(resourceId) + rileyLinkServiceData.rileyLinkServiceState.isError && rileyLinkError == null -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId) + rileyLinkServiceData.rileyLinkServiceState.isError && rileyLinkError != null -> "{fa-bluetooth-b} " + resourceHelper.gs(rileyLinkError.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump)) + else -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId) } medtronic_rl_status.setTextColor(if (rileyLinkError != null) Color.RED else Color.WHITE) medtronic_errors.text = rileyLinkServiceData.rileyLinkError?.let { - resourceHelper.gs(it.getResourceId(RileyLinkTargetDevice.MedtronicPump)) + resourceHelper.gs(it.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump)) } ?: "-" when (medtronicPumpStatus.pumpDeviceState) { null, - PumpDeviceState.Sleeping -> medtronic_pump_status.text = "{fa-bed} " // + pumpStatus.pumpDeviceState.name()); - PumpDeviceState.NeverContacted, - PumpDeviceState.WakingUp, - PumpDeviceState.PumpUnreachable, - PumpDeviceState.ErrorWhenCommunicating, - PumpDeviceState.TimeoutWhenCommunicating, - PumpDeviceState.InvalidConfiguration -> medtronic_pump_status.text = " " + resourceHelper.gs(medtronicPumpStatus.pumpDeviceState.resourceId) + info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState.Sleeping -> medtronic_pump_status.text = "{fa-bed} " // + pumpStatus.pumpDeviceState.name()); + info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState.NeverContacted, + info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState.WakingUp, + info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState.PumpUnreachable, + info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState.ErrorWhenCommunicating, + info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState.TimeoutWhenCommunicating, + info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState.InvalidConfiguration -> medtronic_pump_status.text = " " + resourceHelper.gs(medtronicPumpStatus.pumpDeviceState.resourceId) - PumpDeviceState.Active -> { + info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState.Active -> { val cmd = medtronicUtil.getCurrentCommand() if (cmd == null) medtronic_pump_status.text = " " + resourceHelper.gs(medtronicPumpStatus.pumpDeviceState.resourceId) @@ -235,7 +227,7 @@ class MedtronicFragment : DaggerFragment() { private fun displayNotConfiguredDialog() { context?.let { - OKDialog.show(it, resourceHelper.gs(R.string.combo_warning), + OKDialog.show(it, resourceHelper.gs(R.string.medtronic_warning), resourceHelper.gs(R.string.medtronic_error_operation_not_possible_no_configuration), null) } } @@ -252,7 +244,7 @@ class MedtronicFragment : DaggerFragment() { val minAgo = DateUtil.minAgo(resourceHelper, medtronicPumpStatus.lastConnection) val min = (System.currentTimeMillis() - medtronicPumpStatus.lastConnection) / 1000 / 60 if (medtronicPumpStatus.lastConnection + 60 * 1000 > System.currentTimeMillis()) { - medtronic_lastconnection.setText(R.string.combo_pump_connected_now) + medtronic_lastconnection.setText(R.string.medtronic_pump_connected_now) medtronic_lastconnection.setTextColor(Color.WHITE) } else if (medtronicPumpStatus.lastConnection + 30 * 60 * 1000 < System.currentTimeMillis()) { @@ -260,13 +252,13 @@ class MedtronicFragment : DaggerFragment() { medtronic_lastconnection.text = resourceHelper.gs(R.string.minago, min) } else if (min < 1440) { val h = (min / 60).toInt() - medtronic_lastconnection.text = (resourceHelper.gq(R.plurals.objective_hours, h, h) + " " + medtronic_lastconnection.text = (resourceHelper.gq(R.plurals.duration_hours, h, h) + " " + resourceHelper.gs(R.string.ago)) } else { val h = (min / 60).toInt() val d = h / 24 // h = h - (d * 24); - medtronic_lastconnection.text = (resourceHelper.gq(R.plurals.objective_days, d, d) + " " + medtronic_lastconnection.text = (resourceHelper.gq(R.plurals.duration_days, d, d) + " " + resourceHelper.gs(R.string.ago)) } medtronic_lastconnection.setTextColor(Color.RED) @@ -285,13 +277,13 @@ class MedtronicFragment : DaggerFragment() { val unit = resourceHelper.gs(R.string.insulin_unit_shortname) val ago: String if (agoMsc < 60 * 1000) { - ago = resourceHelper.gs(R.string.combo_pump_connected_now) + ago = resourceHelper.gs(R.string.medtronic_pump_connected_now) } else if (bolusMinAgo < 60) { ago = DateUtil.minAgo(resourceHelper, medtronicPumpStatus.lastBolusTime.time) } else { ago = DateUtil.hourAgo(medtronicPumpStatus.lastBolusTime.time, resourceHelper) } - medtronic_lastbolus.text = resourceHelper.gs(R.string.combo_last_bolus, bolus, unit, ago) + medtronic_lastbolus.text = resourceHelper.gs(R.string.mdt_last_bolus, bolus, unit, ago) } else { medtronic_lastbolus.text = "" } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java index 89480fcdf3..9cd138f4d4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java @@ -30,13 +30,13 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.R; import info.nightscout.androidaps.activities.ErrorHelperActivity; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.db.TemporaryBasal; + import info.nightscout.androidaps.events.EventRefreshOverview; import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.interfaces.CommandQueueProvider; @@ -79,8 +79,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicNotificat import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicStatusRefreshType; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicUIResponseType; import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; +import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged; import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventRefreshButtonState; +import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState; import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; @@ -242,10 +243,16 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter return true; } - @Override public void doTuneUpDevice() { + @Override + public void doTuneUpDevice() { rileyLinkMedtronicService.doTuneUpDevice(); } + @Override + public void triggerPumpConfigurationChangedEvent() { + rxBus.send(new EventMedtronicPumpConfigurationChanged()); + } + private void migrateSettings() { if ("US (916 MHz)".equals(sp.getString(MedtronicConst.Prefs.PumpFrequency, "US (916 MHz)"))) { @@ -860,7 +867,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter Intent i = new Intent(context, ErrorHelperActivity.class); i.putExtra("soundid", R.raw.boluserror); i.putExtra("status", getResourceHelper().gs(R.string.medtronic_cmd_cancel_bolus_not_supported)); - i.putExtra("title", getResourceHelper().gs(R.string.combo_warning)); + i.putExtra("title", getResourceHelper().gs(R.string.medtronic_warning)); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); @@ -1538,7 +1545,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter Intent i = new Intent(context, ErrorHelperActivity.class); i.putExtra("soundid", R.raw.boluserror); i.putExtra("status", getResourceHelper().gs(R.string.medtronic_error_operation_not_possible_no_configuration)); - i.putExtra("title", getResourceHelper().gs(R.string.combo_warning)); + i.putExtra("title", getResourceHelper().gs(R.string.medtronic_warning)); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } @@ -1571,7 +1578,8 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter this.hasTimeDateOrTimeZoneChanged = true; } - @Override public boolean setNeutralTempAtFullHour() { + @Override + public boolean setNeutralTempAtFullHour() { return sp.getBoolean(R.string.key_set_neutral_temps, true); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.java index 3737dd0226..b71dec4621 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.java @@ -12,9 +12,9 @@ import java.util.Map; import javax.inject.Inject; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; @@ -24,8 +24,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMe import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType; -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil; @@ -48,7 +46,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalPair; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; @@ -151,6 +148,8 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager PumpDeviceState state = medtronicPumpStatus.getPumpDeviceState(); + // check connection + byte[] pumpMsgContent = createPumpMessageContent(RLMessageType.ReadSimpleData); // simple RFSpyResponse rfSpyResponse = rfspy.transmitThenReceive(new RadioPacket(injector, pumpMsgContent), (byte) 0, (byte) 200, (byte) 0, (byte) 0, 25000, (byte) 0); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoderInterface.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoderInterface.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoderInterface.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoderInterface.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.java index fb42eca31c..b59dce7113 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.java @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history; import com.google.gson.annotations.Expose; import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.List; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntryInterface.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntryInterface.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntryInterface.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntryInterface.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RecordDecodeStatus.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RecordDecodeStatus.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RecordDecodeStatus.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RecordDecodeStatus.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntryType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntryType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntryType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntryType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntryType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkLongMessageBody.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkLongMessageBody.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkLongMessageBody.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkLongMessageBody.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkShortMessageBody.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkShortMessageBody.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkShortMessageBody.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/CarelinkShortMessageBody.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PacketType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PacketType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PacketType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PacketType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpAckMessageBody.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpAckMessageBody.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpAckMessageBody.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpAckMessageBody.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/UnknownMessageBody.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/UnknownMessageBody.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/UnknownMessageBody.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/UnknownMessageBody.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.java index 51a8020fcd..fedacfd117 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.java @@ -8,15 +8,15 @@ import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager; import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry; import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BasalProfile; import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalPair; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicUIResponseType; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicDeviceStatusChange; +import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; @@ -201,10 +201,10 @@ public class MedtronicUITask { } if (responseType == MedtronicUIResponseType.Invalid) { - rxBus.send(new EventMedtronicDeviceStatusChange(PumpDeviceState.ErrorWhenCommunicating, + rxBus.send(new EventRileyLinkDeviceStatusChange(PumpDeviceState.ErrorWhenCommunicating, "Unsupported command in MedtronicUITask")); } else if (responseType == MedtronicUIResponseType.Error) { - rxBus.send(new EventMedtronicDeviceStatusChange(PumpDeviceState.ErrorWhenCommunicating, + rxBus.send(new EventRileyLinkDeviceStatusChange(PumpDeviceState.ErrorWhenCommunicating, errorDescription)); } else { rxBus.send(new EventMedtronicPumpValuesChanged()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java index 76f011da16..5c2489a5ef 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java @@ -22,7 +22,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.db.CareportalEvent; import info.nightscout.androidaps.db.DbObjectBase; @@ -31,6 +30,7 @@ import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.db.TDD; import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.interfaces.ActivePluginProvider; +import info.nightscout.androidaps.interfaces.DatabaseHelperInterface; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.general.nsclient.NSUpload; @@ -52,8 +52,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; import info.nightscout.androidaps.db.Treatment; -import info.nightscout.androidaps.plugins.treatments.TreatmentService; -import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; +import info.nightscout.androidaps.plugins.treatments.TreatmentUpdateReturn; import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.Round; import info.nightscout.androidaps.utils.sharedPreferences.SP; @@ -81,6 +80,7 @@ public class MedtronicHistoryData { private final NSUpload nsUpload; private final MedtronicUtil medtronicUtil; private final MedtronicPumpHistoryDecoder medtronicPumpHistoryDecoder; + private final DatabaseHelperInterface databaseHelper; private List allHistory; private List newHistory = null; @@ -98,8 +98,10 @@ public class MedtronicHistoryData { * Double bolus debug. We seem to have small problem with double Boluses (or sometimes also missing boluses * from history. This flag turns on debugging for that (default is off=false)... Debuging is pretty detailed, * so log files will get bigger. + * Note: June 2020. Since this seems to be fixed, I am disabling this per default. I will leave code inside + * in case we need it again. Code that turns this on is commented out RileyLinkMedtronicService#verifyConfiguration() */ - public static boolean doubleBolusDebug = false; + public static final boolean doubleBolusDebug = false; @Inject public MedtronicHistoryData( @@ -109,7 +111,8 @@ public class MedtronicHistoryData { ActivePluginProvider activePlugin, NSUpload nsUpload, MedtronicUtil medtronicUtil, - MedtronicPumpHistoryDecoder medtronicPumpHistoryDecoder + MedtronicPumpHistoryDecoder medtronicPumpHistoryDecoder, + DatabaseHelperInterface databaseHelperInterface ) { this.allHistory = new ArrayList<>(); @@ -120,6 +123,7 @@ public class MedtronicHistoryData { this.nsUpload = nsUpload; this.medtronicUtil = medtronicUtil; this.medtronicPumpHistoryDecoder = medtronicPumpHistoryDecoder; + this.databaseHelper = databaseHelperInterface; } private Gson gson() { @@ -532,7 +536,7 @@ public class MedtronicHistoryData { private void uploadCareportalEvent(long date, String event) { - if (MainApp.getDbHelper().getCareportalEventFromTimestamp(date) != null) + if (databaseHelper.getCareportalEventFromTimestamp(date) != null) return; try { JSONObject data = new JSONObject(); @@ -545,7 +549,7 @@ public class MedtronicHistoryData { careportalEvent.source = Source.USER; careportalEvent.eventType = event; careportalEvent.json = data.toString(); - MainApp.getDbHelper().createOrUpdate(careportalEvent); + databaseHelper.createOrUpdate(careportalEvent); nsUpload.uploadCareportalEntryToNS(data); } catch (JSONException e) { aapsLogger.error("Unhandled exception", e); @@ -559,7 +563,7 @@ public class MedtronicHistoryData { aapsLogger.debug(LTag.PUMP, getLogPrefix() + "TDDs found: {}.\n{}", tdds.size(), gson().toJson(tdds)); - List tddsDb = MainApp.getDbHelper().getTDDsForLastXDays(3); + List tddsDb = databaseHelper.getTDDsForLastXDays(3); for (PumpHistoryEntry tdd : tdds) { @@ -575,7 +579,7 @@ public class MedtronicHistoryData { aapsLogger.debug(LTag.PUMP, "TDD Add: {}", tddNew); - MainApp.getDbHelper().createOrUpdateTDD(tddNew); + databaseHelper.createOrUpdateTDD(tddNew); } else { @@ -584,7 +588,7 @@ public class MedtronicHistoryData { aapsLogger.debug(LTag.PUMP, "TDD Edit: {}", tddDbEntry); - MainApp.getDbHelper().createOrUpdateTDD(tddDbEntry); + databaseHelper.createOrUpdateTDD(tddDbEntry); } } } @@ -745,7 +749,7 @@ public class MedtronicHistoryData { tempBasal.durationInMinutes = tempBasalProcessDTO.getDuration(); - MainApp.getDbHelper().createOrUpdate(tempBasal); + databaseHelper.createOrUpdate(tempBasal); aapsLogger.debug(LTag.PUMP, "Edit " + ProcessHistoryRecord.TBR.getDescription() + " - (entryFromDb={}) ", tempBasal); } else { @@ -793,7 +797,7 @@ public class MedtronicHistoryData { } } - TemporaryBasal tempBasal = MainApp.getDbHelper().findTempBasalByPumpId(pumpId); + TemporaryBasal tempBasal = databaseHelper.findTempBasalByPumpId(pumpId); return tempBasal; } @@ -884,7 +888,7 @@ public class MedtronicHistoryData { if (processHistoryRecord == ProcessHistoryRecord.Bolus) { return activePlugin.getActiveTreatments().getTreatmentsFromHistoryAfterTimestamp(startTimestamp); } else { - return MainApp.getDbHelper().getTemporaryBasalsDataFromTime(startTimestamp, true); + return databaseHelper.getTemporaryBasalsDataFromTime(startTimestamp, true); } } @@ -992,7 +996,7 @@ public class MedtronicHistoryData { treatment.pumpId = bolus.getPumpId(); treatment.insulin = bolusDTO.getDeliveredAmount(); - TreatmentService.UpdateReturn updateReturn = ((TreatmentsPlugin) activePlugin.getActiveTreatments()).getService().createOrUpdateMedtronic(treatment, false); + TreatmentUpdateReturn updateReturn = activePlugin.getActiveTreatments().createOrUpdateMedtronic(treatment, false); if (doubleBolusDebug) aapsLogger.debug(LTag.PUMP, "DoubleBolusDebug: addBolus(tretament!=null): NewTreatment={}, UpdateReturn={}", treatment, updateReturn); @@ -1042,7 +1046,7 @@ public class MedtronicHistoryData { treatment.setLinkedObject(temporaryBasalDb); - MainApp.getDbHelper().createOrUpdate(temporaryBasalDb); + databaseHelper.createOrUpdate(temporaryBasalDb); aapsLogger.debug(LTag.PUMP, operation + " - [date={},pumpId={}, rate={} {}, duration={}]", // temporaryBasalDb.date, // @@ -1058,7 +1062,7 @@ public class MedtronicHistoryData { for (TempBasalProcessDTO tempBasalProcess : tempBasalProcessList) { - TemporaryBasal tempBasal = MainApp.getDbHelper().findTempBasalByPumpId(tempBasalProcess.itemOne.getPumpId()); + TemporaryBasal tempBasal = databaseHelper.findTempBasalByPumpId(tempBasalProcess.itemOne.getPumpId()); if (tempBasal == null) { // add @@ -1074,7 +1078,7 @@ public class MedtronicHistoryData { tempBasalProcess.itemOne.setLinkedObject(tempBasal); tempBasalProcess.itemTwo.setLinkedObject(tempBasal); - MainApp.getDbHelper().createOrUpdate(tempBasal); + databaseHelper.createOrUpdate(tempBasal); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.java index f5ff77cf72..c3f2050805 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.java @@ -8,7 +8,6 @@ import java.util.ArrayList; import java.util.List; import info.nightscout.androidaps.logging.AAPSLogger; -import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusWizardDTO.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusWizardDTO.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusWizardDTO.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusWizardDTO.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/ClockDTO.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/ClockDTO.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/ClockDTO.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/ClockDTO.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.java similarity index 83% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.java index 8ca17e152f..902686ff19 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.java @@ -1,14 +1,10 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto; -import com.google.common.base.MoreObjects; import com.google.gson.annotations.Expose; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.commons.lang3.builder.ToStringBuilder; import info.nightscout.androidaps.db.TDD; -import info.nightscout.androidaps.logging.L; -import info.nightscout.androidaps.logging.StacktraceLoggerWrapper; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil; import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil; @@ -212,35 +208,35 @@ public class DailyTotalsDTO { @Override public String toString() { - return MoreObjects.toStringHelper(this) // - .add("bgAvg", bgAvg) // - .add("bgLow", bgLow) // - .add("bgHigh", bgHigh) // - .add("bgCount", bgCount) // - .add("sensorAvg", sensorAvg) // - .add("sensorMin", sensorMin) // - .add("sensorMax", sensorMax) // - .add("sensorCalcCount", sensorCalcCount) // - .add("sensorDataCount", sensorDataCount) // - .add("insulinTotal", insulinTotal) // - .add("insulinBasal", insulinBasal) // - .add("insulinBolus", insulinBolus) // - .add("insulinCarbs", insulinCarbs) // - .add("bolusTotal", bolusTotal) // - .add("bolusFood", bolusFood) // - .add("bolusCorrection", bolusCorrection) // - .add("bolusManual", bolusManual) // - .add("bolusCount", bolusCount) // - .add("bolusCountFoodOrCorr", bolusCountFoodOrCorr) // - .add("bolusCountFoodAndCorr", bolusCountFoodAndCorr) // - .add("bolusCountFood", bolusCountFood) // - .add("bolusCountCorr", bolusCountCorr) // - .add("bolusCountManual", bolusCountManual) // - .omitNullValues() // - .toString(); + return "DailyTotalsDTO [" + + "bgAvg=" + bgAvg + + ", bgLow=" + bgLow + + ", bgHigh=" + bgHigh + + ", bgCount=" + bgCount + + ", sensorAvg=" + sensorAvg + + ", sensorMin=" + sensorMin + + ", sensorMax=" + sensorMax + + ", sensorCalcCount=" + sensorCalcCount + + ", sensorDataCount=" + sensorDataCount + + ", insulinTotal=" + insulinTotal + + ", insulinBasal=" + insulinBasal + + ", insulinBolus=" + insulinBolus + + ", insulinCarbs=" + insulinCarbs + + ", bolusTotal=" + bolusTotal + + ", bolusFood=" + bolusFood + + ", bolusFoodAndCorr=" + bolusFoodAndCorr + + ", bolusCorrection=" + bolusCorrection + + ", bolusManual=" + bolusManual + + ", bolusCount=" + bolusCount + + ", bolusCountFoodOrCorr=" + bolusCountFoodOrCorr + + ", bolusCountFoodAndCorr=" + bolusCountFoodAndCorr + + ", bolusCountManual=" + bolusCountManual + + ", bolusCountFood=" + bolusCountFood + + ", bolusCountCorr=" + bolusCountCorr + + ", entry=" + entry + + ']'; } - public void setTDD(TDD tdd) { tdd.date = DateTimeUtil.toMillisFromATD(this.entry.atechDateTime); tdd.basal = insulinBasal; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpSettingDTO.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpSettingDTO.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpSettingDTO.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpSettingDTO.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.java diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.java new file mode 100644 index 0000000000..399f58e8ac --- /dev/null +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.java @@ -0,0 +1,41 @@ +package info.nightscout.androidaps.plugins.pump.medtronic.data.dto; + +import org.joda.time.LocalDateTime; + +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError; +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState; +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; +import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType; +import info.nightscout.androidaps.utils.resources.ResourceHelper; + +public class RLHistoryItemMedtronic extends RLHistoryItem { + + private MedtronicCommandType medtronicCommandType; + + public RLHistoryItemMedtronic(MedtronicCommandType medtronicCommandType) { + super(new LocalDateTime(), RLHistoryItemSource.MedtronicCommand, RileyLinkTargetDevice.MedtronicPump); + this.medtronicCommandType = medtronicCommandType; + } + + public String getDescription(ResourceHelper resourceHelper) { + + switch (this.source) { + case RileyLink: + return "State: " + resourceHelper.gs(serviceState.getResourceId(targetDevice)) + + (this.errorCode == null ? "" : ", Error Code: " + errorCode); + + case MedtronicPump: + return resourceHelper.gs(pumpDeviceState.getResourceId()); + + case MedtronicCommand: + return medtronicCommandType.name(); + + default: + return "Unknown Description"; + } + } + + + +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.java index bf3e771b1e..983f428a8f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.java @@ -7,7 +7,6 @@ import java.util.List; import java.util.Locale; import info.nightscout.androidaps.logging.AAPSLogger; -import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BasalProfileStatus.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BasalProfileStatus.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BasalProfileStatus.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BasalProfileStatus.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java index 7552b50d7f..503074e640 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java @@ -5,8 +5,8 @@ import androidx.annotation.StringRes; import java.util.HashMap; import java.util.Map; -import info.nightscout.androidaps.MainApp; -import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.pump.medtronic.R; + /** * Created by andy on 6/4/18. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/CommandValueDefinitionMDTType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/CommandValueDefinitionMDTType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/CommandValueDefinitionMDTType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/CommandValueDefinitionMDTType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCommandType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCommandType.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCommandType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCommandType.java index 516085269a..0c14ac42f8 100755 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCommandType.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCommandType.java @@ -4,7 +4,7 @@ import java.io.Serializable; import java.util.HashMap; import java.util.Map; -import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.pump.medtronic.R; import info.nightscout.androidaps.plugins.pump.medtronic.comm.message.MessageBody; import info.nightscout.androidaps.plugins.pump.medtronic.comm.message.PumpAckMessageBody; import info.nightscout.androidaps.plugins.pump.medtronic.comm.message.UnknownMessageBody; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicDeviceType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicDeviceType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicDeviceType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicDeviceType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.java index d11d6ad64c..c472ad3520 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.defs; -import info.nightscout.androidaps.R; import info.nightscout.androidaps.plugins.general.overview.notifications.Notification; +import info.nightscout.androidaps.plugins.pump.medtronic.R; /** * Created by andy on 10/15/18. @@ -16,8 +16,8 @@ public enum MedtronicNotificationType { PumpWrongTBRTypeSet(R.string.medtronic_error_pump_wrong_tbr_type_set, Notification.URGENT), // PumpWrongMaxBolusSet(R.string.medtronic_error_pump_wrong_max_bolus_set, Notification.NORMAL), // PumpWrongMaxBasalSet(R.string.medtronic_error_pump_wrong_max_basal_set, Notification.NORMAL), // - PumpWrongTimeUrgent(R.string.combo_notification_check_time_date, Notification.URGENT), - PumpWrongTimeNormal(R.string.combo_notification_check_time_date, Notification.NORMAL), + PumpWrongTimeUrgent(R.string.medtronic_notification_check_time_date, Notification.URGENT), + PumpWrongTimeNormal(R.string.medtronic_notification_check_time_date, Notification.NORMAL), TimeChangeOver24h(Notification.OVER_24H_TIME_CHANGE_REQUESTED, R.string.medtronic_error_pump_24h_time_change_requested, Notification.URGENT), // ; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicStatusRefreshType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicStatusRefreshType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicStatusRefreshType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicStatusRefreshType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicUIResponseType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicUIResponseType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicUIResponseType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicUIResponseType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpBolusType.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpBolusType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpBolusType.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpBolusType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpConfigurationGroup.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpConfigurationGroup.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpConfigurationGroup.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/PumpConfigurationGroup.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java index 1d5d300b49..fc986f4f83 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java @@ -18,9 +18,9 @@ import java.util.List; import javax.inject.Inject; -import info.nightscout.androidaps.R; import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup; +import info.nightscout.androidaps.plugins.pump.medtronic.R; import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry; import info.nightscout.androidaps.plugins.pump.medtronic.data.MedtronicHistoryData; import info.nightscout.androidaps.utils.resources.ResourceHelper; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java index 616f033799..0d21b195df 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java @@ -14,10 +14,10 @@ import java.util.List; import javax.inject.Inject; import dagger.android.support.DaggerFragment; -import info.nightscout.androidaps.R; import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil; +import info.nightscout.androidaps.plugins.pump.medtronic.R; import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.resources.ResourceHelper; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java index f7686fa824..1dcf799a2e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java @@ -12,7 +12,7 @@ import javax.inject.Inject; import javax.inject.Singleton; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; -import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; @@ -20,18 +20,19 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.medtronic.defs.BasalProfileStatus; import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicDeviceStatusChange; +import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.sharedPreferences.SP; + + /** * Created by andy on 4/28/18. */ @Singleton -public class MedtronicPumpStatus extends PumpStatus { +public class MedtronicPumpStatus extends info.nightscout.androidaps.plugins.pump.common.data.PumpStatus { private final ResourceHelper resourceHelper; private final SP sp; @@ -164,6 +165,28 @@ public class MedtronicPumpStatus extends PumpStatus { return (errorDescription == null) ? "-" : errorDescription; } + @Override + public E getCustomData(String key, Class clazz) { + switch(key) { + case "SERIAL_NUMBER": + return (E)serialNumber; + + case "PUMP_FREQUENCY": + return (E)pumpFrequency; + + case "PUMP_MODEL": { + if (medtronicDeviceType==null) + return null; + else + return (E)medtronicDeviceType.getPumpModel(); + } + + + default: + return null; + } + } + public PumpDeviceState getPumpDeviceState() { return pumpDeviceState; } @@ -174,6 +197,6 @@ public class MedtronicPumpStatus extends PumpStatus { rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItem(pumpDeviceState, RileyLinkTargetDevice.MedtronicPump)); - rxBus.send(new EventMedtronicDeviceStatusChange(pumpDeviceState)); + rxBus.send(new EventRileyLinkDeviceStatusChange(pumpDeviceState)); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java index 7ae299036d..097633f574 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java @@ -8,9 +8,8 @@ import android.os.IBinder; import javax.inject.Inject; -import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.R; import info.nightscout.androidaps.logging.LTag; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; @@ -22,16 +21,15 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin; +import info.nightscout.androidaps.plugins.pump.medtronic.R; import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager; import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUIComm; import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUIPostprocessor; import info.nightscout.androidaps.plugins.pump.medtronic.data.MedtronicHistoryData; import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; -import info.nightscout.androidaps.utils.resources.ResourceHelper; /** * RileyLinkMedtronicService is intended to stay running when the gui-app is closed. @@ -339,11 +337,9 @@ public class RileyLinkMedtronicService extends RileyLinkService { medtronicPumpStatus.batteryType = batteryType; } - String bolusDebugEnabled = sp.getStringOrNull(MedtronicConst.Prefs.BolusDebugEnabled, null); - - boolean bolusDebug = bolusDebugEnabled != null && bolusDebugEnabled.equals(resourceHelper.gs(R.string.common_on)); - - MedtronicHistoryData.doubleBolusDebug = bolusDebug; + //String bolusDebugEnabled = sp.getStringOrNull(MedtronicConst.Prefs.BolusDebugEnabled, null); + //boolean bolusDebug = bolusDebugEnabled != null && bolusDebugEnabled.equals(resourceHelper.gs(R.string.common_on)); + //MedtronicHistoryData.doubleBolusDebug = bolusDebug; reconfigureService(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.java similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.java index fef95087de..141b23ed3a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.java @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.util; -import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.pump.medtronic.R; /** * Created by andy on 5/12/18. @@ -10,7 +10,7 @@ public class MedtronicConst { static final String Prefix = "AAPS.Medtronic."; - public class Prefs { + public static class Prefs { public static final int PumpSerial = R.string.key_medtronic_serial; public static final int PumpType = R.string.key_medtronic_pump_type; public static final int PumpFrequency = R.string.key_medtronic_frequency; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java rename to medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java index a4e7a51ec2..2e17b7808f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java @@ -26,11 +26,12 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.ClockDTO; import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO; +import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.RLHistoryItemMedtronic; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType; import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicNotificationType; import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicDeviceStatusChange; +import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange; import info.nightscout.androidaps.utils.resources.ResourceHelper; /** @@ -42,7 +43,7 @@ public class MedtronicUtil { private int ENVELOPE_SIZE = 4; // 0xA7 S1 S2 S3 CMD PARAM_COUNT [PARAMS] private static boolean lowLevelDebug = true; - private MedtronicDeviceType medtronicPumpModel; + //private MedtronicDeviceType medtronicPumpModel; private MedtronicCommandType currentCommand; private Map settings; private int BIG_FRAME_LENGTH = 65; @@ -144,7 +145,7 @@ public class MedtronicUtil { public byte[] getBolusStrokes(double amount) { - int strokesPerUnit = medtronicPumpModel.getBolusStrokes(); + int strokesPerUnit = medtronicPumpStatus.medtronicDeviceType.getBolusStrokes(); int length; int scrollRate; @@ -391,15 +392,15 @@ public class MedtronicUtil { } public boolean isModelSet() { - return medtronicPumpModel != null; + return medtronicPumpStatus.medtronicDeviceType != null; } public MedtronicDeviceType getMedtronicPumpModel() { - return medtronicPumpModel; + return medtronicPumpStatus.medtronicDeviceType; } public void setMedtronicPumpModel(MedtronicDeviceType medtronicPumpModel) { - this.medtronicPumpModel = medtronicPumpModel; + this.medtronicPumpStatus.medtronicDeviceType = medtronicPumpModel; } public MedtronicCommandType getCurrentCommand() { @@ -410,7 +411,7 @@ public class MedtronicUtil { this.currentCommand = currentCommand; if (currentCommand != null) - rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItem(currentCommand)); + rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItemMedtronic(currentCommand)); } @@ -426,7 +427,7 @@ public class MedtronicUtil { setCurrentCommand(currentCommand); } - rxBus.send(new EventMedtronicDeviceStatusChange(medtronicPumpStatus.getPumpDeviceState())); + rxBus.send(new EventRileyLinkDeviceStatusChange(medtronicPumpStatus.getPumpDeviceState())); } diff --git a/app/src/main/res/layout/medtronic_fragment.xml b/medtronic/src/main/res/layout/medtronic_fragment.xml similarity index 100% rename from app/src/main/res/layout/medtronic_fragment.xml rename to medtronic/src/main/res/layout/medtronic_fragment.xml diff --git a/app/src/main/res/layout/medtronic_history_activity.xml b/medtronic/src/main/res/layout/medtronic_history_activity.xml similarity index 100% rename from app/src/main/res/layout/medtronic_history_activity.xml rename to medtronic/src/main/res/layout/medtronic_history_activity.xml diff --git a/app/src/main/res/layout/medtronic_history_item.xml b/medtronic/src/main/res/layout/medtronic_history_item.xml similarity index 100% rename from app/src/main/res/layout/medtronic_history_item.xml rename to medtronic/src/main/res/layout/medtronic_history_item.xml diff --git a/medtronic/src/main/res/values/strings.xml b/medtronic/src/main/res/values/strings.xml new file mode 100644 index 0000000000..abcf6d97d6 --- /dev/null +++ b/medtronic/src/main/res/values/strings.xml @@ -0,0 +1,117 @@ + + + + Medtronic + MDT + Pump integration for Medtronic, requires RileyLink device and specific Pump Model + + + pref_medtronic_serial + pref_medtronic_pump_type + pref_medtronic_frequency + pref_medtronic_max_bolus + pref_medtronic_max_basal + pref_medtronic_bolus_delay + pref_medtronic_encoding + pref_medtronic_battery_type + pref_medtronic_bolus_debug + pref_rileylink_mac_address + medtronic_pump_frequency_us_ca + medtronic_pump_frequency_worldwide + medtronic_pump_encoding_4b6b_local + medtronic_pump_encoding_4b6b_rileylink + medtronic_pump_battery_no + medtronic_pump_battery_alkaline + medtronic_pump_battery_lithium + medtronic_pump_battery_nizn + medtronic_pump_battery_nimh + + Pump Serial Number + Pump Type + Pump Frequency + Delay before Bolus is started (s) + Max Bolus on Pump (U) + Max Basal on Pump (U/h) + Medtronic Encoding + US & Canada (916 MHz) + Worldwide (868 Mhz) + Software 4b6b Encoding + Hardware 4b6b Encoding + Wake and Tune Up + Clear Bolus Block + Reset RileyLink Config + Battery Type (Power View) + Not selected (Simple view) + Alkaline (Extended view) + Lithium (Extended view) + NiZn (Extended view) + NiMH (Extended view) + Bolus/Treatments Debugging + + + + + Errors + Serial # not set. + Serial # invalid. + Pump Type not set. + Pump Type unsupported. + Pump Frequency not set. + Pump Frequency unsupported. + RileyLink Address invalid. + Pump type detected is not the same as configured type. + + Basal profiles/patterns setting is not enabled on pump. Enable it on the pump. + Basal profile set on pump is incorrect (must be STD). + Wrong TBR type set on pump (must be Absolute). + Wrong Max Bolus set on Pump (must be %1$.2f). + Wrong Max Basal set on Pump (must be %1$.2f). + Operation is not possible.\n\n You need to configure Medtronic Pump first, before you can use this operation. + Over 24h Time change was requested. + + + + + + + + + Medtronic Pump History + + + + + + You cancelled Bolus, after it was already set on Pump. Since Medtronic Pump doesn\'t support cancel, you will need to manually cancel it. Put the Pump into Suspend mode and then do Resume (if you still want to cancel). Application will pick up changes, on next update (in less than 5 minutes). + Could not read current TBR. + Could not cancel current TBR. Stopping operation. + Profile set failed, because following patterns, have too big basal rate: %1$s + Bolus could not be delivered. + Bolus could not be delivered, because available insulin amount (%1$.2f) is less than bolus required (%2$.2f). + TBR could not be set. + Could not cancel current TBR. + Basal profile could not be set. + Basal profile is the same, so it will not be set again. + + Get History - Page %1$d (%2$d/16) + Get History - Page %1$d + Get Pump Time + Get Settings + Get Pump Model + Get Basal Profile + Set Basal Profile + Get Temporary Basal + Set Temporary Basal + Set Bolus + + Pump unreachable + Warning + Now + ago + Pump clock update needed + On + Off + Pump time updated + set_neutral_temps + + \ No newline at end of file diff --git a/app/src/main/res/xml/pref_medtronic.xml b/medtronic/src/main/res/xml/pref_medtronic.xml similarity index 100% rename from app/src/main/res/xml/pref_medtronic.xml rename to medtronic/src/main/res/xml/pref_medtronic.xml diff --git a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/ExampleUnitTest.java b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/ExampleUnitTest.java new file mode 100644 index 0000000000..98bc082706 --- /dev/null +++ b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package info.nightscout.androidaps.plugins.pump.medtronic; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/rileylink/.gitignore b/rileylink/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/rileylink/.gitignore @@ -0,0 +1 @@ +/build diff --git a/rileylink/build.gradle b/rileylink/build.gradle new file mode 100644 index 0000000000..07b262bfeb --- /dev/null +++ b/rileylink/build.gradle @@ -0,0 +1,81 @@ +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-kapt' + +android { + compileSdkVersion 28 + + defaultConfig { + minSdkVersion 24 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles 'consumer-rules.pro' + } + + kotlinOptions { + jvmTarget = '1.8' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + debug { + testCoverageEnabled(project.hasProperty('coverage')) + } + firebaseDisable { + System.setProperty("disableFirebase", "true") + ext.enableCrashlytics = false + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation project(':core') + + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion" + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.legacy:legacy-support-v13:1.0.0' + implementation 'androidx.core:core-ktx:1.2.0' + implementation "androidx.preference:preference-ktx:1.1.1" + implementation "androidx.activity:activity-ktx:${activityVersion}" + implementation 'com.google.android.material:material:1.1.0' + + implementation "io.reactivex.rxjava2:rxandroid:${rxandroid_version}" + + // Graphview cannot be upgraded + implementation "com.jjoe64:graphview:4.0.1" + + implementation "com.joanzapata.iconify:android-iconify-fontawesome:2.2.2" + + // rileylink - start + implementation 'org.apache.commons:commons-lang3:3.10' + implementation 'net.danlew:android.joda:2.10.6' + implementation 'org.slf4j:slf4j-api:1.7.30' + // rileylink - end + + implementation "com.google.dagger:dagger-android:$dagger_version" + implementation "com.google.dagger:dagger-android-support:$dagger_version" + annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version" + annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version" + kapt "com.google.dagger:dagger-android-processor:$dagger_version" + kapt "com.google.dagger:dagger-compiler:$dagger_version" + + testImplementation 'junit:junit:4.13' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} diff --git a/rileylink/consumer-rules.pro b/rileylink/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/rileylink/proguard-rules.pro b/rileylink/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/rileylink/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/rileylink/src/androidTest/java/info/nightscout/androidaps/plugins/pump/common/ExampleInstrumentedTest.java b/rileylink/src/androidTest/java/info/nightscout/androidaps/plugins/pump/common/ExampleInstrumentedTest.java new file mode 100644 index 0000000000..9942e86384 --- /dev/null +++ b/rileylink/src/androidTest/java/info/nightscout/androidaps/plugins/pump/common/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package info.nightscout.androidaps.plugins.pump.common; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("info.nightscout.androidaps.plugins.pump.common.test", appContext.getPackageName()); + } +} diff --git a/rileylink/src/main/AndroidManifest.xml b/rileylink/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..280768811b --- /dev/null +++ b/rileylink/src/main/AndroidManifest.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java index c70b7e033a..78db788350 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java @@ -24,6 +24,7 @@ import android.widget.Toast; import androidx.appcompat.widget.Toolbar; + import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; @@ -34,21 +35,20 @@ import java.util.Map; import javax.inject.Inject; -import info.nightscout.androidaps.R; + import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.common.ManufacturerType; +import info.nightscout.androidaps.plugins.pump.common.R; import info.nightscout.androidaps.plugins.pump.common.ble.BlePreCheck; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged; -import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodPumpValuesChanged; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.sharedPreferences.SP; @@ -116,7 +116,7 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity { RileyLinkPumpDevice rileyLinkPump = (RileyLinkPumpDevice) activePump; rileyLinkPump.getRileyLinkService().verifyConfiguration(); // force reloading of address - rxBus.send(new EventMedtronicPumpConfigurationChanged()); + rileyLinkPump.triggerPumpConfigurationChangedEvent(); } else if (activePlugin.getActivePump().manufacturer() == ManufacturerType.Insulet) { if (activePump.model() == PumpType.Insulet_Omnipod_Dash) { @@ -125,7 +125,7 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity { RileyLinkPumpDevice rileyLinkPump = (RileyLinkPumpDevice) activePump; rileyLinkPump.getRileyLinkService().verifyConfiguration(); // force reloading of address - rxBus.send(new EventOmnipodPumpValuesChanged()); + rileyLinkPump.triggerPumpConfigurationChangedEvent(); } } @@ -157,14 +157,14 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case R.id.rileylink_miScan: { - scanLeDevice(menuItem.getTitle().equals(actionTitleStart)); - return true; - } - - default: - return super.onOptionsItemSelected(item); + if (item.getTitle().equals(actionTitleStart)) { + scanLeDevice(true); + return true; + } else if (item.getTitle().equals(actionTitleStop)) { + scanLeDevice(false); + return true; + } else { + return super.onOptionsItemSelected(item); } } diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt new file mode 100644 index 0000000000..f9846bbb05 --- /dev/null +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt @@ -0,0 +1,28 @@ +package info.nightscout.androidaps.plugins.pump.common.events + +import info.nightscout.androidaps.events.Event +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState + +class EventRileyLinkDeviceStatusChange : Event { + + private var rileyLinkServiceState: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState? = null + private var rileyLinkError: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError? = null + + private var pumpDeviceState: info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState? = null + private var errorDescription: String? = null + + + constructor(rileyLinkServiceState: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState?, rileyLinkError: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError?) { + this.rileyLinkServiceState = rileyLinkServiceState + this.rileyLinkError = rileyLinkError + } + + constructor(pumpDeviceState: info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState?) { + this.pumpDeviceState = pumpDeviceState + } + + constructor(pumpDeviceState: info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState?, errorDescription: String?) { + this.pumpDeviceState = pumpDeviceState + this.errorDescription = errorDescription + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java index 12a0f0f4d0..b8395241e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java @@ -6,6 +6,7 @@ import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.FrequencyScanResults; @@ -20,7 +21,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; import info.nightscout.androidaps.utils.Round; import info.nightscout.androidaps.utils.sharedPreferences.SP; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkConst.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkConst.java similarity index 86% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkConst.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkConst.java index bff2a39240..40d17aee84 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkConst.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkConst.java @@ -1,6 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink; -import info.nightscout.androidaps.R; + +import info.nightscout.androidaps.plugins.pump.common.R; /** * Created by andy on 16/05/2018. @@ -10,7 +11,7 @@ public class RileyLinkConst { static final String Prefix = "AAPS.RileyLink."; - public class Intents { + public static class Intents { public static final String RileyLinkReady = Prefix + "RileyLink_Ready"; public static final String RileyLinkGattFailed = Prefix + "RileyLink_Gatt_Failed"; @@ -27,22 +28,21 @@ public class RileyLinkConst { public static final String RileyLinkDisconnect = Prefix + "RileyLink_Disconnect"; } - public class Prefs { + public static class Prefs { //public static final String PrefPrefix = "pref_rileylink_"; //public static final String RileyLinkAddress = PrefPrefix + "mac_address"; // pref_rileylink_mac_address public static final int RileyLinkAddress = R.string.key_rileylink_mac_address; public static final String LastGoodDeviceCommunicationTime = Prefix + "lastGoodDeviceCommunicationTime"; public static final String LastGoodDeviceFrequency = Prefix + "LastGoodDeviceFrequency"; + public static final int Encoding = R.string.key_medtronic_encoding; } - public class IPC { + public static class IPC { // needs to br renamed (and maybe removed) public static final String MSG_PUMP_quickTune = Prefix + "MSG_PUMP_quickTune"; public static final String MSG_PUMP_tunePump = Prefix + "MSG_PUMP_tunePump"; - public static final String MSG_PUMP_fetchHistory = Prefix + "MSG_PUMP_fetchHistory"; - public static final String MSG_PUMP_fetchSavedHistory = Prefix + "MSG_PUMP_fetchSavedHistory"; public static final String MSG_ServiceCommand = Prefix + "MSG_ServiceCommand"; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java index f3f6399570..7971b6a7aa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java @@ -7,9 +7,11 @@ import java.util.UUID; import javax.inject.Inject; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.R; + import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; +import info.nightscout.androidaps.plugins.pump.common.R; +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.Reset; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.RileyLinkCommand; @@ -31,7 +33,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ThreadUtil; -import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst; + import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.sharedPreferences.SP; @@ -369,7 +371,8 @@ public class RFSpy { RileyLinkEncodingType encoding = RileyLinkEncodingType.FourByteSixByteLocal; if (RileyLinkFirmwareVersion.isSameVersion(rileyLinkServiceData.firmwareVersion, RileyLinkFirmwareVersion.Version2AndHigher)) { - if (sp.getString(MedtronicConst.Prefs.Encoding, "None").equals(resourceHelper.gs(R.string.key_medtronic_pump_encoding_4b6b_rileylink))) { + if (sp.getString(RileyLinkConst.Prefs.Encoding, "None") + .equals(resourceHelper.gs(R.string.key_medtronic_pump_encoding_4b6b_rileylink))) { encoding = RileyLinkEncodingType.FourByteSixByteRileyLink; } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/GetVersion.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/GetVersion.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/GetVersion.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/GetVersion.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/Reset.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/Reset.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/Reset.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/Reset.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/ResetRadioConfig.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/ResetRadioConfig.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/ResetRadioConfig.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/ResetRadioConfig.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/RileyLinkCommand.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/RileyLinkCommand.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/RileyLinkCommand.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/RileyLinkCommand.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java index 6304567751..d54fef0599 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java @@ -6,7 +6,6 @@ import java.util.ArrayList; import javax.inject.Inject; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkCommandType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetHardwareEncoding.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetHardwareEncoding.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetHardwareEncoding.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetHardwareEncoding.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetPreamble.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetPreamble.java similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetPreamble.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetPreamble.java index d58525deb0..b3f32727c3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetPreamble.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SetPreamble.java @@ -7,7 +7,6 @@ import org.apache.commons.lang3.NotImplementedException; import javax.inject.Inject; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkCommandType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/UpdateRegister.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/UpdateRegister.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/UpdateRegister.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/UpdateRegister.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyScanResults.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyScanResults.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyScanResults.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyScanResults.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyTrial.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyTrial.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyTrial.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/FrequencyTrial.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/GattAttributes.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/GattAttributes.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/GattAttributes.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/GattAttributes.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RFSpyResponse.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RFSpyResponse.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RFSpyResponse.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RFSpyResponse.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessage.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessage.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessage.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessage.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessageType.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessageType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessageType.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RLMessageType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java index 785691e4c2..66a3a446cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java @@ -77,7 +77,7 @@ public class RadioResponse { byte[] encodedPayload; if (RileyLinkFirmwareVersion.isSameVersion(rileyLinkServiceData.versionCC110, - RileyLinkFirmwareVersion.Version2)) { + RileyLinkFirmwareVersion.Version2AndHigher)) { encodedPayload = ByteUtil.substring(rxData, 3, rxData.length - 3); rssi = rxData[1]; responseNumber = rxData[2]; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6b.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6b.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6b.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6b.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java index 47f13f3095..32176040f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.encoding; import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGo.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGo.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGo.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGo.java index 6b4bd73760..3b0152455c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGo.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGo.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Map; import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import info.nightscout.androidaps.logging.StacktraceLoggerWrapper; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bLoop.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bLoop.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bLoop.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bLoop.java index 56ec7751a5..d7a3a5f9d1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bLoop.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bLoop.java @@ -6,7 +6,6 @@ import java.util.List; import java.util.Map; import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import info.nightscout.androidaps.logging.StacktraceLoggerWrapper; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/CC111XRegister.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/CC111XRegister.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/CC111XRegister.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/CC111XRegister.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyCommand.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyCommand.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyCommand.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyCommand.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyRLResponse.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyRLResponse.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyRLResponse.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RFSpyRLResponse.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RLMessageType.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RLMessageType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RLMessageType.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RLMessageType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RXFilterMode.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RXFilterMode.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RXFilterMode.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RXFilterMode.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkBLEError.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkBLEError.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkBLEError.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkBLEError.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkCommandType.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkCommandType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkCommandType.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkCommandType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java index fcfe1915a0..55c2ce9539 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java @@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs; import java.util.HashMap; import java.util.Map; -import info.nightscout.androidaps.R; -import info.nightscout.androidaps.MainApp; + +import info.nightscout.androidaps.plugins.pump.common.R; import info.nightscout.androidaps.utils.resources.ResourceHelper; public enum RileyLinkEncodingType { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java index b6d0eab3cd..1a6b42c443 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java @@ -12,11 +12,12 @@ public enum RileyLinkFirmwareVersion { Version_1_0(1, 0, "1.0"), // Version_2_0(2, 0, "2.0"), // Version_2_2(2, 2, "2.2"), // - Version_3_0(3, 0, "3.0"), // + Version_3_x(3, 0, "3.x"), // + Version_4_x(4, 0, "4.x"), // UnknownVersion(0, 0, "???"), // Version1(Version_0_0, Version_0_9, Version_1_0), // Version2(Version_2_0, Version_2_2), // - Version2AndHigher(Version_2_0, Version_2_2, Version_3_0), // + Version2AndHigher(Version_2_0, Version_2_2, Version_3_x, Version_4_x), // ; private static final String FIRMWARE_IDENTIFICATION_PREFIX = "subg_rfspy "; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkTargetFrequency.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkTargetFrequency.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkTargetFrequency.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkTargetFrequency.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperation.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperation.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperation.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperation.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperationResult.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperationResult.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperationResult.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/BLECommOperationResult.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/BleAdvertisedData.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/BleAdvertisedData.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/BleAdvertisedData.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/BleAdvertisedData.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/CommandValueDefinition.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/CommandValueDefinition.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/CommandValueDefinition.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/CommandValueDefinition.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java similarity index 62% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java index a75e59b17a..c845a3afe2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java @@ -2,13 +2,17 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data; import org.joda.time.LocalDateTime; + + + +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; +//import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType; +//import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; import info.nightscout.androidaps.utils.resources.ResourceHelper; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType; +//import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType; /** @@ -17,16 +21,21 @@ import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType; public class RLHistoryItem { - private MedtronicCommandType medtronicCommandType; - private LocalDateTime dateTime; - private RLHistoryItemSource source; - private RileyLinkServiceState serviceState; - private RileyLinkError errorCode; + //private MedtronicCommandType medtronicCommandType; + protected LocalDateTime dateTime; + protected RLHistoryItemSource source; + protected RileyLinkServiceState serviceState; + protected RileyLinkError errorCode; - private RileyLinkTargetDevice targetDevice; - private PumpDeviceState pumpDeviceState; - private OmnipodCommandType omnipodCommandType; + protected RileyLinkTargetDevice targetDevice; + protected PumpDeviceState pumpDeviceState; + //private OmnipodCommandType omnipodCommandType; + public RLHistoryItem(LocalDateTime dateTime, RLHistoryItemSource source, RileyLinkTargetDevice targetDevice) { + this.dateTime = dateTime; + this.source = source; + this.targetDevice = targetDevice; + } public RLHistoryItem(RileyLinkServiceState serviceState, RileyLinkError errorCode, RileyLinkTargetDevice targetDevice) { @@ -46,18 +55,18 @@ public class RLHistoryItem { } - public RLHistoryItem(MedtronicCommandType medtronicCommandType) { - this.dateTime = new LocalDateTime(); - this.medtronicCommandType = medtronicCommandType; - source = RLHistoryItemSource.MedtronicCommand; - } - - - public RLHistoryItem(OmnipodCommandType omnipodCommandType) { - this.dateTime = new LocalDateTime(); - this.omnipodCommandType = omnipodCommandType; - source = RLHistoryItemSource.OmnipodCommand; - } +// public RLHistoryItem(MedtronicCommandType medtronicCommandType) { +// this.dateTime = new LocalDateTime(); +// this.medtronicCommandType = medtronicCommandType; +// source = RLHistoryItemSource.MedtronicCommand; +// } +// +// +// public RLHistoryItem(OmnipodCommandType omnipodCommandType) { +// this.dateTime = new LocalDateTime(); +// this.omnipodCommandType = omnipodCommandType; +// source = RLHistoryItemSource.OmnipodCommand; +// } public LocalDateTime getDateTime() { @@ -86,11 +95,11 @@ public class RLHistoryItem { case MedtronicPump: return resourceHelper.gs(pumpDeviceState.getResourceId()); - case MedtronicCommand: - return medtronicCommandType.name(); - - case OmnipodCommand: - return omnipodCommandType.name(); +// case MedtronicCommand: +// return medtronicCommandType.name(); +// +// case OmnipodCommand: +// return omnipodCommandType.name(); default: return "Unknown Description"; @@ -130,7 +139,7 @@ public class RLHistoryItem { @Override public int compare(RLHistoryItem o1, RLHistoryItem o2) { - return o2.dateTime.compareTo(o1.dateTime); + return o2.dateTime.compareTo(o1.getDateTime()); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionRLType.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionRLType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionRLType.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionRLType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionType.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionType.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/CommandValueDefinitionType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkError.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkError.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkError.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkError.java index 07867a781a..0334c8d54e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkError.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkError.java @@ -1,6 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs; -import info.nightscout.androidaps.R; + +import info.nightscout.androidaps.plugins.pump.common.R; /** * Created by andy on 14/05/2018. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkPumpDevice.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkPumpDevice.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkPumpDevice.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkPumpDevice.java index 7ad31c2066..71c2b5d20a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkPumpDevice.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkPumpDevice.java @@ -14,6 +14,8 @@ public interface RileyLinkPumpDevice { void doTuneUpDevice(); + void triggerPumpConfigurationChangedEvent(); + RileyLinkService getRileyLinkService(); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkServiceState.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkServiceState.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkServiceState.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkServiceState.java index 2ae66b53c9..31c5f981f3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkServiceState.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkServiceState.java @@ -1,6 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs; -import info.nightscout.androidaps.R; + +import info.nightscout.androidaps.plugins.pump.common.R; /** * Created by andy on 14/05/2018. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkTargetDevice.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkTargetDevice.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkTargetDevice.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkTargetDevice.java index 2d0dea69f7..99b4ecd40a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkTargetDevice.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/defs/RileyLinkTargetDevice.java @@ -1,6 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs; -import info.nightscout.androidaps.R; + +import info.nightscout.androidaps.plugins.pump.common.R; /** * Created by andy on 5/19/18. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java index 57aa01123f..7bcc9a93ac 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java @@ -16,8 +16,9 @@ import java.util.List; import javax.inject.Inject; -import info.nightscout.androidaps.R; + import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; +import info.nightscout.androidaps.plugins.pump.common.R; import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java index 226d7fc622..3140b1107e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java @@ -14,7 +14,8 @@ import android.widget.Button; import android.widget.ListView; import android.widget.TextView; -import info.nightscout.androidaps.R; + +import info.nightscout.androidaps.plugins.pump.common.R; import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.CommandValueDefinition; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.CommandValueDefinitionType; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java similarity index 79% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java index bec19c7d1f..e4b6f154af 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java @@ -13,25 +13,18 @@ import java.util.Locale; import javax.inject.Inject; import dagger.android.support.DaggerFragment; -import info.nightscout.androidaps.MainApp; -import info.nightscout.androidaps.R; import info.nightscout.androidaps.interfaces.ActivePluginProvider; -import info.nightscout.androidaps.interfaces.PumpDescription; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.plugins.common.ManufacturerType; import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract; +import info.nightscout.androidaps.plugins.pump.common.R; import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface; -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil; -import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin; -import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; -import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus; import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.resources.ResourceHelper; @@ -43,7 +36,7 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re @Inject ActivePluginProvider activePlugin; @Inject ResourceHelper resourceHelper; - @Inject MedtronicUtil medtronicUtil; + //@Inject MedtronicUtil medtronicUtil; @Inject AAPSLogger aapsLogger; @Inject RileyLinkServiceData rileyLinkServiceData; @Inject DateUtil dateUtil; @@ -118,7 +111,6 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re "-" : resourceHelper.gs(rileyLinkServiceData.rileyLinkError.getResourceId(targetDevice))); - RileyLinkFirmwareVersion firmwareVersion = rileyLinkServiceData.versionCC110; if (firmwareVersion == null) { @@ -133,15 +125,17 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re PumpPluginAbstract pumpPlugin = (PumpPluginAbstract)activePlugin.getActivePump(); if (pumpPlugin.manufacturer()== ManufacturerType.Medtronic) { - MedtronicPumpStatus medtronicPumpStatus = (MedtronicPumpStatus)pumpPlugin.getPumpStatusData(); + //MedtronicPumpStatus medtronicPumpStatus = (MedtronicPumpStatus)pumpPlugin.getPumpStatusData(); + + PumpStatus pumpStatusData = pumpPlugin.getPumpStatusData(); this.deviceType.setText(resourceHelper.gs(RileyLinkTargetDevice.MedtronicPump.getResourceId())); this.deviceModel.setText(pumpPlugin.getPumpType().getDescription()); - this.serialNumber.setText(medtronicPumpStatus.serialNumber); - this.pumpFrequency.setText(resourceHelper.gs(medtronicPumpStatus.pumpFrequency.equals("medtronic_pump_frequency_us_ca") ? R.string.medtronic_pump_frequency_us_ca : R.string.medtronic_pump_frequency_worldwide)); + this.serialNumber.setText(pumpStatusData.getCustomDataAsString("SERIAL_NUMBER")); // medtronicPumpStatus.serialNumber); + this.pumpFrequency.setText(resourceHelper.gs(pumpStatusData.getCustomDataAsString("PUMP_FREQUENCY").equals("medtronic_pump_frequency_us_ca") ? R.string.medtronic_pump_frequency_us_ca : R.string.medtronic_pump_frequency_worldwide)); - if (medtronicUtil.getMedtronicPumpModel() != null) - this.connectedDevice.setText("Medtronic " + medtronicUtil.getMedtronicPumpModel().getPumpModel()); + if (pumpStatusData.getCustomDataAsString("PUMP_MODEL") != null) + this.connectedDevice.setText("Medtronic " + pumpStatusData.getCustomDataAsString("PUMP_MODEL")); else this.connectedDevice.setText("???"); @@ -149,14 +143,15 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re this.lastUsedFrequency.setText(String.format(Locale.ENGLISH, "%.2f MHz", rileyLinkServiceData.lastGoodFrequency)); - if (medtronicPumpStatus.lastConnection != 0) + if (pumpStatusData.lastConnection != 0) this.lastDeviceContact.setText(StringUtil.toDateTimeString(dateUtil, new LocalDateTime( - medtronicPumpStatus.lastDataTime))); + pumpStatusData.lastDataTime))); else this.lastDeviceContact.setText(resourceHelper.gs(R.string.common_never)); } else { - OmnipodPumpStatus omnipodPumpStatus = (OmnipodPumpStatus)pumpPlugin.getPumpStatusData(); + //OmnipodPumpStatus omnipodPumpStatus = (OmnipodPumpStatus)pumpPlugin.getPumpStatusData(); + PumpStatus pumpStatusData = pumpPlugin.getPumpStatusData(); this.deviceType.setText(resourceHelper.gs(RileyLinkTargetDevice.Omnipod.getResourceId())); this.deviceModel.setText(pumpPlugin.getPumpType() == PumpType.Insulet_Omnipod ? "Eros" : "Dash"); @@ -169,11 +164,11 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re this.pumpFrequency.setText(resourceHelper.gs(R.string.omnipod_frequency)); - if (omnipodPumpStatus != null) { + if (pumpStatusData != null) { - if (omnipodPumpStatus.podAvailable) { - this.serialNumber.setText(omnipodPumpStatus.podLotNumber); - this.connectedDevice.setText(omnipodPumpStatus.pumpType == PumpType.Insulet_Omnipod ? "Eros Pod" : "Dash Pod"); + if (pumpStatusData.getCustomData("POD_AVAILABLE", Boolean.class)) { + this.serialNumber.setText(pumpStatusData.getCustomDataAsString("POD_LOT_NUMBER")); + this.connectedDevice.setText(pumpStatusData.pumpType == PumpType.Insulet_Omnipod ? "Eros Pod" : "Dash Pod"); } else { this.serialNumber.setText("??"); this.connectedDevice.setText("-"); @@ -183,16 +178,14 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re this.lastUsedFrequency.setText(String.format(Locale.ENGLISH, "%.2f MHz", rileyLinkServiceData.lastGoodFrequency)); - if (omnipodPumpStatus.lastConnection != 0) + if (pumpStatusData.lastConnection != 0) this.lastDeviceContact.setText(StringUtil.toDateTimeString(dateUtil, new LocalDateTime( - omnipodPumpStatus.lastDataTime))); + pumpStatusData.lastDataTime))); else this.lastDeviceContact.setText(resourceHelper.gs(R.string.common_never)); } } - } - } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.java similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.java index 8a3ff18207..11c8ac2f80 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.java @@ -18,11 +18,13 @@ import java.util.List; import javax.inject.Inject; import dagger.android.support.DaggerFragment; -import info.nightscout.androidaps.R; + +import info.nightscout.androidaps.plugins.pump.common.R; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; + import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.resources.ResourceHelper; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java index 4beea20154..7fefacc8c5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java @@ -81,13 +81,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver { RileyLinkConst.Intents.RileyLinkDisconnected, // RileyLinkConst.Intents.RileyLinkNewAddressSet, // RileyLinkConst.Intents.RileyLinkDisconnect)); - - // Device Specific - // TODO remove from service instance - //deviceSpecificPrefix = serviceInstance.getDeviceSpecificBroadcastsIdentifierPrefix(); - - // Application specific - } private RileyLinkService getServiceInstance() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java index 09273eb719..08503155af 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java @@ -15,6 +15,7 @@ import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; @@ -26,9 +27,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.data.ServiceResult; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.data.ServiceTransport; -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState; -import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; -import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.sharedPreferences.SP; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java index b16c4971b9..f3362e0db7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java @@ -6,6 +6,7 @@ import javax.inject.Singleton; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; +import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkTargetFrequency; @@ -13,7 +14,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistor import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicDeviceStatusChange; + /** * Created by andy on 16/05/2018. @@ -79,7 +80,8 @@ public class RileyLinkServiceData { aapsLogger.info(LTag.PUMP, "RileyLink State Changed: {} {}", newState, errorCode == null ? "" : " - Error State: " + errorCode.name()); rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItem(rileyLinkServiceState, errorCode, targetDevice)); - rxBus.send(new EventMedtronicDeviceStatusChange(newState, errorCode)); + rxBus.send(new EventRileyLinkDeviceStatusChange(newState, errorCode)); + return null; } else { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceCommand.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceCommand.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceCommand.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceCommand.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceMessage.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceMessage.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceMessage.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceMessage.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceNotification.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceNotification.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceNotification.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceNotification.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceResult.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceResult.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceResult.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceResult.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransport.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransport.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransport.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransport.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransportType.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransportType.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransportType.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/data/ServiceTransportType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/PumpTask.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/PumpTask.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/PumpTask.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/PumpTask.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java index bc9a4a3aa0..3263253e5e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java @@ -5,12 +5,12 @@ import javax.inject.Inject; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; +import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.data.ServiceTransport; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventRefreshButtonState; /** - * Created by geoff on 7/16/16. + * Created by andy on 9/16/18. */ public class ResetRileyLinkConfigurationTask extends PumpTask { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java similarity index 84% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java rename to rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java index 219da8bf3f..d3011eede2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java @@ -5,11 +5,9 @@ import javax.inject.Inject; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; -import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract; +import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.data.ServiceTransport; -import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin; -import info.nightscout.androidaps.plugins.pump.medtronic.events.EventRefreshButtonState; /** * Created by geoff on 7/16/16. diff --git a/app/src/main/res/layout/rileylink_scan_activity.xml b/rileylink/src/main/res/layout/rileylink_scan_activity.xml similarity index 100% rename from app/src/main/res/layout/rileylink_scan_activity.xml rename to rileylink/src/main/res/layout/rileylink_scan_activity.xml diff --git a/app/src/main/res/layout/rileylink_scan_item.xml b/rileylink/src/main/res/layout/rileylink_scan_item.xml similarity index 100% rename from app/src/main/res/layout/rileylink_scan_item.xml rename to rileylink/src/main/res/layout/rileylink_scan_item.xml diff --git a/app/src/main/res/layout/rileylink_status.xml b/rileylink/src/main/res/layout/rileylink_status.xml similarity index 100% rename from app/src/main/res/layout/rileylink_status.xml rename to rileylink/src/main/res/layout/rileylink_status.xml diff --git a/app/src/main/res/layout/rileylink_status_device.xml b/rileylink/src/main/res/layout/rileylink_status_device.xml similarity index 100% rename from app/src/main/res/layout/rileylink_status_device.xml rename to rileylink/src/main/res/layout/rileylink_status_device.xml diff --git a/app/src/main/res/layout/rileylink_status_device_item.xml b/rileylink/src/main/res/layout/rileylink_status_device_item.xml similarity index 100% rename from app/src/main/res/layout/rileylink_status_device_item.xml rename to rileylink/src/main/res/layout/rileylink_status_device_item.xml diff --git a/app/src/main/res/layout/rileylink_status_general.xml b/rileylink/src/main/res/layout/rileylink_status_general.xml similarity index 100% rename from app/src/main/res/layout/rileylink_status_general.xml rename to rileylink/src/main/res/layout/rileylink_status_general.xml diff --git a/app/src/main/res/layout/rileylink_status_history.xml b/rileylink/src/main/res/layout/rileylink_status_history.xml similarity index 100% rename from app/src/main/res/layout/rileylink_status_history.xml rename to rileylink/src/main/res/layout/rileylink_status_history.xml diff --git a/app/src/main/res/layout/rileylink_status_history_item.xml b/rileylink/src/main/res/layout/rileylink_status_history_item.xml similarity index 100% rename from app/src/main/res/layout/rileylink_status_history_item.xml rename to rileylink/src/main/res/layout/rileylink_status_history_item.xml diff --git a/app/src/main/res/menu/menu_rileylink_ble_scan.xml b/rileylink/src/main/res/menu/menu_rileylink_ble_scan.xml similarity index 100% rename from app/src/main/res/menu/menu_rileylink_ble_scan.xml rename to rileylink/src/main/res/menu/menu_rileylink_ble_scan.xml diff --git a/rileylink/src/main/res/values/strings.xml b/rileylink/src/main/res/values/strings.xml new file mode 100644 index 0000000000..ddb9beaf9b --- /dev/null +++ b/rileylink/src/main/res/values/strings.xml @@ -0,0 +1,89 @@ + + + + + SCAN + STOP + Selected + RileyLink Scan + Enable + No + Scanning + Scanning finished + Scanning error: %1$d + Never + + + Settings + History + RileyLink Status + Pump Status + RileyLink Settings + RileyLink + Configured Address + Connected Device + Connection Status + Connection Error + Device + Device Type + Device Model + Last used frequency + Last device contact + RL Firmware + + + + Bluetooth Initializing… + Bluetooth Error + Bluetooth Ready + Not Started + RileyLink Initialization… + RileyLink Error + Tuning up RileyLink and Pump + Problem connecting to Pump + Connected + + + Device is not RileyLink + RileyLink unreachable + Bluetooth disabled + No Bluetooth Adapter + TuneUp Failed + Pump unreachable + Pod unreachable + + + Medtronic Pump + Omnipod + + + Omnipod (433.91 MHz) + US & Canada (916 MHz) + Worldwide (868 Mhz) + + medtronic_pump_encoding_4b6b_local + medtronic_pump_encoding_4b6b_rileylink + + pref_rileylink_mac_address + pref_medtronic_encoding + + %1$.1f %2$s (%3$s) + + + + + + %1$d day + %1$d days + + + %1$d hour + %1$d hours + + + + + + + + \ No newline at end of file diff --git a/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/ExampleUnitTest.java b/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/ExampleUnitTest.java new file mode 100644 index 0000000000..9c4318ff41 --- /dev/null +++ b/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package info.nightscout.androidaps.plugins.pump.common; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 661d9ef66a..19da851b52 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,2 @@ -include ':app', ':wear', ':core', ':dana', ':danar', ':danars' +include ':app', ':wear', ':core', ':dana', ':danar', ':danars', ':rileylink', ':medtronic' +