Gocator API
GoHeartbeat Class Reference

Description

Provides fast UDP-based heartbeat monitoring for sensor disconnection detection.

The GoHeartbeat class monitors UDP heartbeat packets from a sensor or accelerator and can detect disconnection within approximately 100ms (configurable).

Example usage:

GoHeartbeat heartbeat = kNULL;
// Construct heartbeat monitor
GoHeartbeat_Construct(&heartbeat, kNULL);
// Set disconnect callback
GoHeartbeat_SetDisconnectHandler(heartbeat, OnDisconnect, context);
// Start monitoring sensor
GoHeartbeat_Start(heartbeat, sensorId, sensorAddress, GO_HEARTBEAT_DEFAULT_PORT);
// ... application runs ...
// Stop and destroy
GoHeartbeat_Stop(heartbeat);
Inheritance diagram for GoHeartbeat:
Inheritance graph

Public Member Functions

kStatus GoHeartbeat_Construct (GoHeartbeat *heartbeat, kAlloc allocator)
 Constructs a GoHeartbeat object. More...
 
kStatus GoHeartbeat_Destroy (GoHeartbeat heartbeat)
 Destroys a GoHeartbeat object. More...
 
kStatus GoHeartbeat_GetInfo (GoHeartbeat heartbeat, GoHeartbeatInfo *info)
 Gets detailed heartbeat status information. More...
 
kBool GoHeartbeat_IsConnected (GoHeartbeat heartbeat)
 Reports whether the monitored sensor is currently connected. More...
 
kBool GoHeartbeat_IsRunning (GoHeartbeat heartbeat)
 Reports whether heartbeat monitoring is currently active. More...
 
k64u GoHeartbeat_LastReceivedTime (GoHeartbeat heartbeat)
 Gets the timestamp of the last received heartbeat. More...
 
k32u GoHeartbeat_LocalPort (GoHeartbeat heartbeat)
 Returns the UDP port the heartbeat receiver is bound to. More...
 
kStatus GoHeartbeat_SetDisconnectHandler (GoHeartbeat heartbeat, GoHeartbeatDisconnectFx function, kPointer context)
 Sets the disconnect callback handler. More...
 
kStatus GoHeartbeat_SetReconnectHandler (GoHeartbeat heartbeat, GoHeartbeatReconnectFx function, kPointer context)
 Sets the reconnect callback handler. More...
 
kStatus GoHeartbeat_SetTimeout (GoHeartbeat heartbeat, k64u timeoutUs)
 Sets the timeout duration for disconnection detection. More...
 
kStatus GoHeartbeat_Start (GoHeartbeat heartbeat, k32u sensorId, kIpAddress address, k32u port)
 Starts heartbeat monitoring for a sensor. More...
 
kStatus GoHeartbeat_Stop (GoHeartbeat heartbeat)
 Stops heartbeat monitoring. More...
 
k64u GoHeartbeat_Timeout (GoHeartbeat heartbeat)
 Gets the current timeout duration. More...
 

The documentation for this class was generated from the following file: