├── transmit_system ├── transfer_tcp_server │ ├── config.ini │ ├── icon │ │ ├── icon.qrc │ │ └── color.png │ ├── util.cpp │ ├── main.cpp │ ├── util.h │ ├── tcpclientsocket.h │ ├── server.h │ ├── maxwall_tcp_server.pro │ ├── tcpserver.h │ ├── tcpclientsocket.cpp │ ├── server.cpp │ ├── tcpserver.cpp │ └── maxwall_tcp_server.pro.user └── transfer_tcp_client │ ├── config.ini │ ├── icon │ ├── icon.qrc │ └── color.png │ ├── main.cpp │ ├── maxwall_tcp_client.pro │ ├── tcpclient.h │ ├── tcpclient.cpp │ └── maxwall_tcp_client.pro.user ├── transmit_server └── transmit │ ├── icon │ ├── color.png │ └── icon.qrc │ ├── util.cpp │ ├── main.cpp │ ├── util.h │ ├── tcpclientsocket.h │ ├── server.h │ ├── maxwall_tcp_transmit.pro │ ├── tcptransmit.h │ ├── tcpclientsocket.cpp │ ├── server.cpp │ ├── tcptransmit.cpp │ └── maxwall_tcp_transmit.pro.user ├── .gitignore ├── README.md └── LICENSE /transmit_system/transfer_tcp_server/config.ini: -------------------------------------------------------------------------------- 1 | [DevOption] 2 | COM=COM3 3 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_client/config.ini: -------------------------------------------------------------------------------- 1 | [DevOption] 2 | COM=COM6 3 | ServerIP=127.0.0.1 4 | -------------------------------------------------------------------------------- /transmit_server/transmit/icon/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bleichroder/RS232-to-TCP/HEAD/transmit_server/transmit/icon/color.png -------------------------------------------------------------------------------- /transmit_server/transmit/icon/icon.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | color.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_client/icon/icon.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | color.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/icon/icon.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | color.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_client/icon/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bleichroder/RS232-to-TCP/HEAD/transmit_system/transfer_tcp_client/icon/color.png -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/icon/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bleichroder/RS232-to-TCP/HEAD/transmit_system/transfer_tcp_server/icon/color.png -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/util.cpp: -------------------------------------------------------------------------------- 1 | #include "util.h" 2 | 3 | Util::Util() 4 | { 5 | } 6 | Util::~Util() 7 | { 8 | } 9 | QFile *Util::file = new QFile("log.txt"); 10 | -------------------------------------------------------------------------------- /transmit_server/transmit/util.cpp: -------------------------------------------------------------------------------- 1 | #include "util.h" 2 | 3 | Util::Util() 4 | { 5 | } 6 | Util::~Util() 7 | { 8 | } 9 | QFile *Util::file = new QFile("log.txt"); 10 | int Util::des = 0; 11 | 12 | -------------------------------------------------------------------------------- /transmit_server/transmit/main.cpp: -------------------------------------------------------------------------------- 1 | #include "tcptransmit.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | TcpTransmit w; 8 | //w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_client/main.cpp: -------------------------------------------------------------------------------- 1 | #include "tcpclient.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | TcpClient w; 8 | //w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/main.cpp: -------------------------------------------------------------------------------- 1 | #include "tcpserver.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | TcpServer w; 8 | //w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL 2 | #define UTIL 3 | 4 | #include 5 | #include 6 | 7 | class Util 8 | { 9 | public: 10 | Util(); 11 | ~Util(); 12 | 13 | public: 14 | static QFile *file; 15 | }; 16 | 17 | #endif // UTIL 18 | 19 | -------------------------------------------------------------------------------- /transmit_server/transmit/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | #include 5 | #include 6 | 7 | class Util 8 | { 9 | public: 10 | Util(); 11 | ~Util(); 12 | 13 | public: 14 | static QFile *file; 15 | static int des; 16 | }; 17 | 18 | #endif // UTIL_H 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | *.smod 19 | 20 | # Compiled Static libraries 21 | *.lai 22 | *.la 23 | *.a 24 | *.lib 25 | 26 | # Executables 27 | *.exe 28 | *.out 29 | *.app 30 | -------------------------------------------------------------------------------- /transmit_server/transmit/tcpclientsocket.h: -------------------------------------------------------------------------------- 1 | #ifndef TCPCLIENTSOCKET_H 2 | #define TCPCLIENTSOCKET_H 3 | 4 | #include 5 | #include "util.h" 6 | 7 | class TcpClientSocket : public QTcpSocket 8 | { 9 | Q_OBJECT 10 | public: 11 | TcpClientSocket(QObject *parent = 0); 12 | 13 | signals: 14 | void sendserial(QByteArray); 15 | void disconnected(int); 16 | protected slots: 17 | void dataReceived(); 18 | void slotDisconnected(); 19 | }; 20 | 21 | #endif // TCPCLIENTSOCKET_H 22 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/tcpclientsocket.h: -------------------------------------------------------------------------------- 1 | #ifndef TCPCLIENTSOCKET_H 2 | #define TCPCLIENTSOCKET_H 3 | #include 4 | #include "util.h" 5 | 6 | class TcpClientSocket : public QTcpSocket 7 | { 8 | Q_OBJECT 9 | public: 10 | TcpClientSocket(QObject *parent = 0); 11 | 12 | signals: 13 | void sendserial(QByteArray); 14 | void disconnected(int); 15 | protected slots: 16 | void dataReceived(); 17 | void slotDisconnected(); 18 | }; 19 | 20 | #endif // TCPCLIENTSOCKET_H 21 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_client/maxwall_tcp_client.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-03-02T11:15:59 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | QT += network 9 | QT += serialport 10 | 11 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 12 | 13 | TARGET = maxwall_tcp_client 14 | TEMPLATE = app 15 | 16 | 17 | SOURCES += main.cpp\ 18 | tcpclient.cpp 19 | 20 | HEADERS += tcpclient.h 21 | 22 | RESOURCES += \ 23 | icon/icon.qrc 24 | -------------------------------------------------------------------------------- /transmit_server/transmit/server.h: -------------------------------------------------------------------------------- 1 | #ifndef SERVER_H 2 | #define SERVER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "tcpclientsocket.h" 8 | #include "util.h" 9 | 10 | class Server : public QTcpServer 11 | { 12 | Q_OBJECT 13 | public: 14 | Server(QObject *parent = 0, int port = 0); 15 | QList tcpClientSocketList; 16 | signals: 17 | void sendserial(QByteArray); 18 | public slots: 19 | void sendCmd(QString, int); 20 | void slotDisconnected(int); 21 | void slotsendserial(QByteArray); 22 | protected: 23 | void incomingConnection(int socketDescriptor); 24 | }; 25 | 26 | #endif // SERVER_H 27 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/server.h: -------------------------------------------------------------------------------- 1 | #ifndef SERVER_H 2 | #define SERVER_H 3 | #include 4 | #include 5 | #include 6 | #include "tcpclientsocket.h" 7 | #include "util.h" 8 | 9 | class Server : public QTcpServer 10 | { 11 | Q_OBJECT 12 | public: 13 | Server(QObject *parent = 0, int port = 0); 14 | QList tcpClientSocketList; 15 | signals: 16 | void sendserial(QByteArray); 17 | public slots: 18 | void sendCmd(QString, int); 19 | void slotDisconnected(int); 20 | void slotsendserial(QByteArray); 21 | protected: 22 | void incomingConnection(int socketDescriptor); 23 | }; 24 | 25 | #endif // SERVER_H 26 | -------------------------------------------------------------------------------- /transmit_server/transmit/maxwall_tcp_transmit.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-03-08T11:12:14 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | QT += network 9 | QT += serialport 10 | 11 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 12 | 13 | TARGET = maxwall_tcp_transmit 14 | TEMPLATE = app 15 | 16 | 17 | SOURCES += main.cpp\ 18 | tcptransmit.cpp \ 19 | server.cpp \ 20 | tcpclientsocket.cpp \ 21 | util.cpp 22 | 23 | HEADERS += tcptransmit.h \ 24 | server.h \ 25 | tcpclientsocket.h \ 26 | util.h 27 | 28 | RESOURCES += \ 29 | icon/icon.qrc 30 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/maxwall_tcp_server.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-03-01T15:54:49 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | QT += network 9 | QT += serialport 10 | 11 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 12 | 13 | TARGET = maxwall_tcp_server 14 | TEMPLATE = app 15 | 16 | 17 | SOURCES += main.cpp\ 18 | tcpserver.cpp \ 19 | server.cpp \ 20 | tcpclientsocket.cpp \ 21 | util.cpp 22 | 23 | HEADERS += tcpserver.h \ 24 | server.h \ 25 | tcpclientsocket.h \ 26 | util.h 27 | 28 | RESOURCES += \ 29 | icon/icon.qrc 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RS232 to TCP 2 | 用于将串口消息转为tcp消息,适用于串口消息的远距离传输和多台传输 3 | 4 | ## transmit system 5 | * 一个tcp的client-server系统,负责将server端收到的串口消息通过tcp包发给client端,再由client端将tcp包转为串口消息发出,client端收到返回的串口消息后打包成tcp包返回给server端,server端再将其转为串口消息返回给连接的COM口,可以有多个client,即可实现串口消息的复制和多发 6 |
7 | 8 | * 使用方法: 9 | 1. 将编译好的server程序(位于transfer_tcp_server文件夹内)和client程序(位于transfer_tcp_client文件夹内)分别安装到目标机器上 10 | 2. 配置server程序配套的config.ini,选择与server程序连接的COM口,打开server程序 11 | 3. 配置client程序配套的config.ini,输入server程序所在机器的IP地址,选择与client程序连接的COM口,打开client程序 12 | 4. 发送给server程序的串口命令需满足以下格式: 13 | | 之后要发送的数据长度(4位) | 目标机器的IP(8位16进制数) | 指令 | 14 | 例: 15 | 0020c0a8039d0008MW01ENMD 16 | 0020:之后数据长度为20位 17 | c0a8039d:目标机器IP,即192.168.3.157 18 | 0008MW01ENMD:指令 19 | 5. 注:串口发送的数据和tcp包数据均采用utf-8编码 20 | 21 | ## transmit server 22 | * 只包含tcp的server部分,负责将收到的串口消息转为tcp包,或将收到的tcp包转为串口消息发送给连接的COM口,使用需配置配套的config.ini,对发送的消息没有格式要求,只进行转发,注意需要采用utf-8编码,可以搭配自己编写的tcp client进行数据发送 23 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/tcpserver.h: -------------------------------------------------------------------------------- 1 | #ifndef TCPSERVER_H 2 | #define TCPSERVER_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "server.h" 14 | #include "util.h" 15 | 16 | class TcpServer : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | TcpServer(QWidget *parent = 0); 22 | ~TcpServer(); 23 | QSerialPort serial;//串口实例 24 | void initSeialPort();//初始化串口函数 25 | 26 | private: 27 | QSystemTrayIcon *systemTray; 28 | QAction *quitAct; 29 | QMenu *pContextMenu; 30 | int port; 31 | Server *server; 32 | QByteArray content; 33 | 34 | signals: 35 | void sendCmd(QString, int); 36 | 37 | private slots: 38 | void serialRead(); 39 | void serialWrite(QByteArray); 40 | }; 41 | 42 | #endif // TCPSERVER_H 43 | -------------------------------------------------------------------------------- /transmit_server/transmit/tcptransmit.h: -------------------------------------------------------------------------------- 1 | #ifndef TCPTRANSMIT_H 2 | #define TCPTRANSMIT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "server.h" 15 | #include "util.h" 16 | 17 | class TcpTransmit : public QDialog 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | TcpTransmit(QWidget *parent = 0); 23 | ~TcpTransmit(); 24 | QSerialPort serial;//串口实例 25 | void initSeialPort();//初始化串口函数 26 | 27 | private: 28 | QSystemTrayIcon *systemTray; 29 | QAction *quitAct; 30 | QMenu *pContextMenu; 31 | int port; 32 | Server *server; 33 | QByteArray content; 34 | 35 | signals: 36 | void sendCmd(QString, int); 37 | 38 | private slots: 39 | void serialRead(); 40 | void serialWrite(QByteArray); 41 | }; 42 | 43 | #endif // TCPTRANSMIT_H 44 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/tcpclientsocket.cpp: -------------------------------------------------------------------------------- 1 | #include "tcpclientsocket.h" 2 | 3 | TcpClientSocket::TcpClientSocket(QObject *parent) 4 | { 5 | connect(this, SIGNAL(readyRead()), this, SLOT(dataReceived())); 6 | connect(this, SIGNAL(disconnected()), this, SLOT(slotDisconnected())); 7 | } 8 | 9 | //与客户端建立的socket连接收到消息 10 | void TcpClientSocket::dataReceived() 11 | { 12 | while(bytesAvailable()>0) 13 | { 14 | QByteArray datagram; 15 | datagram.resize(bytesAvailable()); 16 | read(datagram.data(), datagram.size()); 17 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 18 | QString msg = tc->toUnicode(datagram); 19 | QTextStream out(Util::file); 20 | out << "receive tcp data from client : " << msg << "\n"; 21 | QByteArray maxwallmsg = msg.toUtf8(); 22 | emit sendserial(maxwallmsg); 23 | //qDebug() << msg; 24 | } 25 | } 26 | 27 | //与客户端建立的socket连接断开时, 通知server 28 | //删除掉socket列表中的项 29 | void TcpClientSocket::slotDisconnected() 30 | { 31 | emit disconnected(this->socketDescriptor()); 32 | } 33 | -------------------------------------------------------------------------------- /transmit_server/transmit/tcpclientsocket.cpp: -------------------------------------------------------------------------------- 1 | #include "tcpclientsocket.h" 2 | 3 | TcpClientSocket::TcpClientSocket(QObject *parent) 4 | { 5 | connect(this, SIGNAL(readyRead()), this, SLOT(dataReceived())); 6 | connect(this, SIGNAL(disconnected()), this, SLOT(slotDisconnected())); 7 | } 8 | 9 | //与客户端建立的socket连接收到消息 10 | void TcpClientSocket::dataReceived() 11 | { 12 | while(bytesAvailable()>0) 13 | { 14 | Util::des = this->socketDescriptor(); 15 | QByteArray datagram; 16 | datagram.resize(bytesAvailable()); 17 | read(datagram.data(), datagram.size()); 18 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 19 | QString msg = tc->toUnicode(datagram); 20 | QTextStream out(Util::file); 21 | out << "receive tcp data from client : " << msg << "\n"; 22 | QByteArray maxwallmsg = msg.toUtf8(); 23 | emit sendserial(maxwallmsg); 24 | //qDebug() << msg; 25 | } 26 | } 27 | 28 | //与客户端建立的socket连接断开时, 通知server 29 | //删除掉socket列表中的项 30 | void TcpClientSocket::slotDisconnected() 31 | { 32 | emit disconnected(this->socketDescriptor()); 33 | } 34 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_client/tcpclient.h: -------------------------------------------------------------------------------- 1 | #ifndef TCPCLIENT_H 2 | #define TCPCLIENT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | class TcpClient : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | TcpClient(QWidget *parent = 0); 25 | ~TcpClient(); 26 | QSerialPort serial;//串口实例 27 | void initSeialPort();//初始化串口函数 28 | void receive(QString, int); 29 | QFile *file; 30 | 31 | private: 32 | QSystemTrayIcon *systemTray; 33 | QAction *quitAct, *connAct, *disconnAct; 34 | QMenu *pContextMenu; 35 | int port; 36 | QHostAddress *serverIP; 37 | QString userName; 38 | QTcpSocket *tcpSocket; 39 | QByteArray content; 40 | bool hasconnected; 41 | QTimer *timer; 42 | 43 | public slots: 44 | void slotConnected(); 45 | void slotDisconnected(); 46 | void connClick(); 47 | void disconnClick(); 48 | void dataReceived(); 49 | void serialRead(); 50 | void timeout(); 51 | }; 52 | 53 | #endif // TCPCLIENT_H 54 | -------------------------------------------------------------------------------- /transmit_server/transmit/server.cpp: -------------------------------------------------------------------------------- 1 | #include "server.h" 2 | 3 | Server::Server(QObject *parent, int port):QTcpServer(parent) 4 | { 5 | listen(QHostAddress::Any, port); 6 | } 7 | 8 | //有新的连接建立时生成新的socket并存到列表中 9 | void Server::incomingConnection(int socketDescriptor) 10 | { 11 | TcpClientSocket *tcpClientSocket = new TcpClientSocket(this); 12 | connect(tcpClientSocket, SIGNAL(sendserial(QByteArray)), this, SLOT(slotsendserial(QByteArray))); 13 | connect(tcpClientSocket, SIGNAL(disconnected(int)), this, SLOT(slotDisconnected(int))); 14 | tcpClientSocket->setSocketDescriptor(socketDescriptor); 15 | tcpClientSocketList.append(tcpClientSocket); 16 | } 17 | 18 | //连接断开时从socket列表中删除记录的socket 19 | void Server::slotDisconnected(int descriptor) 20 | { 21 | for(int i = 0; i < tcpClientSocketList.count(); i++) 22 | { 23 | QTcpSocket *item = tcpClientSocketList.at(i); 24 | if(item->socketDescriptor() == descriptor) 25 | { 26 | tcpClientSocketList.removeAt(i); 27 | return; 28 | } 29 | } 30 | return; 31 | } 32 | 33 | //当收到中控发来的串口命令时向tcpclient转发命令 34 | void Server::sendCmd(QString cmd, int n) 35 | { 36 | for(int i = 0; i < tcpClientSocketList.count(); i++) 37 | { 38 | QTcpSocket *item = tcpClientSocketList.at(i); 39 | 40 | if(item->socketDescriptor() == Util::des){ 41 | QTextStream out(Util::file); 42 | out << "send tcp data to client : " << cmd << "\n"; 43 | char *msg; 44 | QByteArray ba = cmd.toUtf8(); 45 | msg = ba.data(); 46 | item->write(msg); 47 | } 48 | //qDebug() << item->peerAddress().toIPv4Address(); 49 | //qDebug() << ipv4 << ";" << ip; 50 | //qDebug() << cmd; 51 | } 52 | } 53 | 54 | void Server::slotsendserial(QByteArray msg) 55 | { 56 | emit sendserial(msg); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/server.cpp: -------------------------------------------------------------------------------- 1 | #include "server.h" 2 | 3 | Server::Server(QObject *parent, int port):QTcpServer(parent) 4 | { 5 | listen(QHostAddress::Any, port); 6 | } 7 | 8 | //有新的连接建立时生成新的socket并存到列表中 9 | void Server::incomingConnection(int socketDescriptor) 10 | { 11 | TcpClientSocket *tcpClientSocket = new TcpClientSocket(this); 12 | connect(tcpClientSocket, SIGNAL(sendserial(QByteArray)), this, SLOT(slotsendserial(QByteArray))); 13 | connect(tcpClientSocket, SIGNAL(disconnected(int)), this, SLOT(slotDisconnected(int))); 14 | tcpClientSocket->setSocketDescriptor(socketDescriptor); 15 | tcpClientSocketList.append(tcpClientSocket); 16 | } 17 | 18 | //连接断开时从socket列表中删除记录的socket 19 | void Server::slotDisconnected(int descriptor) 20 | { 21 | for(int i = 0; i < tcpClientSocketList.count(); i++) 22 | { 23 | QTcpSocket *item = tcpClientSocketList.at(i); 24 | if(item->socketDescriptor() == descriptor) 25 | { 26 | tcpClientSocketList.removeAt(i); 27 | return; 28 | } 29 | } 30 | return; 31 | } 32 | 33 | //当收到中控发来的串口命令时向tcpclient转发命令 34 | void Server::sendCmd(QString cmd, int n) 35 | { 36 | for(int i = 0; i < tcpClientSocketList.count(); i++) 37 | { 38 | QTcpSocket *item = tcpClientSocketList.at(i); 39 | 40 | //提取中控指令中的目标机器ip 41 | QString ipv4 = cmd.mid(4, 8); 42 | quint32 ip = quint32(ipv4.toUInt(0, 16)); 43 | if(ip == item->peerAddress().toIPv4Address()) 44 | { 45 | cmd = cmd.mid(12, n-12); 46 | item->write(cmd.toLatin1(), n-12); 47 | QTextStream out(Util::file); 48 | out << "send tcp data to client : " << cmd << "\n"; 49 | } 50 | //qDebug() << item->peerAddress().toIPv4Address(); 51 | //qDebug() << ipv4 << ";" << ip; 52 | //qDebug() << cmd; 53 | } 54 | } 55 | 56 | void Server::slotsendserial(QByteArray msg) 57 | { 58 | emit sendserial(msg); 59 | } 60 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/tcpserver.cpp: -------------------------------------------------------------------------------- 1 | #include "tcpserver.h" 2 | 3 | TcpServer::TcpServer(QWidget *parent) 4 | : QDialog(parent) 5 | { 6 | QIcon icon(":\\color.png"); 7 | systemTray = new QSystemTrayIcon(this); 8 | systemTray->setIcon(icon); 9 | systemTray->setToolTip("tcp_server"); 10 | quitAct = new QAction("Quit Application", this); 11 | connect(quitAct, SIGNAL(triggered(bool)), qApp, SLOT(quit())); 12 | pContextMenu = new QMenu(this); 13 | pContextMenu->addAction(quitAct); 14 | systemTray->setContextMenu(pContextMenu); 15 | systemTray->show(); 16 | 17 | //建立一个TcpServer监听端口6666 18 | port = 6666; 19 | server = new Server(this, port); 20 | connect(this, SIGNAL(sendCmd(QString, int)), server, SLOT(sendCmd(QString,int))); 21 | connect(server, SIGNAL(sendserial(QByteArray)), this, SLOT(serialWrite(QByteArray))); 22 | initSeialPort(); 23 | content = QByteArray(); 24 | 25 | Util::file->open(QIODevice::WriteOnly | QIODevice::Text); 26 | } 27 | 28 | TcpServer::~TcpServer() 29 | { 30 | Util::file->close(); 31 | } 32 | 33 | //初始化串口 34 | void TcpServer::initSeialPort() 35 | { 36 | connect(&serial,SIGNAL(readyRead()),this,SLOT(serialRead())); //连接槽 37 | 38 | //获取计算机上所有串口 39 | QList infos = QSerialPortInfo::availablePorts(); 40 | if(infos.isEmpty()) 41 | { 42 | QMessageBox::information(this, "warning", tr("没有可用串口")); 43 | return; 44 | } 45 | 46 | //选择tcp_server需要的COM口 47 | QSerialPortInfo usecom; 48 | QSettings settings("config.ini", QSettings::IniFormat); 49 | QString com = settings.value("DevOption/COM").toString(); 50 | if(com == "") 51 | { 52 | QMessageBox::information(this, "warnning", "No COM setting in config.ini"); 53 | return; 54 | } 55 | 56 | foreach (QSerialPortInfo info, infos) { 57 | if(info.portName() == com) 58 | { 59 | usecom = info; 60 | break; 61 | } 62 | //qDebug() << info.portName(); 63 | } 64 | 65 | serial.close(); 66 | serial.setPort(usecom); 67 | serial.open(QIODevice::ReadWrite); //读写打开 68 | serial.setBaudRate(QSerialPort::Baud9600); //波特率 69 | serial.setDataBits(QSerialPort::Data8); //数据位 70 | serial.setParity(QSerialPort::NoParity); //无奇偶校验 71 | serial.setStopBits(QSerialPort::OneStop); //无停止位 72 | serial.setFlowControl(QSerialPort::NoFlowControl); //无控制 73 | } 74 | 75 | //读取串口收到的消息,需要自己生成一个buffer存数据 76 | void TcpServer::serialRead() 77 | { 78 | QByteArray qa = serial.readAll(); 79 | content.append(qa); 80 | if(content.length() > 4) 81 | { 82 | QString datalen = content.mid(0, 4); 83 | int datal = datalen.toInt(); 84 | if((content.length() - 4) == datal) 85 | { 86 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 87 | QString str = tc->toUnicode(content); 88 | emit sendCmd(str, datal + 4); 89 | QTextStream out(Util::file); 90 | out << "receive serial data from center control : " << str << "\n"; 91 | content = QByteArray(); 92 | } 93 | else if((content.length() - 4) > datal) 94 | { 95 | content = content.mid(0, datal + 4); 96 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 97 | QString str = tc->toUnicode(content); 98 | emit sendCmd(str, datal + 4); 99 | QTextStream out(Util::file); 100 | out << "receive serial data from center control : " << str << "\n"; 101 | content = QByteArray(); 102 | } 103 | } 104 | } 105 | 106 | void TcpServer::serialWrite(QByteArray msg) 107 | { 108 | QTextStream out(Util::file); 109 | out << "write serial data to center control : " << msg << "\n"; 110 | char *sendmsg = msg.data(); 111 | serial.write(sendmsg); 112 | } 113 | -------------------------------------------------------------------------------- /transmit_server/transmit/tcptransmit.cpp: -------------------------------------------------------------------------------- 1 | #include "tcptransmit.h" 2 | 3 | TcpTransmit::TcpTransmit(QWidget *parent) 4 | : QDialog(parent) 5 | { 6 | QIcon icon(":\\color.png"); 7 | systemTray = new QSystemTrayIcon(this); 8 | systemTray->setIcon(icon); 9 | systemTray->setToolTip("tcp_server"); 10 | quitAct = new QAction("Quit Application", this); 11 | connect(quitAct, SIGNAL(triggered(bool)), qApp, SLOT(quit())); 12 | pContextMenu = new QMenu(this); 13 | pContextMenu->addAction(quitAct); 14 | systemTray->setContextMenu(pContextMenu); 15 | systemTray->show(); 16 | 17 | //建立一个TcpServer监听端口6666 18 | port = 6666; 19 | server = new Server(this, port); 20 | connect(this, SIGNAL(sendCmd(QString, int)), server, SLOT(sendCmd(QString,int))); 21 | connect(server, SIGNAL(sendserial(QByteArray)), this, SLOT(serialWrite(QByteArray))); 22 | initSeialPort(); 23 | content = QByteArray(); 24 | 25 | Util::file->open(QIODevice::WriteOnly | QIODevice::Text); 26 | } 27 | 28 | TcpTransmit::~TcpTransmit() 29 | { 30 | Util::file->close(); 31 | } 32 | 33 | //初始化串口 34 | void TcpTransmit::initSeialPort() 35 | { 36 | connect(&serial,SIGNAL(readyRead()),this,SLOT(serialRead())); //连接槽 37 | 38 | //获取计算机上所有串口 39 | QList infos = QSerialPortInfo::availablePorts(); 40 | if(infos.isEmpty()) 41 | { 42 | QMessageBox::information(this, "warning", tr("没有可用串口")); 43 | return; 44 | } 45 | 46 | //选择tcp_server需要的COM口 47 | QSerialPortInfo usecom; 48 | QSettings settings("config.ini", QSettings::IniFormat); 49 | QString com = settings.value("DevOption/COM").toString(); 50 | if(com == "") 51 | { 52 | QMessageBox::information(this, "warnning", "No COM setting in config.ini"); 53 | return; 54 | } 55 | 56 | foreach (QSerialPortInfo info, infos) { 57 | if(info.portName() == com) 58 | { 59 | usecom = info; 60 | break; 61 | } 62 | //qDebug() << info.portName(); 63 | } 64 | 65 | serial.close(); 66 | serial.setPort(usecom); 67 | serial.open(QIODevice::ReadWrite); //读写打开 68 | serial.setBaudRate(QSerialPort::Baud9600); //波特率 69 | serial.setDataBits(QSerialPort::Data8); //数据位 70 | serial.setParity(QSerialPort::NoParity); //无奇偶校验 71 | serial.setStopBits(QSerialPort::OneStop); //无停止位 72 | serial.setFlowControl(QSerialPort::NoFlowControl); //无控制 73 | } 74 | 75 | //读取串口收到的消息,需要自己生成一个buffer存数据 76 | void TcpTransmit::serialRead() 77 | { 78 | QByteArray qa = serial.readAll(); 79 | content.append(qa); 80 | if(content.length() > 4) 81 | { 82 | QString datalen = content.mid(0, 4); 83 | int datal = datalen.toInt(); 84 | if((content.length() - 4) == datal) 85 | { 86 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 87 | QString str = tc->toUnicode(content); 88 | emit sendCmd(str, datal + 4); 89 | QTextStream out(Util::file); 90 | out << "receive serial data from center control : " << str << "\n"; 91 | content = QByteArray(); 92 | } 93 | else if((content.length() - 4) > datal) 94 | { 95 | content = content.mid(0, datal + 4); 96 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 97 | QString str = tc->toUnicode(content); 98 | emit sendCmd(str, datal + 4); 99 | QTextStream out(Util::file); 100 | out << "receive serial data from center control : " << str << "\n"; 101 | content = QByteArray(); 102 | } 103 | } 104 | } 105 | 106 | void TcpTransmit::serialWrite(QByteArray msg) 107 | { 108 | QTextStream out(Util::file); 109 | out << "write serial data to center control : " << msg << "\n"; 110 | char *sendmsg = msg.data(); 111 | serial.write(sendmsg); 112 | } 113 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_client/tcpclient.cpp: -------------------------------------------------------------------------------- 1 | #include "tcpclient.h" 2 | 3 | TcpClient::TcpClient(QWidget *parent) 4 | : QDialog(parent) 5 | { 6 | QIcon icon(":\\color.png"); 7 | systemTray = new QSystemTrayIcon(this); 8 | systemTray->setIcon(icon); 9 | systemTray->setToolTip("tcp_client"); 10 | quitAct = new QAction("Quit Application", this); 11 | connAct = new QAction(tr("连接服务器"), this); 12 | disconnAct = new QAction(tr("与服务器断开连接"), this); 13 | 14 | connect(connAct, SIGNAL(triggered(bool)), this, SLOT(connClick())); 15 | connect(disconnAct, SIGNAL(triggered(bool)), this, SLOT(disconnClick())); 16 | connect(quitAct, SIGNAL(triggered(bool)), qApp, SLOT(quit())); 17 | pContextMenu = new QMenu(this); 18 | pContextMenu->addAction(quitAct); 19 | pContextMenu->addAction(connAct); 20 | pContextMenu->addAction(disconnAct); 21 | systemTray->setContextMenu(pContextMenu); 22 | systemTray->show(); 23 | hasconnected = false; 24 | timer = new QTimer(this); 25 | connect(timer, SIGNAL(timeout()), this, SLOT(timeout())); 26 | 27 | //默认连接服务器 28 | serverIP = new QHostAddress(); 29 | QSettings settings("config.ini", QSettings::IniFormat); 30 | QString ip = settings.value("DevOption/ServerIP").toString(); 31 | if(ip == "") 32 | { 33 | QMessageBox::information(this, "warnning", "No ServerIP setting in config.ini"); 34 | return; 35 | } 36 | serverIP->setAddress(ip); 37 | port = 6666; 38 | tcpSocket = new QTcpSocket(this); 39 | connect(tcpSocket, SIGNAL(connected()), this, SLOT(slotConnected())); 40 | connect(tcpSocket, SIGNAL(disconnected()), this, SLOT(slotDisconnected())); 41 | connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(dataReceived())); 42 | tcpSocket->connectToHost(*serverIP, port); 43 | initSeialPort(); 44 | content = QByteArray(); 45 | 46 | file = new QFile("log.txt"); 47 | file->open(QIODevice::WriteOnly | QIODevice::Text); 48 | 49 | timer->start(20000); 50 | } 51 | 52 | TcpClient::~TcpClient() 53 | { 54 | file->close(); 55 | } 56 | 57 | //托盘选择连接服务器 58 | void TcpClient::connClick() 59 | { 60 | tcpSocket->connectToHost(*serverIP, port); 61 | } 62 | 63 | //托盘选择与服务器断开连接 64 | void TcpClient::disconnClick() 65 | { 66 | tcpSocket->disconnectFromHost(); 67 | } 68 | 69 | //成功连接到服务器 70 | void TcpClient::slotConnected() 71 | { 72 | hasconnected = true; 73 | connAct->setEnabled(false); 74 | disconnAct->setEnabled(true); 75 | systemTray->showMessage(tr("提示"), tr("已成功连接至服务器"), QSystemTrayIcon::Information, 5000); 76 | } 77 | 78 | //成功与服务器断开 79 | void TcpClient::slotDisconnected() 80 | { 81 | hasconnected = false; 82 | connAct->setEnabled(true); 83 | disconnAct->setEnabled(false); 84 | systemTray->showMessage(tr("提示"), tr("已断开与服务器的连接"), QSystemTrayIcon::Information, 5000); 85 | } 86 | 87 | //与服务器连接的socket收到数据 88 | void TcpClient::dataReceived() 89 | { 90 | while(tcpSocket->bytesAvailable()>0) 91 | { 92 | QByteArray datagram; 93 | datagram.resize(tcpSocket->bytesAvailable()); 94 | tcpSocket->read(datagram.data(), datagram.size()); 95 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 96 | QString msg = tc->toUnicode(datagram); 97 | QTextStream out(file); 98 | out << "receive tcp data from server : " << msg << "\n"; 99 | QByteArray maxwallmsg = msg.toUtf8(); 100 | serial.write(maxwallmsg); 101 | out << "send serial data to maxwall server : " << maxwallmsg << "\n"; 102 | //qDebug() << msg; 103 | } 104 | } 105 | 106 | //串口收到maxwall返回值之后通过socket向服务器发送数据 107 | void TcpClient::receive(QString re, int n) 108 | { 109 | QTextStream out(file); 110 | out << "send tcp data to server : " << re << "\n"; 111 | char *msg; 112 | QByteArray ba = re.toUtf8(); 113 | msg = ba.data(); 114 | tcpSocket->write(ba, n); 115 | //qDebug() << re; 116 | } 117 | 118 | //初始化串口 119 | void TcpClient::initSeialPort() 120 | { 121 | connect(&serial,SIGNAL(readyRead()),this,SLOT(serialRead())); //连接槽 122 | 123 | //获取计算机上所有串口并添加到comboBox中 124 | QList infos = QSerialPortInfo::availablePorts(); 125 | if(infos.isEmpty()) 126 | { 127 | QMessageBox::information(this, "warning", tr("没有可用串口")); 128 | return; 129 | } 130 | QSerialPortInfo usecom; 131 | QSettings settings("config.ini", QSettings::IniFormat); 132 | QString com = settings.value("DevOption/COM").toString(); 133 | if(com == "") 134 | { 135 | QMessageBox::information(this, "warnning", "No COM setting in config.ini"); 136 | return; 137 | } 138 | 139 | foreach (QSerialPortInfo info, infos) { 140 | if(info.portName() == com) 141 | { 142 | usecom = info; 143 | break; 144 | } 145 | //qDebug() << info.portName(); 146 | } 147 | 148 | serial.close(); 149 | serial.setPort(usecom); 150 | serial.open(QIODevice::ReadWrite); //读写打开 151 | serial.setBaudRate(QSerialPort::Baud9600); //波特率 152 | serial.setDataBits(QSerialPort::Data8); //数据位 153 | serial.setParity(QSerialPort::NoParity); //无奇偶校验 154 | serial.setStopBits(QSerialPort::OneStop); //无停止位 155 | serial.setFlowControl(QSerialPort::NoFlowControl); //无控制 156 | } 157 | 158 | //串口收到maxwall返回值 159 | void TcpClient::serialRead() 160 | { 161 | QByteArray qa = serial.readAll(); 162 | content.append(qa); 163 | if(content.length() > 4) 164 | { 165 | QString datalen = content.mid(0, 4); 166 | int datal = datalen.toInt(); 167 | if((content.length() - 4) == datal) 168 | { 169 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 170 | QString str = tc->toUnicode(content); 171 | receive(str, datal + 4); 172 | QTextStream out(file); 173 | out << "receive serial data from maxwall server : " << str << "\n"; 174 | content = QByteArray(); 175 | } 176 | else if((content.length() - 4) > datal) 177 | { 178 | content = content.mid(0, datal + 4); 179 | QTextCodec *tc = QTextCodec::codecForName("UTF8"); 180 | QString str = tc->toUnicode(content); 181 | receive(str, datal + 4); 182 | QTextStream out(file); 183 | out << "receive serial data from maxwall server : " << str << "\n"; 184 | content = QByteArray(); 185 | } 186 | } 187 | } 188 | 189 | void TcpClient::timeout() 190 | { 191 | if(!hasconnected) 192 | tcpSocket->connectToHost(*serverIP, port); 193 | } 194 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_client/maxwall_tcp_client.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {291c223a-9cf8-489c-a0fc-789e4ae95138} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | Desktop Qt 5.5.1 MinGW 32bit 62 | Desktop Qt 5.5.1 MinGW 32bit 63 | qt.55.win32_mingw492_kit 64 | 1 65 | 0 66 | 0 67 | 68 | D:/QTProject/build-maxwall_tcp_client-Desktop_Qt_5_5_1_MinGW_32bit-Debug 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | false 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | false 89 | 90 | 91 | 92 | 2 93 | 构建 94 | 95 | ProjectExplorer.BuildSteps.Build 96 | 97 | 98 | 99 | true 100 | Make 101 | 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | 108 | 1 109 | 清理 110 | 111 | ProjectExplorer.BuildSteps.Clean 112 | 113 | 2 114 | false 115 | 116 | Debug 117 | 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | true 121 | 122 | 123 | D:/QTProject/build-maxwall_tcp_client-Desktop_Qt_5_5_1_MinGW_32bit-Release 124 | 125 | 126 | true 127 | qmake 128 | 129 | QtProjectManager.QMakeBuildStep 130 | false 131 | true 132 | 133 | false 134 | false 135 | false 136 | 137 | 138 | true 139 | Make 140 | 141 | Qt4ProjectManager.MakeStep 142 | 143 | false 144 | 145 | 146 | 147 | 2 148 | 构建 149 | 150 | ProjectExplorer.BuildSteps.Build 151 | 152 | 153 | 154 | true 155 | Make 156 | 157 | Qt4ProjectManager.MakeStep 158 | 159 | true 160 | clean 161 | 162 | 163 | 1 164 | 清理 165 | 166 | ProjectExplorer.BuildSteps.Clean 167 | 168 | 2 169 | false 170 | 171 | Release 172 | 173 | Qt4ProjectManager.Qt4BuildConfiguration 174 | 0 175 | true 176 | 177 | 2 178 | 179 | 180 | 0 181 | 部署 182 | 183 | ProjectExplorer.BuildSteps.Deploy 184 | 185 | 1 186 | 在本地部署 187 | 188 | ProjectExplorer.DefaultDeployConfiguration 189 | 190 | 1 191 | 192 | 193 | 194 | false 195 | false 196 | false 197 | false 198 | true 199 | 0.01 200 | 10 201 | true 202 | 1 203 | 25 204 | 205 | 1 206 | true 207 | false 208 | true 209 | valgrind 210 | 211 | 0 212 | 1 213 | 2 214 | 3 215 | 4 216 | 5 217 | 6 218 | 7 219 | 8 220 | 9 221 | 10 222 | 11 223 | 12 224 | 13 225 | 14 226 | 227 | 2 228 | 229 | maxwall_tcp_client 230 | 231 | Qt4ProjectManager.Qt4RunConfiguration:D:/QTProject/maxwall_tcp_client/maxwall_tcp_client.pro 232 | 233 | maxwall_tcp_client.pro 234 | false 235 | false 236 | 237 | 3768 238 | false 239 | true 240 | false 241 | false 242 | true 243 | 244 | 1 245 | 246 | 247 | 248 | ProjectExplorer.Project.TargetCount 249 | 1 250 | 251 | 252 | ProjectExplorer.Project.Updater.FileVersion 253 | 18 254 | 255 | 256 | Version 257 | 18 258 | 259 | 260 | -------------------------------------------------------------------------------- /transmit_system/transfer_tcp_server/maxwall_tcp_server.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {291c223a-9cf8-489c-a0fc-789e4ae95138} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | Desktop Qt 5.5.1 MinGW 32bit 62 | Desktop Qt 5.5.1 MinGW 32bit 63 | qt.55.win32_mingw492_kit 64 | 1 65 | 0 66 | 0 67 | 68 | D:/QTProject/build-maxwall_tcp_server-Desktop_Qt_5_5_1_MinGW_32bit-Debug 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | false 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | false 89 | 90 | 91 | 92 | 2 93 | 构建 94 | 95 | ProjectExplorer.BuildSteps.Build 96 | 97 | 98 | 99 | true 100 | Make 101 | 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | 108 | 1 109 | 清理 110 | 111 | ProjectExplorer.BuildSteps.Clean 112 | 113 | 2 114 | false 115 | 116 | Debug 117 | 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | true 121 | 122 | 123 | D:/QTProject/build-maxwall_tcp_server-Desktop_Qt_5_5_1_MinGW_32bit-Release 124 | 125 | 126 | true 127 | qmake 128 | 129 | QtProjectManager.QMakeBuildStep 130 | false 131 | true 132 | 133 | false 134 | false 135 | false 136 | 137 | 138 | true 139 | Make 140 | 141 | Qt4ProjectManager.MakeStep 142 | 143 | false 144 | 145 | 146 | 147 | 2 148 | 构建 149 | 150 | ProjectExplorer.BuildSteps.Build 151 | 152 | 153 | 154 | true 155 | Make 156 | 157 | Qt4ProjectManager.MakeStep 158 | 159 | true 160 | clean 161 | 162 | 163 | 1 164 | 清理 165 | 166 | ProjectExplorer.BuildSteps.Clean 167 | 168 | 2 169 | false 170 | 171 | Release 172 | 173 | Qt4ProjectManager.Qt4BuildConfiguration 174 | 0 175 | true 176 | 177 | 2 178 | 179 | 180 | 0 181 | 部署 182 | 183 | ProjectExplorer.BuildSteps.Deploy 184 | 185 | 1 186 | 在本地部署 187 | 188 | ProjectExplorer.DefaultDeployConfiguration 189 | 190 | 1 191 | 192 | 193 | 194 | false 195 | false 196 | false 197 | false 198 | true 199 | 0.01 200 | 10 201 | true 202 | 1 203 | 25 204 | 205 | 1 206 | true 207 | false 208 | true 209 | valgrind 210 | 211 | 0 212 | 1 213 | 2 214 | 3 215 | 4 216 | 5 217 | 6 218 | 7 219 | 8 220 | 9 221 | 10 222 | 11 223 | 12 224 | 13 225 | 14 226 | 227 | 2 228 | 229 | maxwall_tcp_server 230 | 231 | Qt4ProjectManager.Qt4RunConfiguration:D:/QTProject/maxwall_tcp_server/maxwall_tcp_server.pro 232 | 233 | maxwall_tcp_server.pro 234 | false 235 | false 236 | 237 | 3768 238 | false 239 | true 240 | false 241 | false 242 | true 243 | 244 | 1 245 | 246 | 247 | 248 | ProjectExplorer.Project.TargetCount 249 | 1 250 | 251 | 252 | ProjectExplorer.Project.Updater.FileVersion 253 | 18 254 | 255 | 256 | Version 257 | 18 258 | 259 | 260 | -------------------------------------------------------------------------------- /transmit_server/transmit/maxwall_tcp_transmit.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {291c223a-9cf8-489c-a0fc-789e4ae95138} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | Desktop Qt 5.5.1 MinGW 32bit 62 | Desktop Qt 5.5.1 MinGW 32bit 63 | qt.55.win32_mingw492_kit 64 | 1 65 | 0 66 | 0 67 | 68 | D:/QTProject/build-maxwall_tcp_transmit-Desktop_Qt_5_5_1_MinGW_32bit-Debug 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | false 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | false 89 | 90 | 91 | 92 | 2 93 | 构建 94 | 95 | ProjectExplorer.BuildSteps.Build 96 | 97 | 98 | 99 | true 100 | Make 101 | 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | 108 | 1 109 | 清理 110 | 111 | ProjectExplorer.BuildSteps.Clean 112 | 113 | 2 114 | false 115 | 116 | Debug 117 | 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | true 121 | 122 | 123 | D:/QTProject/build-maxwall_tcp_transmit-Desktop_Qt_5_5_1_MinGW_32bit-Release 124 | 125 | 126 | true 127 | qmake 128 | 129 | QtProjectManager.QMakeBuildStep 130 | false 131 | true 132 | 133 | false 134 | false 135 | false 136 | 137 | 138 | true 139 | Make 140 | 141 | Qt4ProjectManager.MakeStep 142 | 143 | false 144 | 145 | 146 | 147 | 2 148 | 构建 149 | 150 | ProjectExplorer.BuildSteps.Build 151 | 152 | 153 | 154 | true 155 | Make 156 | 157 | Qt4ProjectManager.MakeStep 158 | 159 | true 160 | clean 161 | 162 | 163 | 1 164 | 清理 165 | 166 | ProjectExplorer.BuildSteps.Clean 167 | 168 | 2 169 | false 170 | 171 | Release 172 | 173 | Qt4ProjectManager.Qt4BuildConfiguration 174 | 0 175 | true 176 | 177 | 2 178 | 179 | 180 | 0 181 | 部署 182 | 183 | ProjectExplorer.BuildSteps.Deploy 184 | 185 | 1 186 | 在本地部署 187 | 188 | ProjectExplorer.DefaultDeployConfiguration 189 | 190 | 1 191 | 192 | 193 | 194 | false 195 | false 196 | false 197 | false 198 | true 199 | 0.01 200 | 10 201 | true 202 | 1 203 | 25 204 | 205 | 1 206 | true 207 | false 208 | true 209 | valgrind 210 | 211 | 0 212 | 1 213 | 2 214 | 3 215 | 4 216 | 5 217 | 6 218 | 7 219 | 8 220 | 9 221 | 10 222 | 11 223 | 12 224 | 13 225 | 14 226 | 227 | 2 228 | 229 | maxwall_tcp_transmit 230 | 231 | Qt4ProjectManager.Qt4RunConfiguration:D:/QTProject/maxwall_tcp_transmit/maxwall_tcp_transmit.pro 232 | 233 | maxwall_tcp_transmit.pro 234 | false 235 | false 236 | 237 | 3768 238 | false 239 | true 240 | false 241 | false 242 | true 243 | 244 | 1 245 | 246 | 247 | 248 | ProjectExplorer.Project.TargetCount 249 | 1 250 | 251 | 252 | ProjectExplorer.Project.Updater.FileVersion 253 | 18 254 | 255 | 256 | Version 257 | 18 258 | 259 | 260 | --------------------------------------------------------------------------------