You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.5 KiB

2 years ago
2 months ago
3 months ago
2 months ago
1 year ago
2 years ago
2 years ago
2 years ago
2 months ago
2 months ago
1 year ago
2 years ago
2 years ago
  1. #include <signal.h>
  2. //
  3. #include "app.hpp"
  4. #include "components/linuxsocket//unix_socket.hpp"
  5. #include "configs/version.hpp"
  6. #include "spdlogfactory/logger_factory.hpp"
  7. #include "utils/stringutils.hpp"
  8. //
  9. //
  10. using namespace iflytop;
  11. using namespace core;
  12. using namespace std;
  13. /*******************************************************************************
  14. * MAIN => MAIN *
  15. *******************************************************************************/
  16. int main(int argc, char* argv[]) {
  17. spdlog::flush_on(spdlog::level::debug);
  18. LoggerFactory.initialize();
  19. auto mainLogger = LoggerFactory.createLogger("main");
  20. mainLogger->info("Iflytop Hardware Service Start....");
  21. mainLogger->info("#");
  22. mainLogger->info("# company:{}", "ifytop");
  23. mainLogger->info("# version:{}", VERSION);
  24. mainLogger->info("#");
  25. App app;
  26. app.initialize();
  27. while (true) {
  28. sleep(1);
  29. }
  30. // unique_ptr<UnixScoket> server;
  31. // server.reset(new UnixScoket(UnixScoket::Server, "tdcan"));
  32. // server->start();
  33. // server->onPacket.connect([mainLogger](uint8_t* data, size_t len) {
  34. // if (len > 0) {
  35. // mainLogger->info("Received packet: {}", string((char*)data, len));
  36. // }
  37. // });
  38. // unique_ptr<UnixScoket> client;
  39. // client.reset(new UnixScoket(UnixScoket::Client, "tdcan"));
  40. // client->start();
  41. // while (true) {
  42. // client->sendPacket((uint8_t*)"hello", 5);
  43. // sleep(1);
  44. // }
  45. }