Get Remote node ID when heartbeat is recevied


I’m currently migrating all our CAN devices from a previous version of 107-Arduino-Cyphal (data types were still .uavcan). In the previous version the callback function for a subscription also passed through the CanardRxTransfer where I could extract the remote_node_id from the metadata. I’d like to do the same with the latest 107-Arduino-Cyphal, I’ve had a look around and can’t see anything that tells me how to do this… Is this possible? If so how do I get retrieve it. I’ve put the code below where I initialise the Node, subscription and its callback function for reference.

Node node_hdl(,
  [] (CanardFrame const & frame) { return mcp2515.transmit(frame); },

Subscription heartbeat_subscription = node_hdl.create_subscription<uavcan::node::Heartbeat_1_0>(
void on_heartbeat_received(const uavcan::node::Heartbeat_1_0 & msg)
  if (DEBUG) {
    char msg_buf[64];
    snprintf(msg_buf, sizeof(msg_buf),
            "Uptime = %d, Health = %d, Mode = %d, VSSC = %d",
            msg.uptime,, msg.mode.value, msg.vendor_specific_status_code);


* this is where i'd like to be able to do some filtering based on the remote node id *


1 Like

That’s a good question, but it’s not really related to libcanard. It is rather related to @aentinger’s Arduino library built on top of it (libcanard itself does not issue any callbacks). It might even be worthy of an issue at Issues · 107-systems/107-Arduino-Cyphal · GitHub

Ok will do.

Thank Pavel

Issue, design rationale and further discussion over here. :wink: :bowing_man: .

Implemented by @rebeccaRossRobotics (thank you :bowing_man: :rocket: ) and merged in #235 :arrow_forward: and a new version of 107-Arduino-Cyphal has been released here (v3.2.0).