Changeset 2130 in ntrip for trunk/BNC


Ignore:
Timestamp:
Dec 28, 2009, 11:47:08 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncmodel.cpp

    r2126 r2130  
    179179    _nmeaStream = new QTextStream();
    180180    _nmeaStream->setDevice(_nmeaFile);
     181    QDateTime dateTime = QDateTime::currentDateTime().toUTC();
     182    QString nmStr = "GPRMC," + dateTime.time().toString("hhmmss")
     183                  + "A,0000.0000000,N,00000.0000000,E,0.00,0.00,"
     184                  + dateTime.date().toString("ddMMyy")
     185                  + ",0.0,E";
     186                   
     187    writeNMEAstr(nmStr);
    181188  }
    182189}
     
    612619  return 0;
    613620}
     621
     622//
     623////////////////////////////////////////////////////////////////////////////
     624void bncModel::writeNMEAstr(const QString& nmStr) {
     625
     626  if (!_nmeaStream) {
     627    return;
     628  }
     629
     630  unsigned char XOR = 0;
     631  for (int ii = 0; ii < nmStr.length(); ii++) {
     632    XOR ^= (unsigned char) nmStr[ii].toAscii();
     633  }
     634 
     635  *_nmeaStream << '$' << nmStr << '*' << hex << (int) XOR << endl;
     636
     637  _nmeaStream->flush();
     638}
  • trunk/BNC/bncmodel.h

    r2125 r2130  
    7373                          const ColumnVector& vv,
    7474                          QMap<QString, t_satData*>& satData);
     75  void writeNMEAstr(const QString& nmStr);
    7576
    7677  QByteArray         _staID;
Note: See TracChangeset for help on using the changeset viewer.