Changeset 6787 in ntrip
- Timestamp:
- Apr 20, 2015, 4:13:12 PM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncnetquery.h
r5070 r6787 21 21 virtual void waitForRequestResult(const QUrl& url, QByteArray& outData) = 0; 22 22 virtual void startRequest(const QUrl& url, const QByteArray& gga) = 0; 23 virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga) = 0; 23 24 virtual void waitForReadyRead(QByteArray& outData) = 0; 24 25 25 26 void sendNMEA(const QByteArray& gga) { 26 stop(); 27 startRequest(_url, gga); 27 keepAliveRequest(_url, gga); 28 28 } 29 29 -
trunk/BNC/src/bncnetqueryrtp.cpp
r6573 r6787 237 237 } 238 238 239 void bncNetQueryRtp::keepAliveRequest(const QUrl& /* url */, const QByteArray& /* gga */) { 240 } -
trunk/BNC/src/bncnetqueryrtp.h
r4278 r6787 13 13 virtual void waitForRequestResult(const QUrl& url, QByteArray& outData); 14 14 virtual void startRequest(const QUrl& url, const QByteArray& gga); 15 virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga); 15 16 virtual void waitForReadyRead(QByteArray& outData); 16 17 -
trunk/BNC/src/bncnetquerys.cpp
r4278 r6787 196 196 } 197 197 198 void bncNetQueryS::keepAliveRequest(const QUrl& /* url */, const QByteArray& /* gga */) { 199 } -
trunk/BNC/src/bncnetquerys.h
r4278 r6787 13 13 virtual void waitForRequestResult(const QUrl& url, QByteArray& outData); 14 14 virtual void startRequest(const QUrl& url, const QByteArray& gga); 15 virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga); 15 16 virtual void waitForReadyRead(QByteArray& outData); 16 17 -
trunk/BNC/src/bncnetqueryudp.cpp
r6574 r6787 177 177 } 178 178 179 void bncNetQueryUdp::keepAliveRequest(const QUrl& /* url */ , const QByteArray& /* gga */) { 180 } -
trunk/BNC/src/bncnetqueryudp.h
r4278 r6787 13 13 virtual void waitForRequestResult(const QUrl& url, QByteArray& outData); 14 14 virtual void startRequest(const QUrl& url, const QByteArray& gga); 15 virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga); 15 16 virtual void waitForReadyRead(QByteArray& outData); 16 17 -
trunk/BNC/src/bncnetqueryudp0.cpp
r4278 r6787 75 75 } 76 76 77 void bncNetQueryUdp0::keepAliveRequest(const QUrl& /* url */, const QByteArray& /* gga */) { 78 } -
trunk/BNC/src/bncnetqueryudp0.h
r4278 r6787 13 13 virtual void waitForRequestResult(const QUrl& url, QByteArray& outData); 14 14 virtual void startRequest(const QUrl& url, const QByteArray& gga); 15 virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga); 15 16 virtual void waitForReadyRead(QByteArray& outData); 16 17 private: -
trunk/BNC/src/bncnetqueryv0.cpp
r4278 r6787 128 128 } 129 129 130 void bncNetQueryV0::keepAliveRequest(const QUrl& /* url */, const QByteArray& /* gga */) { 131 } -
trunk/BNC/src/bncnetqueryv0.h
r4278 r6787 12 12 virtual void waitForRequestResult(const QUrl& url, QByteArray& outData); 13 13 virtual void startRequest(const QUrl& url, const QByteArray& gga); 14 virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga); 14 15 virtual void waitForReadyRead(QByteArray& outData); 15 16 -
trunk/BNC/src/bncnetqueryv1.cpp
r6571 r6787 105 105 } 106 106 107 108 // Already connected to Caster, send another Request 109 //////////////////////////////////////////////////////////////////////////// 110 void bncNetQueryV1::keepAliveRequest(const QUrl& url, const QByteArray& gga) { 111 112 _status = running; 113 114 // Default scheme and path 115 // ----------------------- 116 _url = url; 117 if (_url.scheme().isEmpty()) { 118 _url.setScheme("http"); 119 } 120 if (_url.path().isEmpty()) { 121 _url.setPath("/"); 122 } 123 124 // Connect the Socket 125 // ------------------ 126 bncSettings settings; 127 QString proxyHost = settings.value("proxyHost").toString(); 128 int proxyPort = settings.value("proxyPort").toInt(); 129 130 if ( proxyHost.isEmpty() ) { 131 _socket->connectToHost(_url.host(), _url.port()); 132 } 133 else { 134 _socket->connectToHost(proxyHost, proxyPort); 135 } 136 if (!_socket->waitForConnected(_timeOut)) { 137 delete _socket; 138 _socket = 0; 139 _status = error; 140 return; 141 } 142 143 // Send Request 144 // ------------ 145 QByteArray reqStr; 146 147 // NMEA string to handle VRS stream 148 // -------------------------------- 149 if (!gga.isEmpty()) { 150 reqStr += gga + "\r\n"; 151 } 152 153 _socket->write(reqStr, reqStr.length()); 154 155 if (!_socket->waitForBytesWritten(_timeOut)) { 156 delete _socket; 157 _socket = 0; 158 _status = error; 159 emit newMessage(_url.path().toAscii().replace(0,1,"") 160 + ": Write timeout", true); 161 return; 162 } 163 164 } 165 107 166 // Connect to Caster, send the Request 108 167 //////////////////////////////////////////////////////////////////////////// -
trunk/BNC/src/bncnetqueryv1.h
r4278 r6787 12 12 virtual void waitForRequestResult(const QUrl& url, QByteArray& outData); 13 13 virtual void startRequest(const QUrl& url, const QByteArray& gga); 14 virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga); 14 15 virtual void waitForReadyRead(QByteArray& outData); 15 16 -
trunk/BNC/src/bncnetqueryv2.cpp
r6572 r6787 91 91 //////////////////////////////////////////////////////////////////////////// 92 92 void bncNetQueryV2::startRequest(const QUrl& url, const QByteArray& gga) { 93 startRequestPrivate(url, gga, false); 94 } 95 96 // Start request, block till the next read 97 //////////////////////////////////////////////////////////////////////////// 98 void bncNetQueryV2::keepAliveRequest(const QUrl& url, const QByteArray& gga) { 93 99 startRequestPrivate(url, gga, false); 94 100 } -
trunk/BNC/src/bncnetqueryv2.h
r4278 r6787 14 14 virtual void waitForRequestResult(const QUrl& url, QByteArray& outData); 15 15 virtual void startRequest(const QUrl& url, const QByteArray& gga); 16 virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga); 16 17 virtual void waitForReadyRead(QByteArray& outData); 17 18
Note:
See TracChangeset
for help on using the changeset viewer.