Struct canadensis_data_types::uavcan::node::heartbeat_1_0::Heartbeat
source · pub struct Heartbeat {
pub uptime: u32,
pub health: Health,
pub mode: Mode,
pub vendor_specific_status_code: u8,
}
Expand description
uavcan.node.Heartbeat.1.0
Fixed size 7 bytes
Abstract node status information. This is the only high-level function that shall be implemented by all nodes.
All Cyphal nodes that have a node-ID are required to publish this message to its fixed subject periodically. Nodes that do not have a node-ID (also known as “anonymous nodes”) shall not publish to this subject.
The default subject-ID 7509 is 1110101010101 in binary. The alternating bit pattern at the end helps transceiver synchronization (e.g., on CAN-based networks) and on some transports permits automatic bit rate detection.
Network-wide health monitoring can be implemented by subscribing to the fixed subject.
Fields§
§uptime: u32
[second] The uptime seconds counter should never overflow. The counter will reach the upper limit in ~136 years, upon which time it should stay at 0xFFFFFFFF until the node is restarted. Other nodes may detect that a remote node has restarted when this value leaps backwards.
saturated uint32
Always aligned, size 32 bits
health: Health
The abstract health status of this node.
uavcan.node.Health.1.0
Always aligned, size 8 bits
mode: Mode
The abstract operating mode of the publishing node. This field indicates the general level of readiness that can be further elaborated on a per-activity basis using various specialized interfaces.
uavcan.node.Mode.1.0
Always aligned, size 8 bits
vendor_specific_status_code: u8
Optional, vendor-specific node status code, e.g. a fault code or a status bitmask. Fits into a single-frame Classic CAN transfer (least capable transport, smallest MTU).
saturated uint8
Always aligned, size 8 bits
Implementations§
source§impl Heartbeat
impl Heartbeat
sourcepub const MAX_PUBLICATION_PERIOD: u16 = 1u16
pub const MAX_PUBLICATION_PERIOD: u16 = 1u16
[second] The publication period shall not exceed this limit. The period should not change while the node is running.
sourcepub const OFFLINE_TIMEOUT: u16 = 3u16
pub const OFFLINE_TIMEOUT: u16 = 3u16
[second] If the last message from the node was received more than this amount of time ago, it should be considered offline.
Trait Implementations§
source§impl DataType for Heartbeat
impl DataType for Heartbeat
source§const EXTENT_BYTES: Option<u32> = _
const EXTENT_BYTES: Option<u32> = _
This type is delimited with an extent of 12 bytes.
source§impl Deserialize for Heartbeat
impl Deserialize for Heartbeat
source§fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where
Self: Sized,
fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where Self: Sized,
source§fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where
Self: Sized,
fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where Self: Sized,
deserialize
source§impl Serialize for Heartbeat
impl Serialize for Heartbeat
source§fn size_bits(&self) -> usize
fn size_bits(&self) -> usize
source§fn serialize(&self, cursor: &mut WriteCursor<'_>)
fn serialize(&self, cursor: &mut WriteCursor<'_>)
source§fn serialize_to_bytes(&self, bytes: &mut [u8])
fn serialize_to_bytes(&self, bytes: &mut [u8])
serialize