diff --git a/src/iflytop/components/zcanreceiver/zcanreceiverhost.hpp b/src/iflytop/components/zcanreceiver/zcanreceiverhost.hpp index 886d2c4..a41b1f2 100644 --- a/src/iflytop/components/zcanreceiver/zcanreceiverhost.hpp +++ b/src/iflytop/components/zcanreceiver/zcanreceiverhost.hpp @@ -16,6 +16,7 @@ namespace iflytop { using namespace std; using namespace zcr; +using namespace core; class ZCanReceiverCMD { public: @@ -24,6 +25,8 @@ class ZCanReceiverCMD { uint8_t subcmdid; uint8_t data[255 * 8]; size_t len; + + string toString() { return fmt::format("{}-{}:{} {}", packetindex, cmdid, subcmdid, StringUtils().bytesToString(data, len)); } }; class ZCanReceiverHost { diff --git a/src/iflytop/core/core.hpp b/src/iflytop/core/core.hpp index 18dbef5..ab3da2b 100644 --- a/src/iflytop/core/core.hpp +++ b/src/iflytop/core/core.hpp @@ -4,4 +4,5 @@ #include "iflytop/core/components/timeutils.hpp" #include "iflytop/core/error/error_code.hpp" #include "iflytop/core/spdlogfactory/logger.hpp" -#include "iflytop/core/thread/thread.hpp" \ No newline at end of file +#include "iflytop/core/thread/thread.hpp" +#include "iflytop/core/components/stringutils.hpp"