Repository navigation
Serve a control panel and an iOS Simulator transport - #21
Merged
Merged
Conversation
The pod executable now serves its own control panel, like g7sim's, at the API address (-api, default :8080): the pod's state, and controls for the reservoir, pod age, alerts, faults and crashing on the next command. It drives a JSON API (GET /status, POST /command) with the commands the websocket takes; /ws stays for the separate React frontend. Bad commands are now errors, not a fatal exit. -transport impossible serves the pod to an app in the iOS Simulator through ImpossiBLE's socket instead of a Bluetooth adapter, so Loop can pair with and run a simulated pod on any Mac. The Bluetooth layer is split so the message framing is shared: the paypal/gatt radio builds on Linux only, and the Simulator radio anywhere. It holds a connect for its start delay, as iOS does: OmnipodKit's heartbeat relies on that. A reconnect while pairing or establishing a session, or before the phone acknowledges a response, used to leave the pod waiting on the old connection forever (over Bluetooth it usually exited instead); it now starts over on the new one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pod executable now serves its own control panel, like g7sim's, at
the API address (-api, default :8080): the pod's state, and controls for
the reservoir, pod age, alerts, faults and crashing on the next command.
It drives a JSON API (GET /status, POST /command) with the commands the
websocket takes; /ws stays for the separate React frontend. Bad
commands are now errors, not a fatal exit.
-transport impossible serves the pod to an app in the iOS Simulator
through ImpossiBLE's socket instead of a Bluetooth adapter, so Loop can
pair with and run a simulated pod on any Mac. The Bluetooth layer is
split so the message framing is shared: the paypal/gatt radio builds on
Linux only, and the Simulator radio anywhere. It holds a connect for
its start delay, as iOS does: OmnipodKit's heartbeat relies on that.
A reconnect while pairing or establishing a session, or before the
phone acknowledges a response, used to leave the pod waiting on the
old connection forever (over Bluetooth it usually exited instead); it
now starts over on the new one.
Run against Loop in the iOS Simulator together with g7sim through LoopKit/g7sim's impossible-mux; see the README's "Run against the iOS Simulator" section. Needs loopandlearn/OmnipodKit's simulator-bluetooth change so OmnipodKit uses Bluetooth instead of its Simulator mocks.
Verified on an iPhone simulator: Loop paired, primed and inserted the cannula, ran status commands, survived the pod's idle hangup and a Loop relaunch.
go test -race ./pkg/...passes; builds for linux/arm.