Hi!
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(
node_heap.data(),
node_heap.size(),
micros,
[] (CanardFrame const & frame) { return mcp2515.transmit(frame); },
OPEN_CYPHAL_NODE_ID);
Subscription heartbeat_subscription = node_hdl.create_subscription<uavcan::node::Heartbeat_1_0>(
heartbeat::on_heartbeat_received);
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.health.value, msg.mode.value, msg.vendor_specific_status_code);
Serial.println(msg_buf);
}
* this is where i'd like to be able to do some filtering based on the remote node id *
Thanks
Rebecca