Changeset 6770 in ntrip
- Timestamp:
- Apr 8, 2015, 2:40:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncgetthread.cpp
r6753 r6770 268 268 QByteArray _serialHeightNMEA = hlp.toAscii(); 269 269 _manualNMEAString = ggaString(_latitude, _longitude, _serialHeightNMEA); 270 271 270 } 272 271 } … … 618 617 _query = new bncNetQueryV1(); 619 618 } 620 if (_nmea == "yes" && _serialNMEA == MANUAL_NMEA) { 621 _query->startRequest(_mountPoint, _manualNMEAString); 622 _lastManualNMEA = QDateTime::currentDateTime(); 619 if (_nmea == "yes") { 620 if (_serialNMEA == MANUAL_NMEA) { 621 _query->startRequest(_mountPoint, _manualNMEAString); 622 _lastManualNMEA = QDateTime::currentDateTime(); 623 } 624 else if (_serialNMEA == AUTO_NMEA) { 625 if (_serialPort) { 626 int nb = _serialPort->bytesAvailable(); 627 if (nb > 0) { 628 QByteArray data = _serialPort->read(nb); 629 int i1 = data.indexOf("$GPGGA"); 630 if (i1 == -1) { 631 i1 = data.indexOf("$GNGGA"); 632 } 633 if (i1 != -1) { 634 int i2 = data.indexOf("*", i1); 635 if (i2 != -1 && data.size() > i2 + 1) { 636 QByteArray gga = data.mid(i1, i2 - i1 + 3); 637 _query->startRequest(_mountPoint, gga); 638 } 639 } 640 } 641 } 642 } 623 643 } 624 644 else { 625 645 _query->startRequest(_mountPoint, ""); 626 646 } 647 627 648 if (_query->status() != bncNetQuery::running) { 628 649 return failure; … … 804 825 //////////////////////////////////////////////////////////////////////////// 805 826 void bncGetThread::slotSerialReadyRead() { 827 806 828 if (_serialPort) { 829 807 830 int nb = _serialPort->bytesAvailable(); 831 808 832 if (nb > 0) { 809 833 QByteArray data = _serialPort->read(nb);
Note:
See TracChangeset
for help on using the changeset viewer.