Rev 227 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 227 | Rev 272 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | * along with this program; if not, write to the * |
15 | * along with this program; if not, write to the * |
16 | * Free Software Foundation, Inc., * |
16 | * Free Software Foundation, Inc., * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
18 | ***************************************************************************/ |
18 | ***************************************************************************/ |
19 | #include "cQMK_Server.h" |
19 | #include "cQMK_Server.h" |
- | 20 | #include "ToolBox.h" |
|
Line 20... | Line 21... | ||
20 | 21 | ||
21 | cQMK_Server::cQMK_Server() |
22 | cQMK_Server::cQMK_Server() |
22 | { |
23 | { |
Line 62... | Line 63... | ||
62 | { |
63 | { |
63 | SendData(100, QString(Pos.Longitude + ":" + Pos.Latitude + ":" + Pos.Altitude)); |
64 | SendData(100, QString(Pos.Longitude + ":" + Pos.Latitude + ":" + Pos.Altitude)); |
64 | } |
65 | } |
65 | } |
66 | } |
Line 66... | Line 67... | ||
66 | 67 | ||
67 | void cQMK_Server::slot_Connected() |
68 | void cQMK_Server::send_RawData(QString Data) |
68 | { |
69 | { |
- | 70 | Data = Data + "\n"; |
|
- | 71 | ||
Line -... | Line 72... | ||
- | 72 | QByteArray SendText = Data.toAscii(); |
|
- | 73 | ||
- | 74 | TcpSocket->write(SendText); |
|
- | 75 | } |
|
- | 76 | ||
69 | // qDebug("Verbunden"); |
77 | void cQMK_Server::slot_Connected() |
70 | 78 | { |
|
71 | connect(TcpSocket, SIGNAL(readyRead()), SLOT(slot_ReadLine())); |
79 | connect(TcpSocket, SIGNAL(readyRead()), SLOT(slot_ReadLine())); |
Line 72... | Line 80... | ||
72 | connect(TcpSocket, SIGNAL(disconnected()),TcpSocket, SLOT(deleteLater())); |
80 | connect(TcpSocket, SIGNAL(disconnected()),TcpSocket, SLOT(deleteLater())); |
73 | connect(TcpSocket, SIGNAL(disconnected()),this, SLOT(slot_Disconnect())); |
81 | connect(TcpSocket, SIGNAL(disconnected()),this, SLOT(slot_Disconnect())); |
Line 74... | Line 82... | ||
74 | 82 | ||
75 | emit sig_Connected(); |
83 | emit sig_Connected(); |
76 | } |
- | |
77 | 84 | } |
|
78 | void cQMK_Server::slot_Disconnect() |
85 | |
79 | { |
86 | void cQMK_Server::slot_Disconnect() |
Line 80... | Line 87... | ||
80 | // qDebug("Verbindung getrennt "); |
87 | { |
Line 97... | Line 104... | ||
97 | break; |
104 | break; |
98 | } |
105 | } |
Line 99... | Line 106... | ||
99 | 106 | ||
100 | disconnect(TcpSocket, SIGNAL(disconnected()), 0, 0); |
107 | disconnect(TcpSocket, SIGNAL(disconnected()), 0, 0); |
101 | emit sig_Disconnected(2); |
- | |
102 | // qDebug("Error..!!"); |
108 | emit sig_Disconnected(2); |
Line 103... | Line 109... | ||
103 | } |
109 | } |
104 | 110 | ||
105 | void cQMK_Server::slot_ReadLine() |
111 | void cQMK_Server::slot_ReadLine() |