Added RxCanFrame::toString()

This commit is contained in:
Pavel Kirienko 2014-02-14 18:45:49 +04:00
parent d81a96beb2
commit 69fa8643d4
2 changed files with 14 additions and 0 deletions

View File

@ -28,6 +28,8 @@ struct CanRxFrame : public CanFrame
, ts_utc(0)
, iface_index(0)
{ }
std::string toString(StringRepresentation mode = STR_TIGHT) const;
};

View File

@ -4,12 +4,24 @@
*/
#include <algorithm>
#include <sstream>
#include <limits>
#include <uavcan/internal/transport/can_io.hpp>
#include <uavcan/internal/debug.hpp>
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
*/