Browse Source

update

master
zhaohe 1 year ago
parent
commit
0874656f06
  1. 2
      iflytoplinuxsdk
  2. 2
      src/api/cmds/selftest_cmd_impl.cpp
  3. 1
      src/api/cmds/selftest_cmd_impl.hpp
  4. 15
      src/api/cmds/test_page_cmd_impl.cpp
  5. 2
      src/api/cmds/test_page_cmd_impl.hpp
  6. 6
      src/main.cpp
  7. 6
      src/service/device_io_control_service.cpp

2
iflytoplinuxsdk

@ -1 +1 @@
Subproject commit a69fabaacf14348ad2913136f417397e0fea4462
Subproject commit aee79871ce50d2f4f636dc28971e51351cfab1d7

2
src/api/cmds/selftest_cmd_impl.cpp

@ -69,4 +69,4 @@ void SelfTestCmdImpl::selfTest_setEvaporationBinWaterDetection(json& cmd, json&
#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) #if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION)
p->selfTest_setEvaporationBinWaterDetection(val); p->selfTest_setEvaporationBinWaterDetection(val);
#endif #endif
}
}

1
src/api/cmds/selftest_cmd_impl.hpp

@ -52,6 +52,7 @@ class SelfTestCmdImpl : public enable_shared_from_this<SelfTestCmdImpl> {
void selfTest_setH2O2Val(json& cmd, json& receipt); void selfTest_setH2O2Val(json& cmd, json& receipt);
void selfTest_setDeviceBottomWaterDetectionSensor(json& cmd, json& receipt); void selfTest_setDeviceBottomWaterDetectionSensor(json& cmd, json& receipt);
void selfTest_setEvaporationBinWaterDetection(json& cmd, json& receipt); void selfTest_setEvaporationBinWaterDetection(json& cmd, json& receipt);
private: private:
}; };
} // namespace iflytop } // namespace iflytop

15
src/api/cmds/test_page_cmd_impl.cpp

@ -166,4 +166,19 @@ void TestPageCmdImpl::initialize() {
m_msgProcesser->registerMsgProcesser("DBDBTestPage__extValBoardIsOnline", BIND(TestPageCmdImpl::DBDBTestPage__extValBoardIsOnline)); m_msgProcesser->registerMsgProcesser("DBDBTestPage__extValBoardIsOnline", BIND(TestPageCmdImpl::DBDBTestPage__extValBoardIsOnline));
#endif #endif
m_msgProcesser->registerMsgProcesser("TestPage_printerTest", BIND(TestPageCmdImpl::TestPage_printerTest));
}
void TestPageCmdImpl::TestPage_printerTest(json& cmd, json& receipt) {
logger->info("TestPage_printerTest");
m_deviceIoControlService->printerPrintf("你好中国\n");
m_deviceIoControlService->printerPrintf("abcdefghijklmnopqrstuvwxyz\n");
m_deviceIoControlService->printerPrintf("ABCDEFGHIJKLMNOPQRSTUVWXYZ\n");
m_deviceIoControlService->printerPrintf("0123456789\n");
m_deviceIoControlService->printerPrintf("+_)(*&^%$#@!~`-=[]\\{}|;':\",./<>?\n");
m_deviceIoControlService->printerPrintf("\n");
m_deviceIoControlService->printerPrintf("\n");
m_deviceIoControlService->printerPrintf("\n");
return;
} }

2
src/api/cmds/test_page_cmd_impl.hpp

@ -76,5 +76,7 @@ class TestPageCmdImpl : public enable_shared_from_this<TestPageCmdImpl> {
void DBDBTestPage__extValveCtrl(json& cmd, json& receipt); void DBDBTestPage__extValveCtrl(json& cmd, json& receipt);
void DBDBTestPage__extValBoardIsOnline(json& cmd, json& receipt); void DBDBTestPage__extValBoardIsOnline(json& cmd, json& receipt);
#endif #endif
void TestPage_printerTest(json& cmd, json& receipt);
}; };
} // namespace iflytop } // namespace iflytop

6
src/main.cpp

@ -4,6 +4,7 @@
#include <sqlite3.h> #include <sqlite3.h>
#include "iflytop/components/uart_printer/uart_printer.hpp" #include "iflytop/components/uart_printer/uart_printer.hpp"
#include "configs/project_setting.hpp"
using namespace iflytop; using namespace iflytop;
using namespace core; using namespace core;
@ -47,7 +48,12 @@ int Main::main(int argc, char *argv[]) {
g_in_test = GET_SERVICE(GConfig)->get_testMode(); g_in_test = GET_SERVICE(GConfig)->get_testMode();
BUILD_AND_REG_SERRVICE(UartPrinter); BUILD_AND_REG_SERRVICE(UartPrinter);
#ifdef PROJECT_TYPE_DRAW_BAR_BOX
GET_SERVICE(UartPrinter)->initialize("/dev/ttyUSB0", "9600");
#else
GET_SERVICE(UartPrinter)->initialize("/dev/ttyS5", "9600"); GET_SERVICE(UartPrinter)->initialize("/dev/ttyS5", "9600");
#endif
/** /**
* @brief * @brief

6
src/service/device_io_control_service.cpp

@ -12,7 +12,6 @@
using namespace iflytop; using namespace iflytop;
using namespace std; using namespace std;
static inline int filter(int data) { static inline int filter(int data) {
static list<int> q; static list<int> q;
q.push_back(data); q.push_back(data);
@ -219,7 +218,10 @@ void DeviceIoControlService::startScan() {
* SensorState * * SensorState *
*******************************************************************************/ *******************************************************************************/
void DeviceIoControlService::printerPrintf(string str) { GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312(str)); }
void DeviceIoControlService::printerPrintf(string str) {
logger->info("{}", str);
GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312(str));
}
void DeviceIoControlService::processReportPacket(uint8_t* packet, size_t len) { // void DeviceIoControlService::processReportPacket(uint8_t* packet, size_t len) { //
auto* cmdpacket = (transmit_disinfection_protocol_header_t*)packet; auto* cmdpacket = (transmit_disinfection_protocol_header_t*)packet;

Loading…
Cancel
Save