diff --git a/iflytoplinuxsdk b/iflytoplinuxsdk index 4b77d8a..11ccc50 160000 --- a/iflytoplinuxsdk +++ b/iflytoplinuxsdk @@ -1 +1 @@ -Subproject commit 4b77d8a85c6627652a1f8933042b1e8d79454e46 +Subproject commit 11ccc50026b05ca736e4a9d0d6c4fc854c7893e6 diff --git a/src/main_control_service.cpp b/src/main_control_service.cpp index e2e9d90..41a14fc 100644 --- a/src/main_control_service.cpp +++ b/src/main_control_service.cpp @@ -1,6 +1,7 @@ #include "main_control_service.hpp" #include "configs/project_setting.hpp" +#include "iflytop/components/zcanreceiver/zcanreceiverhost.hpp" #include "iflytop/core/components/stringutils.hpp" #include "iflytop/core/core.hpp" #include "version.hpp" @@ -59,6 +60,24 @@ void MainControlService::initialize() { m_dbService.reset(new DBService()); m_dbService->initialize(); + shared_ptr zcanReceiverHost = make_shared(); + + zcanReceiverHost->initialize(m_zconfig->get_iflytopSubDeviceCanIFName(), m_zconfig->get_iflytopSubDeviceCanBitrate(), false); + // while (true) { + // shared_ptr cmd = make_shared(); + // cmd->packetindex = 1; + // cmd->cmdid = 1004; + // cmd->subcmdid = 0; + // cmd->data[0] = 0x02; + // cmd->data[1] = 0; + // *(int16_t*)(&cmd->data[2]) = 300; + // *(int16_t*)(&cmd->data[4]) = -1000; + // cmd->len = 6; + // logger->info("send cmd:{}", cmd->toString()); + // zcanReceiverHost->sendcmdblock(cmd, 100); + // sleep(3); + // } + m_reportThread.reset(new Thread("reportThread", [this]() { // // {