|
|
@ -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> zcanReceiverHost = make_shared<ZCanReceiverHost>(); |
|
|
|
|
|
|
|
zcanReceiverHost->initialize(m_zconfig->get_iflytopSubDeviceCanIFName(), m_zconfig->get_iflytopSubDeviceCanBitrate(), false); |
|
|
|
// while (true) {
|
|
|
|
// shared_ptr<ZCanReceiverCMD> cmd = make_shared<ZCanReceiverCMD>();
|
|
|
|
// 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]() { |
|
|
|
//
|
|
|
|
// {
|
|
|
|