add command-files

This commit is contained in:
Gerhard Hoffmann 2024-02-28 16:50:57 +01:00
parent bb2d53a63a
commit 9e147b4164
3 changed files with 26 additions and 7 deletions

View File

@ -67,11 +67,13 @@ contains( CONFIG, DesktopLinux ) {
SOURCES += \ SOURCES += \
main.cpp \ main.cpp \
message_handler.cpp message_handler.cpp \
process/command.cpp
HEADERS += \ HEADERS += \
message_handler.h \ message_handler.h \
plugins/interfaces.h plugins/interfaces.h \
process/command.h
OTHER_FILES += \ OTHER_FILES += \
ATBDownloadDCJsonFiles.ini ATBDownloadDCJsonFiles.ini

View File

@ -7,10 +7,8 @@
#include "plugins/interfaces.h" #include "plugins/interfaces.h"
#if defined (__unix__) || defined (__linux__) //#include <unistd.h>
#include <unistd.h> //#include <errno.h>
#include <errno.h>
#endif
#ifdef PTU5 #ifdef PTU5
#define SERIAL_PORT "ttymxc2" #define SERIAL_PORT "ttymxc2"
@ -36,5 +34,23 @@ int main(int argc, char **argv) {
setDebugLevel(LOG_NOTICE); 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(); return a.exec();
} }

View File

@ -1,6 +1,5 @@
#ifndef COMMAND_H_INCLUDED #ifndef COMMAND_H_INCLUDED
#define COMMAND_H_INCLUDED #define COMMAND_H_INCLUDED
#endif // COMMAND_H_INCLUDED
#include <QObject> #include <QObject>
#include <QCoreApplication> #include <QCoreApplication>
@ -33,3 +32,5 @@ private slots:
void readyReadStandardError(); void readyReadStandardError();
void finished(int exitCode, QProcess::ExitStatus exitStatus); void finished(int exitCode, QProcess::ExitStatus exitStatus);
}; };
#endif // COMMAND_H_INCLUDED