Gocator API
kStatus GoSensor_EnableHeartbeat ( GoSensor  sensor,
kBool  enable 
)

Enables fast heartbeat-based disconnection detection for this sensor.

When enabled, the SDK monitors UDP heartbeat packets from the sensor (or accelerator) and can detect disconnection within approximately 100ms, significantly faster than the standard health-based detection (~6 seconds).

This function should be called after GoSensor_Connect succeeds.

Heartbeat monitoring is stopped automatically in two cases:

  1. GoSensor_Disconnect is called (explicit user teardown).
  2. The discovery layer observes the sensor in an accelerated state while heartbeat is enabled via the direct path. The previous registration is no longer addressed correctly through the new topology, so the SDK disables monitoring; re-enable it after re- confirming connectivity through the accelerator path. The auto- disable is retried on each discovery cycle until it succeeds (so a transient kERROR_BUSY collision with a concurrent user-thread call does not leave the stale path in place).

Concurrency: At most one enable/disable transition is allowed in flight on a given sensor at any time. If a second caller (including a heartbeat callback re-entering through GoSensor_Disconnect, or the discovery-thread auto- disable) arrives while a transition is mid-flight, the second caller receives kERROR_BUSY and must retry after a brief delay. This prevents Start/Stop interleaving on the same internal heartbeat object, which could otherwise deadlock the in-flight Stop's join.

Version
Introduced in firmware 6.6.4.3
Parameters
sensorGoSensor object.
enablekTRUE to enable heartbeat monitoring, kFALSE to disable.
Returns
Operation status. kERROR_BUSY if another transition is currently in flight on this sensor; retry after a brief delay.