diff --git a/DownloadDCJsonFiles.pro b/DownloadDCJsonFiles.pro index 340b0ce..372518b 100644 --- a/DownloadDCJsonFiles.pro +++ b/DownloadDCJsonFiles.pro @@ -67,11 +67,13 @@ contains( CONFIG, DesktopLinux ) { SOURCES += \ main.cpp \ - message_handler.cpp + message_handler.cpp \ + process/command.cpp HEADERS += \ message_handler.h \ - plugins/interfaces.h + plugins/interfaces.h \ + process/command.h OTHER_FILES += \ ATBDownloadDCJsonFiles.ini diff --git a/main.cpp b/main.cpp index dd8d104..b6db3d0 100644 --- a/main.cpp +++ b/main.cpp @@ -7,10 +7,8 @@ #include "plugins/interfaces.h" -#if defined (__unix__) || defined (__linux__) -#include -#include -#endif +//#include +//#include #ifdef PTU5 #define SERIAL_PORT "ttymxc2" @@ -36,5 +34,23 @@ int main(int argc, char **argv) { setDebugLevel(LOG_NOTICE); } + int r = std::system("ls -l /proc/[0-9]*/fd/* 2>/dev/null | grep /dev/ttymxc2 > /tmp/slave-or-master.txt"); + // lrwx------ 1 root root 64 Oct 31 14:55 /proc/884/fd/18 -> /dev/ttymxc2 + + //std::ifstream ifs("/tmp/slave-or-master.txt"); + + //if (ifs.is_open()) { + // std::string line; + // if (std::getline(ifs, line)) { + // if (line.size() > 0) { + // std::cout << "SLAVE " << line << std::endl; + // } + // } else { + // } + + // ifs.close(); + + //} + return a.exec(); } diff --git a/process/command.h b/process/command.h index bc796ee..372e293 100644 --- a/process/command.h +++ b/process/command.h @@ -1,6 +1,5 @@ #ifndef COMMAND_H_INCLUDED #define COMMAND_H_INCLUDED -#endif // COMMAND_H_INCLUDED #include #include @@ -33,3 +32,5 @@ private slots: void readyReadStandardError(); void finished(int exitCode, QProcess::ExitStatus exitStatus); }; + +#endif // COMMAND_H_INCLUDED