Browse Source

update

master
zhaohe 1 year ago
parent
commit
f216cf89e8
  1. 3
      .vscode/settings.json
  2. 4
      src/main_control_service.cpp
  3. 8
      src/service/device_io_control_service_test.cpp

3
.vscode/settings.json

@ -65,6 +65,7 @@
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp",
"codecvt": "cpp"
"codecvt": "cpp",
"bak": "c"
}
}

4
src/main_control_service.cpp

@ -5,6 +5,7 @@
#include "iflytop/core/components/stringutils.hpp"
#include "iflytop/core/core.hpp"
#include "service/device_io_control_service_test.hpp"
#include "service/disinfection_printer_service.hpp"
#include "version.hpp"
using namespace iflytop;
using namespace core;
@ -62,6 +63,9 @@ void MainControlService::initialize() {
});
GET_SERVICE(IflytopFrontEndService)->startListen();
BUILD_AND_REG_SERRVICE(DisinfectionPrinterService);
GET_SERVICE(DisinfectionPrinterService)->initialize();
BUILD_AND_REG_SERRVICE(DisinfectionCtrlService);
GET_SERVICE(DisinfectionCtrlService)->initialize();

8
src/service/device_io_control_service_test.cpp

@ -1,11 +1,17 @@
#include "device_io_control_service_test.hpp"
#include "iflytop/components/uart_printer/uart_printer.hpp"
#include "iflytoplinuxsdk/src/iflytop/components/ziconv.hpp"
using namespace iflytop;
using namespace std;
#define IN_TEST 1
void DeviceIoControlServiceTest::printerPrintf(string str) {}
void DeviceIoControlServiceTest::printerPrintf(string str) { //
logger->info("PP:{}", str);
GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312(str));
}
int32_t DeviceIoControlServiceTest::H2O2Sensor_readH2O2PPM(int32_t sensorid) { return 300 + rand() % 1000; }
int32_t DeviceIoControlServiceTest::H2O2Sensor_readHumid(int32_t sensorid) { return 20 + rand() % 30; }

Loading…
Cancel
Save