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

source

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.

source

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

source§

const EXTENT_BYTES: Option<u32> = _

This type is delimited with an extent of 12 bytes.

source§

impl Deserialize for Heartbeat

source§

fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where Self: Sized,

Deserializes a value and returns it
source§

fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where Self: Sized,

A convenience function that creates a cursor around the provided bytes and calls deserialize
source§

impl Serialize for Heartbeat

source§

fn size_bits(&self) -> usize

Returns the size of the encoded form of this value, in bits Read more
source§

fn serialize(&self, cursor: &mut WriteCursor<'_>)

Serializes this value into a buffer Read more
source§

fn serialize_to_bytes(&self, bytes: &mut [u8])

A convenience function that creates a cursor around the provided bytes and calls serialize
source§

impl Message for Heartbeat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.