Cloud functions

Particle.disconnected()

Returns true when disconnected from the Cloud, and false when connected to Cloud.