diff --git a/CMakeLists.txt b/CMakeLists.txt index 395e47c..fc037c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,10 @@ message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") message("PROJECT_NAME: ${PROJECT_NAME}") message("ARCH: ${ARCH}") +if(${ARCH} STREQUAL "amd64") + add_definitions(-DBUILD_ON_PC) +endif() + file( GLOB_RECURSE APP_SRC # @@ -88,6 +92,9 @@ zadd_executable( pthread ixwebsocket z + crypto + ssl + dl sqlite3 # # LINK_DIRECTORIES diff --git a/appsrc/appcomponents/app_errorcode_mgr/app_errorcode_mgr.hpp b/app_protocols/apperrorcode/app_errorcode_mgr.hpp similarity index 100% rename from appsrc/appcomponents/app_errorcode_mgr/app_errorcode_mgr.hpp rename to app_protocols/apperrorcode/app_errorcode_mgr.hpp diff --git a/app_protocols/appexception/appexception.hpp b/app_protocols/appexception/appexception.hpp index 841fb6c..26a151c 100644 --- a/app_protocols/appexception/appexception.hpp +++ b/app_protocols/appexception/appexception.hpp @@ -18,6 +18,7 @@ #include #include "app_protocols/apperrorcode/apperrorcode.hpp" +#include "app_protocols/apperrorcode/app_errorcode_mgr.hpp" #include "iflytop/core/thisclass/thisclass.hpp" namespace iflytop { using namespace std; @@ -30,10 +31,10 @@ class appexception : public std::exception { int32_t m_ecode; appexception(ThisClass &thisclass, string func, int32_t ecode, const string &description) { - thisclass.logger->error("appexception: {} {} ", func, description); this->description = description; this->m_ecode = ecode; this->whatstr = description; + thisclass.logger->error("[{}:{}] throw exception: {} {}", thisclass.className, func, ecode2str(ecode), description); } appexception(ThisClass &thisclass, string func, int32_t ecode, const char *fmt, ...) { @@ -45,7 +46,7 @@ class appexception : public std::exception { this->description = buffer; this->m_ecode = ecode; this->whatstr = buffer; - thisclass.logger->error("appexception: {} {} ", func, description); + thisclass.logger->error("[{}:{}] throw exception: {} {}", thisclass.className, func, ecode2str(ecode), buffer); } virtual ~appexception() {} diff --git a/appdep/iflytop/core/thread/thread.cpp b/appdep/iflytop/core/thread/thread.cpp index 48af79e..a21a16f 100644 --- a/appdep/iflytop/core/thread/thread.cpp +++ b/appdep/iflytop/core/thread/thread.cpp @@ -71,7 +71,7 @@ void Thread::join() { }; Thread::~Thread() { if (!hasJointd) { - logger->error(fmt::format("thread {} unjoin ", name)); + logger->error(fmt::format("fatal error,thread {} unjoin ", name)); exit(-1); } } diff --git a/appdep/libs/libixwebsocket/aarch64/libixwebsocket.a b/appdep/libs/libixwebsocket/aarch64/libixwebsocket.a index 0f1cb72..9195c78 100644 Binary files a/appdep/libs/libixwebsocket/aarch64/libixwebsocket.a and b/appdep/libs/libixwebsocket/aarch64/libixwebsocket.a differ diff --git a/appdep/libs/libixwebsocket/aarch64/libixwebsocket.bak.a b/appdep/libs/libixwebsocket/aarch64/libixwebsocket.bak.a new file mode 100644 index 0000000..0f1cb72 Binary files /dev/null and b/appdep/libs/libixwebsocket/aarch64/libixwebsocket.bak.a differ diff --git a/appdep/libs/libixwebsocket/include/ixwebsocket/IXSocketOpenSSL.h b/appdep/libs/libixwebsocket/include/ixwebsocket/IXSocketOpenSSL.h new file mode 100644 index 0000000..dea1ffd --- /dev/null +++ b/appdep/libs/libixwebsocket/include/ixwebsocket/IXSocketOpenSSL.h @@ -0,0 +1,68 @@ +/* + * IXSocketOpenSSL.h + * Author: Benjamin Sergeant, Matt DeBoer + * Copyright (c) 2017-2020 Machine Zone, Inc. All rights reserved. + */ +#ifdef IXWEBSOCKET_USE_OPEN_SSL + +#pragma once + +#include "IXCancellationRequest.h" +#include "IXSocket.h" +#include "IXSocketTLSOptions.h" +#include +#include +#include +#include +#include +#include + +namespace ix +{ + class SocketOpenSSL final : public Socket + { + public: + SocketOpenSSL(const SocketTLSOptions& tlsOptions, int fd = -1); + ~SocketOpenSSL(); + + virtual bool accept(std::string& errMsg) final; + + virtual bool connect(const std::string& host, + int port, + std::string& errMsg, + const CancellationRequest& isCancellationRequested) final; + virtual void close() final; + + virtual ssize_t send(char* buffer, size_t length) final; + virtual ssize_t recv(void* buffer, size_t length) final; + + private: + void openSSLInitialize(); + std::string getSSLError(int ret); + SSL_CTX* openSSLCreateContext(std::string& errMsg); + bool openSSLAddCARootsFromString(const std::string roots); + bool openSSLClientHandshake(const std::string& hostname, + std::string& errMsg, + const CancellationRequest& isCancellationRequested); + bool openSSLCheckServerCert(SSL* ssl, const std::string& hostname, std::string& errMsg); + bool checkHost(const std::string& host, const char* pattern); + bool handleTLSOptions(std::string& errMsg); + bool openSSLServerHandshake(std::string& errMsg); + + // Required for OpenSSL < 1.1 + static void openSSLLockingCallback(int mode, int type, const char* /*file*/, int /*line*/); + + SSL* _ssl_connection; + SSL_CTX* _ssl_context; + const SSL_METHOD* _ssl_method; + SocketTLSOptions _tlsOptions; + + mutable std::mutex _mutex; // OpenSSL routines are not thread-safe + + static std::once_flag _openSSLInitFlag; + static std::atomic _openSSLInitializationSuccessful; + }; + +} // namespace ix + +#endif // IXWEBSOCKET_USE_OPEN_SSL diff --git a/appsrc/appbase/appbasedep.hpp b/appsrc/appbase/appbasedep.hpp index 80207f4..e53b55d 100644 --- a/appsrc/appbase/appbasedep.hpp +++ b/appsrc/appbase/appbasedep.hpp @@ -9,6 +9,7 @@ #include "app_protocols/apperrorcode/apperrorcode.hpp" #include "app_protocols/appexception/appexception.hpp" #include "app_protocols/transmit_disfection_protocol/transmit_disfection_protocol.hpp" +#include "app_protocols/apperrorcode/app_errorcode_mgr.hpp" // #include "components/sqlite_orm/sqlite_orm.hpp" diff --git a/appsrc/appcomponents/canchannel/com/canerrorcode_dumper.hpp b/appsrc/appcomponents/canchannel/com/canerrorcode_dumper.hpp new file mode 100644 index 0000000..e69de29 diff --git a/appsrc/appcomponents/canchannel/com/socket_can.cpp b/appsrc/appcomponents/canchannel/com/socket_can.cpp index 1913fd5..efe59ed 100644 --- a/appsrc/appcomponents/canchannel/com/socket_can.cpp +++ b/appsrc/appcomponents/canchannel/com/socket_can.cpp @@ -1,7 +1,101 @@ #include "socket_can.hpp" +#include "linux/can/error.h" using namespace iflytop; +static bool isInPc() { +#if (defined BUILD_ON_PC) // x86平台 + return true; +#else + return false; +#endif +} + +string dumpcanerror(canfd_frame_t *frame) { + uint32_t canid = frame->can_id; + uint8_t *data = frame->data; + string error; + error = "Error:[ "; + if (canid & CAN_ERR_TX_TIMEOUT) error += "CAN_ERR_TX_TIMEOUT,"; + if (canid & CAN_ERR_LOSTARB) error += "CAN_ERR_LOSTARB,"; + if (canid & CAN_ERR_CRTL) error += "CAN_ERR_CRTL,"; + if (canid & CAN_ERR_PROT) error += "CAN_ERR_PROT,"; + if (canid & CAN_ERR_TRX) error += "CAN_ERR_TRX,"; + if (canid & CAN_ERR_ACK) error += "CAN_ERR_ACK,"; + if (canid & CAN_ERR_BUSOFF) error += "CAN_ERR_BUSOFF,"; + if (canid & CAN_ERR_BUSERROR) error += "CAN_ERR_BUSERROR,"; + if (canid & CAN_ERR_RESTARTED) error += "CAN_ERR_RESTARTED,"; + error += " ]"; + error += ","; + + if (data[1] != 0) { + string suberror; + if (data[1] == CAN_ERR_CRTL_RX_OVERFLOW) suberror = "RX buffer overflow"; + if (data[1] == CAN_ERR_CRTL_TX_OVERFLOW) suberror = "TX buffer overflow"; + if (data[1] == CAN_ERR_CRTL_RX_WARNING) suberror = "reached warning level for RX errors"; + if (data[1] == CAN_ERR_CRTL_TX_WARNING) suberror = "reached warning level for TX errors"; + if (data[1] == CAN_ERR_CRTL_RX_PASSIVE) suberror = "reached error passive status RX"; + if (data[1] == CAN_ERR_CRTL_TX_PASSIVE) suberror = "reached error passive status TX"; + if (data[1] == CAN_ERR_CRTL_ACTIVE) suberror = "recovered to error active state"; + error += fmt::format("CAN-controller e:(0x{:x}),{}", data[1], suberror); + } + + if (data[2] != 0) { + string suberror; + if (data[2] == CAN_ERR_PROT_BIT) suberror = "single bit error"; + if (data[2] == CAN_ERR_PROT_FORM) suberror = "frame format error"; + if (data[2] == CAN_ERR_PROT_STUFF) suberror = "bit stuffing error"; + if (data[2] == CAN_ERR_PROT_BIT0) suberror = "unable to send dominant bit"; + if (data[2] == CAN_ERR_PROT_BIT1) suberror = "unable to send recessive bit"; + if (data[2] == CAN_ERR_PROT_OVERLOAD) suberror = "bus overload"; + if (data[2] == CAN_ERR_PROT_ACTIVE) suberror = "active error announcement"; + if (data[2] == CAN_ERR_PROT_TX) suberror = "error occurred on transmission"; + error += fmt::format("CAN-proto e:(0x{:x}),{}", data[2], suberror); + } + + if (data[3] != 0) { + string suberror; + /* error in CAN protocol (location) / data[3] */ + if (data[3] == CAN_ERR_PROT_LOC_UNSPEC) suberror = "unspecified "; + if (data[3] == CAN_ERR_PROT_LOC_SOF) suberror = "start of frame "; + if (data[3] == CAN_ERR_PROT_LOC_ID28_21) suberror = "ID bits 28 - 21 (SFF: 10 - 3) "; + if (data[3] == CAN_ERR_PROT_LOC_ID20_18) suberror = "ID bits 20 - 18 (SFF: 2 - 0 )"; + if (data[3] == CAN_ERR_PROT_LOC_SRTR) suberror = "substitute RTR (SFF: RTR) "; + if (data[3] == CAN_ERR_PROT_LOC_IDE) suberror = "identifier extension "; + if (data[3] == CAN_ERR_PROT_LOC_ID17_13) suberror = "ID bits 17-13 "; + if (data[3] == CAN_ERR_PROT_LOC_ID12_05) suberror = "ID bits 12-5 "; + if (data[3] == CAN_ERR_PROT_LOC_ID04_00) suberror = "ID bits 4-0 "; + if (data[3] == CAN_ERR_PROT_LOC_RTR) suberror = "RTR "; + if (data[3] == CAN_ERR_PROT_LOC_RES1) suberror = "reserved bit 1 "; + if (data[3] == CAN_ERR_PROT_LOC_RES0) suberror = "reserved bit 0 "; + if (data[3] == CAN_ERR_PROT_LOC_DLC) suberror = "data length code "; + if (data[3] == CAN_ERR_PROT_LOC_DATA) suberror = "data section "; + if (data[3] == CAN_ERR_PROT_LOC_CRC_SEQ) suberror = "CRC sequence "; + if (data[3] == CAN_ERR_PROT_LOC_CRC_DEL) suberror = "CRC delimiter "; + if (data[3] == CAN_ERR_PROT_LOC_ACK) suberror = "ACK slot "; + if (data[3] == CAN_ERR_PROT_LOC_ACK_DEL) suberror = "ACK delimiter "; + if (data[3] == CAN_ERR_PROT_LOC_EOF) suberror = "end of frame "; + if (data[3] == CAN_ERR_PROT_LOC_INTERM) suberror = "intermission "; + error += fmt::format("CAN-proto l:{:x},{}", data[3], suberror); + } + + if (data[4] != 0) { + string suberror; + if (data[4] == CAN_ERR_TRX_UNSPEC) suberror = "unspecified "; + if (data[4] == CAN_ERR_TRX_CANH_NO_WIRE) suberror = "CANH no wire "; + if (data[4] == CAN_ERR_TRX_CANH_SHORT_TO_BAT) suberror = "CANH short to battery "; + if (data[4] == CAN_ERR_TRX_CANH_SHORT_TO_VCC) suberror = "CANH short to VCC "; + if (data[4] == CAN_ERR_TRX_CANH_SHORT_TO_GND) suberror = "CANH short to GND "; + if (data[4] == CAN_ERR_TRX_CANL_NO_WIRE) suberror = "CANL no wire "; + if (data[4] == CAN_ERR_TRX_CANL_SHORT_TO_BAT) suberror = "CANL short to battery "; + if (data[4] == CAN_ERR_TRX_CANL_SHORT_TO_VCC) suberror = "CANL short to VCC "; + if (data[4] == CAN_ERR_TRX_CANL_SHORT_TO_GND) suberror = "CANL short to GND "; + if (data[4] == CAN_ERR_TRX_CANL_SHORT_TO_CANH) suberror = "CANL short to CANH "; + error += fmt::format("CAN-trx e:(0x{:x}),{}", data[4], suberror); + } + return error; +} + /******************************************************************************* * UTILS * *******************************************************************************/ @@ -64,6 +158,11 @@ bool SocketCan::isTxFrame(const canfd_frame_t &frame) { *******************************************************************************/ void SocketCan::initialize(const char *canname, int baudrate, bool enableLoopBack) { + if (isInPc()) { + logger->info("in pc, skip initialize can bus"); + return; + } + m_canname = canname; m_baudrate = baudrate; m_enableLoopBack = enableLoopBack; @@ -72,6 +171,9 @@ void SocketCan::initialize(const char *canname, int baudrate, bool enableLoopBac } bool SocketCan::sendFrame(CANUSB_FRAME frametype, uint32_t id, unsigned char data[], int data_length_code, int32_t overtime) { + if (isInPc()) { + return true; + } tp_steady start = tu_steady().now(); while (tu_steady().elapsedTimeMs(start) < overtime && !m_canBusIsReady) { @@ -105,6 +207,9 @@ bool SocketCan::sendFrame(CANUSB_FRAME frametype, uint32_t id, unsigned char dat } bool SocketCan::sendFrame(canfd_frame_t &frame, int32_t overtime) { + if (isInPc()) { + return true; + } if (!m_canBusIsReady) { logger->error("can bus is not ready"); return false; @@ -250,6 +355,7 @@ void SocketCan::socketCanReadThreadLoop() { // /usr/include/linux/can/error.h // x can-bus error event 20000004,0004000000000086 logger->error("rx can-bus error event {:x},{}", canframe.can_id, StringUtils().bytesToString(canframe.data, canframe.len)); + logger->error("can error:{}", dumpcanerror(&canframe)); unsetTxStateToTxing(); break; } else { diff --git a/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp b/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp index d6cf0db..178e6b6 100644 --- a/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp +++ b/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp @@ -2,7 +2,6 @@ #include -#include "appcomponents/app_errorcode_mgr/app_errorcode_mgr.hpp" #include "app_protocols/appexception/appexception.hpp" using namespace iflytop; diff --git a/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.cpp b/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.cpp index 0798bb0..89c6665 100644 --- a/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.cpp +++ b/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.cpp @@ -1,6 +1,5 @@ #include "transmit_disinfection_can_master.hpp" -#include "appcomponents/app_errorcode_mgr/app_errorcode_mgr.hpp" using namespace iflytop; using namespace zscanprotocol; using namespace transmit_disfection_protocol; diff --git a/appsrc/baseservice/baseservice.hpp b/appsrc/baseservice/baseservice.hpp index f35100e..ea33585 100644 --- a/appsrc/baseservice/baseservice.hpp +++ b/appsrc/baseservice/baseservice.hpp @@ -2,7 +2,6 @@ #include "appbase/appbase.hpp" #include "appsetting/appsetting.hpp" // -#include "appcomponents/app_errorcode_mgr/app_errorcode_mgr.hpp" #include "appcomponents/canchannel/transmit_disinfection_can_master.hpp" #include "db/db_service.hpp" #include "devicestate/device_state_service.hpp" diff --git a/appsrc/baseservice/front_msg_processer/front_msg_processer.cpp b/appsrc/baseservice/front_msg_processer/front_msg_processer.cpp index ef758bd..93358a3 100644 --- a/appsrc/baseservice/front_msg_processer/front_msg_processer.cpp +++ b/appsrc/baseservice/front_msg_processer/front_msg_processer.cpp @@ -1,6 +1,5 @@ #include "front_msg_processer.hpp" -#include "appcomponents/app_errorcode_mgr/app_errorcode_mgr.hpp" #include "iflytop/core/error/error_code.hpp" using namespace iflytop; diff --git a/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.cpp b/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.cpp index 7e83db7..af38845 100644 --- a/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.cpp +++ b/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.cpp @@ -1,6 +1,5 @@ #include "iflytop_front_end_service.hpp" -#include "appcomponents/app_errorcode_mgr/app_errorcode_mgr.hpp" using namespace nlohmann; using namespace iflytop; using namespace std; @@ -15,6 +14,9 @@ void IflytopFrontEndService::initialize(string ip) { m_workQueue->startWork(); m_server.reset(new WebSocketServer(19001, ip)); + SocketTLSOptions tlsOptions; + // tlsOptions.tls = true; + m_server->setTLSOptions(tlsOptions); m_server->setOnConnectionCallback([this](weak_ptr webSocket, shared_ptr connectionState) { logger->info("Remote ip: {}", connectionState->getRemoteIp()); auto ws = webSocket.lock(); diff --git a/appsrc/main.cpp b/appsrc/main.cpp index fe574d3..3a0c380 100644 --- a/appsrc/main.cpp +++ b/appsrc/main.cpp @@ -85,7 +85,6 @@ int Main::main(int argc, char *argv[]) { // 构造MainControlService BUILD_AND_REG_SERRVICE(MainControlService); - GET_SERVICE(MainControlService)->initialize(); logger->info("system setup end."); while (true) sleep(1000); } diff --git a/appsrc/service/hardware/device_ctrl_service.cpp b/appsrc/service/hardware/device_ctrl_service.cpp index 4cf4063..5950fcf 100644 --- a/appsrc/service/hardware/device_ctrl_service.cpp +++ b/appsrc/service/hardware/device_ctrl_service.cpp @@ -16,8 +16,8 @@ using namespace core; * */ -bool isInPc() { -#if (defined __i386__) || (defined __x86_64__) // x86平台 +static bool isInPc() { +#if (defined BUILD_ON_PC) // x86平台 return true; #else return false; @@ -39,6 +39,7 @@ void DeviceIoControlService::initialize() { if (isInPc()) { logger->warn("run in pc, skip initialize device io control service"); return; + } else { } TransmitDisinfectionCanMaster::ins()->initialize(m_config->get_canIF().c_str(), m_config->get_canBitrate(), false); diff --git a/appsrc/service/hardware/disinfectant_weight_update_service.cpp b/appsrc/service/hardware/disinfectant_weight_update_service.cpp index 23acb65..33dbaf0 100644 --- a/appsrc/service/hardware/disinfectant_weight_update_service.cpp +++ b/appsrc/service/hardware/disinfectant_weight_update_service.cpp @@ -6,7 +6,9 @@ using namespace std; void DisinfectantWeightUpdateService::initialize() { // GET_TO_SERVICE(deviceIoControlService); - updateThread.reset(new Thread("DisinfectantWeightUpdateService", [this]() { updateWeightThread(); })); + updateThread.reset(new Thread("DisinfectantWeightUpdateService", [this]() { // + updateWeightThread(); + })); } float DisinfectantWeightUpdateService::getWeight() { // @@ -14,9 +16,13 @@ float DisinfectantWeightUpdateService::getWeight() { // } void DisinfectantWeightUpdateService::updateWeightThread() { while (true) { - float weightCache = deviceIoControlService->DisinfectantVolume_readVal(); - weightCache = filter.filter(weightCache); - logger->info("weight {}", weightCache); - sleep(1000); + try { + float weightCache = deviceIoControlService->DisinfectantVolume_readVal(); + weightCache = filter.filter(weightCache); + logger->info("weight {} g", weightCache); + } catch (const std::exception& e) { + logger->error("updateWeightThread error: {}", e.what()); + } + sleep(1); } } \ No newline at end of file diff --git a/appsrc/service/hardware/warning_light_controler.cpp b/appsrc/service/hardware/warning_light_controler.cpp index 92742ac..052d9b7 100644 --- a/appsrc/service/hardware/warning_light_controler.cpp +++ b/appsrc/service/hardware/warning_light_controler.cpp @@ -24,6 +24,7 @@ void WarningLightControler::workThread() { void WarningLightControler::initialize() { GET_TO_SERVICE(dcs); + logger->warn("WarningLightControler initialize"); m_thread.reset(new Thread("LightCtrlServiceThread", std::bind(&WarningLightControler::workThread, this))); } @@ -31,7 +32,7 @@ void WarningLightControler::beepCtrl(lightState_t state) { switch (state) { case kstate_warning: m_beepState = !m_beepState; - dcs->WarningLight_setState(255, 0, 0, m_beepState ? 255 : 0); + ctrlLightNoEx(255, 0, 0, m_beepState ? 255 : 0); break; default: break; @@ -44,38 +45,19 @@ void WarningLightControler::changeLightState(lightState_t state) { switch (m_nowState) { case kstate_idle: // 绿色 - dcs->WarningLight_setState(0, 255, 0, 0); + ctrlLightNoEx(0, 255, 0, 0); break; case kstate_work: // 黄色 - dcs->WarningLight_setState(0, 0, 255, 0); + ctrlLightNoEx(0, 0, 255, 0); break; case kstate_warning: // 红色 - dcs->WarningLight_setState(255, 0, 0, 0); + ctrlLightNoEx(255, 0, 0, 0); break; default: break; } - - // #if (defined PROJECT_TYPE_PIPE_DISINFECTION) - // switch (m_nowState) { - // case kstate_idle: - // // 绿色 - // m_deviceIoControlService->warningLightCtrl(0, 255, 0, 0); - // break; - // case kstate_work: - // // 黄色 - // m_deviceIoControlService->warningLightCtrl(255, 255, 0, 0); - // break; - // case kstate_warning: - // // 红色 - // m_deviceIoControlService->warningLightCtrl(255, 0, 0, 0); - // break; - // default: - // break; - // } - // #endif } WarningLightControler::lightState_t WarningLightControler::inferTheCurrentLightingState() { @@ -87,3 +69,11 @@ WarningLightControler::lightState_t WarningLightControler::inferTheCurrentLighti } return kstate_idle; } + +void WarningLightControler::ctrlLightNoEx(int r, int g, int b, int warning) { + try { + dcs->WarningLight_setState(r, g, b, warning); + } catch (const std::exception& e) { + logger->error("do WarningLight_setState error: {}", e.what()); + } +} diff --git a/appsrc/service/hardware/warning_light_controler.hpp b/appsrc/service/hardware/warning_light_controler.hpp index c1f504e..7771df9 100644 --- a/appsrc/service/hardware/warning_light_controler.hpp +++ b/appsrc/service/hardware/warning_light_controler.hpp @@ -45,7 +45,7 @@ class WarningLightControler : public enable_shared_from_this dcs; - unique_ptr m_thread; + unique_ptr m_thread; bool m_workFlag = false; bool m_warningFlag = false; @@ -63,6 +63,9 @@ class WarningLightControler : public enable_shared_from_thiscmd; receipt = cxt->receipt; }); + }; diff --git a/buildpc.sh b/buildpc.sh index 3b9feb1..f68ef71 100755 --- a/buildpc.sh +++ b/buildpc.sh @@ -9,7 +9,7 @@ # PROJECT_TYPE_DRAW_BAR_BOX # -mkdir -p build +mkdir -p build && rm -rf build && mkdir build inittestdata.sh cd build