From 11ccc50026b05ca736e4a9d0d6c4fc854c7893e6 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 15 Aug 2023 09:53:19 +0800 Subject: [PATCH] update --- src/iflytop/components/zcanreceiver/zcanreceiverhost.hpp | 3 +++ src/iflytop/core/core.hpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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"