From 6070e386b8893e43773580985042af3f3cc93f2a Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 10 Aug 2023 14:57:47 +0200 Subject: [PATCH] Fix: also encapsulate "TransferMetadata" into cyphal namespace. (#246) --- ...yphal-Heartbeat-Subscriber-With-Metadata.ino | 4 ++-- src/util/transfer_metadata.hpp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/examples/OpenCyphal-Heartbeat-Subscriber-With-Metadata/OpenCyphal-Heartbeat-Subscriber-With-Metadata.ino b/examples/OpenCyphal-Heartbeat-Subscriber-With-Metadata/OpenCyphal-Heartbeat-Subscriber-With-Metadata.ino index 30eb2cd5..20c18e88 100644 --- a/examples/OpenCyphal-Heartbeat-Subscriber-With-Metadata/OpenCyphal-Heartbeat-Subscriber-With-Metadata.ino +++ b/examples/OpenCyphal-Heartbeat-Subscriber-With-Metadata/OpenCyphal-Heartbeat-Subscriber-With-Metadata.ino @@ -30,7 +30,7 @@ static int const MKRCAN_MCP2515_INT_PIN = 7; **************************************************************************************/ void onReceiveBufferFull(CanardFrame const &); -void onHeartbeat_1_0_Received(Heartbeat_1_0 const & msg, TransferMetadata const & metadata); +void onHeartbeat_1_0_Received(Heartbeat_1_0 const & msg, cyphal::TransferMetadata const & metadata); /************************************************************************************** * GLOBAL VARIABLES @@ -95,7 +95,7 @@ void onReceiveBufferFull(CanardFrame const & frame) node_hdl.onCanFrameReceived(frame); } -void onHeartbeat_1_0_Received(Heartbeat_1_0 const & msg, TransferMetadata const & metadata) +void onHeartbeat_1_0_Received(Heartbeat_1_0 const & msg, cyphal::TransferMetadata const & metadata) { char msg_buf[70]; snprintf( diff --git a/src/util/transfer_metadata.hpp b/src/util/transfer_metadata.hpp index f508d4c7..86d6b045 100644 --- a/src/util/transfer_metadata.hpp +++ b/src/util/transfer_metadata.hpp @@ -7,8 +7,25 @@ #pragma once +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +namespace cyphal +{ + +/************************************************************************************** + * TYPEDEF + **************************************************************************************/ + struct TransferMetadata final { uint16_t remote_node_id; // More stuff may appear here in the future! }; + +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +} /* cyphal */