diff --git a/libuavcan/include/uavcan/internal/transport/can_io.hpp b/libuavcan/include/uavcan/internal/transport/can_io.hpp index d92c28d2c7..c2a16390ad 100644 --- a/libuavcan/include/uavcan/internal/transport/can_io.hpp +++ b/libuavcan/include/uavcan/internal/transport/can_io.hpp @@ -28,6 +28,8 @@ struct CanRxFrame : public CanFrame , ts_utc(0) , iface_index(0) { } + + std::string toString(StringRepresentation mode = STR_TIGHT) const; }; diff --git a/libuavcan/src/transport/can_io.cpp b/libuavcan/src/transport/can_io.cpp index b1d4d0fed6..e4e3c577f0 100644 --- a/libuavcan/src/transport/can_io.cpp +++ b/libuavcan/src/transport/can_io.cpp @@ -4,12 +4,24 @@ */ #include +#include #include #include #include namespace uavcan { +/* + * CanRxFrame + */ +std::string CanRxFrame::toString(StringRepresentation mode) const +{ + std::ostringstream os; + os << CanFrame::toString(mode) + << " ts_m=" << ts_monotonic << " ts_utc=" << ts_utc << " iface=" << int(iface_index); + return os.str(); +} + /* * CanTxQueue::Entry */