Skip to content

aaruy pump - #5589

Open
AARUY-Medical wants to merge 11 commits into
nightscout:masterfrom
AARUY-Medical:master
Open

AARUY-Medical wants to merge 11 commits into
nightscout:masterfrom
AARUY-Medical:master

Conversation

@AARUY-Medical

Copy link
Copy Markdown

The program has been updated according to the V4. Now, a code merge request is being made.

@MilosKozak

Copy link
Copy Markdown
Contributor

Thank you for the update. We cannot merge it in this form, and I want to explain why clearly, so the next attempt is easy.

This PR is built on the wrong base. It forks master at f77abd9b — the 4.0.0 release of 31 October — and it targets master. Since then dev is 245 commits further, and the Aaruy driver has its own branch, aaruy, which is 382 commits further and is open as PR #5479. Everything below is already on that branch.

What is already done there, so you do not have to write it again:

  • The BLE protocol in Kotlin (pump/aaruy/protocol), with packet tests and a transport contract test.
  • A pump emulator (pump/aaruy/emulator) and about 25 test classes, plus scenario and screen tests that run the driver against the emulator through the real AAPS command queue.
  • The Compose screens, pairing wizard and reservoir-change wizard.
  • The six pump settings as AAPS preferences, with the same keys you use: pref_aaruy_max_basal, pref_aaruy_max_bolus, pref_aaruy_low_alert, pref_aaruy_bolus_step, pref_aaruy_sound_remind, pref_aaruy_sound_alarm. They are written to the pump, read back and compared, and the driver knows the pump refuses them while a temp basal runs and takes a new bolus step only while it is stopped.

What we took from your upload: the alarm 0x810E. It was the only new pump code in it, and it is now on the aaruy branch.

Four questions. One line each is enough.

  1. Max basal, lowest value. You allow 0.1 U/h, we allow 1.0 U/h. This is the pump's own ceiling for basal. Does the pump accept 0.1, and is it safe to let a user set the ceiling below a normal basal rate?
  2. Bolus step. You default to 0.05 U (value 2), we default to 0.05 U as well but store 0 and 1 and convert at the write. Do the pump values 1 and 2 mean anything else we should keep?
  3. Temp basal while a temp basal runs. Your isCanTmpBasal() allows a new temp basal only in BASALRATE_RUNNING. The AAPS loop changes the temp basal all the time, including setting 0 U/h to stop insulin, so our driver allows it in TMPBASALRATE_RUNNING too. Does the pump accept that, or does it really refuse?
  4. 0x810E. What does the pump do when it reports this fault, and should AAPS stop the loop?

Also: in the history screen you changed aaruy_rewind to notification_text_rewinding and aaruy_pairing_successful to change_pump. If that was on purpose, please say why, and we will do the same.

How to send changes so we can take them

  1. Fork nightscout/AndroidAPS and branch from aaruy, not master.
  2. Put each change in its own commit with a short message. A single "Add files via upload" of a whole tree cannot be reviewed, and it silently removes the work on the branch.
  3. Open the PR against aaruy.
  4. For anything in the BLE layer, please send the bytes and what they mean, or a pump log — not code. We implement it in pump/aaruy/protocol, add it to the emulator, and cover it with a test. The vendor AAR cannot come back: AAPS is open source and delivers insulin, so no closed binary can sit in that path.
  5. Please do not include: local.properties, the Aliyun mirror lines in build.gradle.kts and settings.gradle, translated strings (they come from Crowdin), or Chinese comments in code.
  6. _docs/PUMP_DRIVER_ACCEPTANCE.md lists what a pump driver must pass before it ships. The emulator, the scenarios and the screen tests are part of it.

Small things in this upload that would break the build: 75 files were uploaded to app/main/… instead of app/src/main/… — they are exact copies of files we already have, so they do nothing; settings.gradle has include ':pump:aaruy' three times; and :pump:aaruy is never added to :app, so the driver would not appear in the app at all.

We will close this PR once your new branch is open. Thank you for the work — the parts we asked about above are the only ones we cannot decide for you.

@MilosKozak

Copy link
Copy Markdown
Contributor

@AARUY-Medical if you are not sure how to do it, contact me please

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants