Skip to content

Add device start, stop, and restart - #34

Open
siliconwitch wants to merge 1 commit into
mainfrom
dev
Open

siliconwitch wants to merge 1 commit into
mainfrom
dev

Conversation

@siliconwitch

Copy link
Copy Markdown
Member

Adds device start, device stop, and device restart. Each takes an IMEI, sends the instruction to the server, and returns without waiting for the device:

$ superstack device stop 354820091234567
Device 354820091234567 stops its code at its next check-in.

device list shows starting, stopping, or restarting until the device confirms. That needs no change here, because the list prints the state the server gives it.

A refusal from the server is shown as the server wrote it. start and restart are refused for a device with no code or with code it could not take, for example no code has been uploaded to this device.

Checked: go build, go vet, go test, gofmt -l, and go mod tidy, all with CGO_ENABLED=0, pass. Each command, and the refusal for a device without code, was run against a local server with one device.

The server must carry the matching routes before this is released. Against a server without them, each command fails. This changes no version.

Each command posts to the server's route for it and reports that the device acts at its next check-in. A refusal from the server is shown as the server wrote it.
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.

1 participant