Last active
December 18, 2015 23:39
-
-
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).
This file contains 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
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