Heartbeat client
To work with heartbeat packets from a client, you can request the IHeartbeatClient from the device instance. It is registered by default.
var heartbeat = device.GetMicroservice<IHeartbeatClient>()
?? throw new Exception("No heartbeat client found");
After that you can, for example, subscribe to new heartbeat events:
var subscription = heartbeat.RawHeartbeat.Subscribe(payload =>
{
if (payload == null) return;
Console.WriteLine($"Heartbeat: type={payload.Type}, status={payload.SystemStatus}");
});
Or subscribe to connection quality changes:
var subscription = heartbeat.LinkQuality.Subscribe(quality =>
{
Console.WriteLine($"Heartbeat quality: {quality}");
});
IHeartbeatClient (source)
Represents a client that sends and receives heartbeats.
Property | Type | Description |
---|---|---|
|
| Full ID of the property. |
|
| Raw heartbeat value. |
|
| Packet rate in Hz. |
|
| Quality of the link. |
|
| State of the link. |
Last modified: 09 October 2025