Changeset 1716 in ntrip
- Timestamp:
- Mar 4, 2009, 6:13:06 PM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncnetquery.h
r1712 r1716 22 22 virtual void startRequest(const QUrl& url, const QByteArray& gga) = 0; 23 23 virtual void waitForReadyRead(QByteArray& outData) = 0; 24 virtual void sendNMEA(const QByteArray& gga) = 0; 24 25 void sendNMEA(const QByteArray& gga) { 26 stop(); 27 startRequest(_url, gga); 28 } 25 29 26 30 queryStatus status() const {return _status;} -
trunk/BNC/bncnetqueryrtp.cpp
r1715 r1716 238 238 } 239 239 240 // Send NMEA String241 ////////////////////////////////////////////////////////////////////////////242 void bncNetQueryRtp::sendNMEA(const QByteArray& gga) {243 startRequest(_url, gga);244 } -
trunk/BNC/bncnetqueryrtp.h
r1712 r1716 14 14 virtual void startRequest(const QUrl& url, const QByteArray& gga); 15 15 virtual void waitForReadyRead(QByteArray& outData); 16 virtual void sendNMEA(const QByteArray& gga);17 16 18 17 private slots: -
trunk/BNC/bncnetqueryv0.cpp
r1714 r1716 130 130 } 131 131 132 // Send NMEA String133 ////////////////////////////////////////////////////////////////////////////134 void bncNetQueryV0::sendNMEA(const QByteArray& /* gga */) {135 emit newMessage(_url.path().toAscii().replace(0,1,"")136 + ": sending NMEA not impelmented for NTRIP v0", true);137 } -
trunk/BNC/bncnetqueryv0.h
r1712 r1716 13 13 virtual void startRequest(const QUrl& url, const QByteArray& gga); 14 14 virtual void waitForReadyRead(QByteArray& outData); 15 virtual void sendNMEA(const QByteArray& gga);16 15 17 16 private: -
trunk/BNC/bncnetqueryv1.cpp
r1715 r1716 219 219 } 220 220 221 // Send NMEA String222 ////////////////////////////////////////////////////////////////////////////223 void bncNetQueryV1::sendNMEA(const QByteArray& gga) {224 startRequest(_url, gga);225 } -
trunk/BNC/bncnetqueryv1.h
r1712 r1716 13 13 virtual void startRequest(const QUrl& url, const QByteArray& gga); 14 14 virtual void waitForReadyRead(QByteArray& outData); 15 virtual void sendNMEA(const QByteArray& gga);16 15 17 16 private: -
trunk/BNC/bncnetqueryv2.cpp
r1713 r1716 113 113 // Network Request 114 114 // --------------- 115 _request.setUrl(_url); 116 _request.setRawHeader("Host" , _url.host().toAscii()); 117 _request.setRawHeader("Ntrip-Version", "Ntrip/2.0"); 118 _request.setRawHeader("User-Agent" , "NTRIP BNC/1.7"); 115 QNetworkRequest request; 116 request.setUrl(_url); 117 request.setRawHeader("Host" , _url.host().toAscii()); 118 request.setRawHeader("Ntrip-Version", "Ntrip/2.0"); 119 request.setRawHeader("User-Agent" , "NTRIP BNC/1.7"); 119 120 if (!_url.userName().isEmpty()) { 120 121 QString uName = QUrl::fromPercentEncoding(_url.userName().toAscii()); 121 122 QString passW = QUrl::fromPercentEncoding(_url.password().toAscii()); 122 _request.setRawHeader("Authorization", "Basic " +123 request.setRawHeader("Authorization", "Basic " + 123 124 (uName + ":" + passW).toAscii().toBase64()); 124 125 } 125 126 if (!gga.isEmpty()) { 126 _request.setRawHeader("Ntrip-GGA", gga);127 request.setRawHeader("Ntrip-GGA", gga); 127 128 } 128 _request.setRawHeader("Connection" , "close");129 request.setRawHeader("Connection" , "close"); 129 130 130 this->startGet(full); 131 } 132 133 // Start Get HTTP Method 134 //////////////////////////////////////////////////////////////////////////// 135 void bncNetQueryV2::startGet(bool full) { 136 137 if (_reply) { 138 _reply->abort(); 139 delete _reply; 140 } 141 142 _reply = _manager->get(_request); 131 delete _reply; 132 _reply = _manager->get(request); 143 133 144 134 // Connect Signals … … 191 181 } 192 182 193 // Send NMEA String194 ////////////////////////////////////////////////////////////////////////////195 void bncNetQueryV2::sendNMEA(const QByteArray& gga) {196 if (!gga.isEmpty()) {197 _request.setRawHeader("Ntrip-GGA", gga);198 }199 this->startGet(false);200 } -
trunk/BNC/bncnetqueryv2.h
r1713 r1716 15 15 virtual void startRequest(const QUrl& url, const QByteArray& gga); 16 16 virtual void waitForReadyRead(QByteArray& outData); 17 virtual void sendNMEA(const QByteArray& gga);18 17 19 18 private slots: … … 23 22 private: 24 23 void startRequestPrivate(const QUrl& url, const QByteArray& gga, bool full); 25 void startGet(bool full);26 24 27 25 QNetworkAccessManager* _manager; 28 26 QNetworkReply* _reply; 29 QNetworkRequest _request;30 27 QEventLoop* _eventLoop; 31 28 bool _firstData;
Note:
See TracChangeset
for help on using the changeset viewer.