Gocator API
Detecting Disconnection

Note: All speed estimates are based on a good network. Any network delay, such as in accelerated systems or multisensor systems, may lower the speed.

A sensor is considered GO_STATE_UNRESPONSIVE if it misses three consecutive 2-second discovery cycles (a 6-second window). To forcibly trigger discovery cycles, GoSensor_Refresh() can be called three or more times. If GoSensor_Refresh() is called on an unresponsive sensor, it will be formally disconnected, changing its status to GO_STATE_OFFLINE and removing it from monitoring.

The following methods are recommended for detecting disconnection:

  • GoSensor_IsResponsive(): This is the most effective method, returning false in 6+ seconds after disconnection. This function directly relies on the GO_STATE_UNRESPONSIVE status.
  • GoSensor_State() followed by an equality check against GO_STATE_UNRESPONSIVE: This approach is similar to GoSensor_IsResponsive() but may be slightly slower, as the function may first update the cache info, if it is invalid.

These methods are NOT recommended for detecting disconnection:

  • GoSystem_HasChanges(): This function detects unresponsive or offline sensors in a sensor system. However, it also flags inconsistencies between cached and remote states, meaning it's not exclusively for disconnection detection. It will return true in 6+ seconds after disconnection.
  • GoSensor_IsConnected(): This function relies on the GO_STATE_OFFLINE status, which can take an indefinite amount of time to be set. If the sensor has been refreshed three times, this function will return false in 6+ seconds after disconnection.
  • Control commands: While control commands can throw errors in 3+ seconds after disconnection, frequently sending them is not recommended due to the added processing overhead. Examples of API "get" functions that send control commands without modifying sensor state include: GoSensor_States(), GoSensor_WaitForBuddies(), and GoSensor_CanStart().
Summary
Method Recommended Minimum time to detect
[s]
Minimum time to detect while PC-accelerated
[s]
Reads from
GoSensor_IsResponsive() Yes 6 10 Cache
GoSensor_State() Yes 6 10 Cache & sometimes sensor
GoSystem_HasChanges() No; not for just disconnections 6 10 Cache
GoSensor_IsConnected() No Slow (without refresh)
6 (after refresh)
10 Cache
Control Commands, e.g.: No; adds processing overhead 3 3 Sensor