Skip to content

Instantly share code, notes, and snippets.

@electricimp
Last active December 18, 2015 23:39
Show Gist options
  • Save electricimp/5863605 to your computer and use it in GitHub Desktop.
Save electricimp/5863605 to your computer and use it in GitHub Desktop.
HTTP handler to demonstrate device.isconnected(). When you browse to the agent URL you will either see a green background (if the agent is connected to the device) or a red background (when the agent is disconnected from the device).
connectedString <- "disconnected";
if (device.isconnected())
{
connectedString = "connected";
}
server.log("The device is " + connectedString);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment