isconnected flag in measurements data - how it works.

isconnected flag in measurements data - how it works.

The connected flag operation is simple. Any time a measurement is taken by the sensor, the sensor checks the connection status. If it is connected it is marked as true. If it is in search mode, it is marked as false.
The sensor starts in a search mode. If it finds a network , it connects and it is connected. From now on, the sensor will connect to the "father" directly every time it needs a connection. If it is not successful, it will try 3 times. During these times, the sensor is still considered connected. If measurement is being taken during that time, the flag will be marked true. If after 3 times it fails, it move to search modes. All measurements taken while in search mode will be marked with the flag false.
If the gateways suddenly looses connection with the server, for a period of more than one hour, it will reset it self and disconnect the mesh network and all the sensors connected to it. From that point all measurements taken, will be marked as false. Gateway can be disconnected because of communication problem or because the server is down or a combination of both.