diff options
Diffstat (limited to 'workspace/LogWriter')
| -rwxr-xr-x | workspace/LogWriter/LogWriter | bin | 30747 -> 35093 bytes | |||
| -rw-r--r-- | workspace/LogWriter/LogWriter.pro | 17 | ||||
| -rw-r--r-- | workspace/LogWriter/logwriter.cpp | 33 | ||||
| -rw-r--r-- | workspace/LogWriter/logwriter.h | 3 |
4 files changed, 40 insertions, 13 deletions
diff --git a/workspace/LogWriter/LogWriter b/workspace/LogWriter/LogWriter Binary files differindex bfcb726..54d4ab8 100755 --- a/workspace/LogWriter/LogWriter +++ b/workspace/LogWriter/LogWriter diff --git a/workspace/LogWriter/LogWriter.pro b/workspace/LogWriter/LogWriter.pro index 112fd84..ba5df47 100644 --- a/workspace/LogWriter/LogWriter.pro +++ b/workspace/LogWriter/LogWriter.pro @@ -1,10 +1,11 @@ TEMPLATE = app -TARGET = LogWriter - -QT += core gui network - -HEADERS += logwriter.h -SOURCES += main.cpp \ +TARGET = LogWriter +QT += core \ + gui \ + network +HEADERS += status.h \ + logwriter.h +SOURCES += main.cpp \ logwriter.cpp -FORMS += logwriter.ui -RESOURCES += +FORMS += logwriter.ui +RESOURCES += diff --git a/workspace/LogWriter/logwriter.cpp b/workspace/LogWriter/logwriter.cpp index 53a4023..94155ed 100644 --- a/workspace/LogWriter/logwriter.cpp +++ b/workspace/LogWriter/logwriter.cpp @@ -9,6 +9,7 @@ #include <QtNetwork> #include "logwriter.h" +#include "status.h" LogWriter::LogWriter(QWidget *parent) : QDialog(parent) { @@ -86,12 +87,34 @@ void LogWriter::enableWriteButton() { } void LogWriter::writeToLogReceiver() { + writeToLogReceiver(STAT_OK,DISCOVER); +} + +void LogWriter::writeToLogReceiver(int stat, int sub_stat) { + char * st = (char *) malloc(sizeof(int)*4+1); + char * sst = (char *) malloc(sizeof(int)*4+1); + sprintf(st,"%d", stat); + sprintf(sst,"%d",sub_stat); + char * msg = "msg test"; + int msize = strlen(st) + strlen(sst) + strlen(msg) + 3; + char * m = (char *) malloc(msize); + strcpy(m, ""); + strcat(m, st); + strcat(m, ";"); + strcat(m, sst); + strcat(m, ";"); + strcat(m, msg); //char buffer[256]; - char *b = "test"; - qDebug() << strlen(b); - int n = ::write(sockfd,b,strlen(b)); - if (n < 0) - qDebug() <<"ERROR writing to socket"; + //char *b = "test"; + qDebug() << strlen(m); + qDebug() << m; + int n = ::write(sockfd, m, strlen(m)); + if (n < 0) + qDebug() << "ERROR writing to socket"; + + free(st); + free(sst); + free(m); } diff --git a/workspace/LogWriter/logwriter.h b/workspace/LogWriter/logwriter.h index 1646433..a4ddea3 100644 --- a/workspace/LogWriter/logwriter.h +++ b/workspace/LogWriter/logwriter.h @@ -4,6 +4,7 @@ #include <QtGui/QDialog> #include <qlocalsocket.h> #include "ui_logwriter.h" +#include "status.h" class QDialogButtonBox; class QLabel; @@ -26,6 +27,8 @@ private slots: void writeToLogReceiver(); private: + // enum STATUS stat, enum SUBSTATUS sub_stat + void writeToLogReceiver(int stat, int sub_stat); Ui::LogWriterClass ui; QLabel *hostLabel; QLineEdit *hostLineEdit; |
