Changeset 8197 in ntrip


Ignore:
Timestamp:
Dec 11, 2017, 9:57:14 AM (7 years ago)
Author:
stuerze
Message:

receiver type extraction from 1033 RTCM3 messages is added

Location:
trunk/BNC/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/GPSDecoder.h

    r6864 r8197  
    4343  virtual ~GPSDecoder();
    4444
    45   virtual t_irc Decode(char* buffer, int bufLen, 
     45  virtual t_irc Decode(char* buffer, int bufLen,
    4646                       std::vector<std::string>& errmsg) = 0;
    4747
     
    5050
    5151  void initRinex(const QByteArray& staID, const QUrl& mountPoint,
    52                  const QByteArray& latitude, const QByteArray& longitude, 
     52                 const QByteArray& latitude, const QByteArray& longitude,
    5353                 const QByteArray& nmea, const QByteArray& ntripVersion);
    5454
     
    8080  QList<int>       _typeList;  // RTCM message types
    8181  QStringList      _antType;   // RTCM antenna descriptor
     82  QStringList      _recType;   // RTCM receiver descriptor
    8283  QList<t_antInfo> _antList;   // RTCM antenna XYZ
    8384  QString          _gloFrq;    // GLONASS slot
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r8186 r8197  
    13791379}
    13801380
    1381 //
    1382 ////////////////////////////////////////////////////////////////////////////
    1383 bool RTCM3Decoder::DecodeAntenna(unsigned char* data, int size) {
     1381/*
     1382////////////////////////////////////////////////////////////////////////////
     1383bool RTCM3Decoder::DecodeAntennaReceiver(unsigned char* data, int size) {
    13841384  char *antenna, type[256];
    13851385  int antnum = -1;
    13861386  uint64_t numbits = 0, bitfield = 0;
    13871387
    1388   data += 4; /* header */
    1389   size -= 6; /* header + crc */
     1388  data += 4;
     1389  size -= 6;
    13901390
    13911391  SKIPBITS(12)
     
    13961396    if (!_antType.contains(type)) {
    13971397      _antType.push_back(type);
     1398    }
     1399  }
     1400  return true;
     1401}*/
     1402
     1403//
     1404////////////////////////////////////////////////////////////////////////////
     1405bool RTCM3Decoder::DecodeAntennaReceiver(unsigned char* data, int size) {
     1406  char *antenna, anttype[256];
     1407  char *dummy;
     1408  char *receiver, rectype[256];
     1409
     1410  int type;
     1411
     1412  int dnum = -1;
     1413  int antnum = -1;
     1414  int recnum = -1;
     1415  uint64_t numbits = 0, bitfield = 0;
     1416
     1417  data += 3; /* header*/
     1418  size -= 6; /* header + crc */
     1419
     1420  GETBITS(type, 12)  qDebug() << "Type: " << type;
     1421  SKIPBITS(12)
     1422  GETSTRING(antnum, antenna)
     1423  if (antnum > -1 && antnum < 265) {
     1424    memcpy(anttype, antenna, antnum);
     1425    anttype[antnum] = 0;
     1426    if (!_antType.contains(anttype)) {
     1427      _antType.push_back(anttype);
     1428    }
     1429  }
     1430  if (type == 1033) {
     1431    SKIPBITS(8)
     1432    GETSTRING(dnum, dummy)
     1433    GETSTRING(recnum, receiver)
     1434    if (recnum > -1 && recnum < 265) {
     1435      memcpy(rectype, receiver, recnum);
     1436      rectype[recnum] = 0;
     1437      if (!_recType.contains(rectype)) {
     1438        _recType.push_back(rectype);
     1439      }
    13981440    }
    13991441  }
     
    15261568          case 1008:
    15271569          case 1033:
    1528             DecodeAntenna(_Message, _BlockSize);
     1570            DecodeAntennaReceiver(_Message, _BlockSize);
    15291571            break;
    15301572          case 1005:
  • trunk/BNC/src/RTCM3/RTCM3Decoder.h

    r6812 r8197  
    6464   * {@link _MessageSize}: contains to current amount of bytes in the buffer<br>
    6565   * {@link _SkipBytes}: amount of bytes to skip at the beginning of the buffer
    66    * 
     66   *
    6767   * The functions sets following variables:<br>
    6868   * {@link _NeedBytes}: Minimum number of bytes needed on next call<br>
     
    146146  bool DecodeBDSEphemeris(unsigned char* buffer, int bufLen);
    147147  /**
    148    * Extract antenna type from 1007, 1008 or 1033 RTCM3 messages.
    149    * @param buffer the buffer containing an antenna RTCM block
     148   * Extract antenna type from 1007, 1008 or 1033 RTCM3 messages
     149   * and extract receiver type from 1033 RTCM3 messages
     150   * @param buffer the buffer containing an antenna (and receiver) RTCM block
    150151   * @param bufLen the length of the buffer (the message length including header+crc)
    151152   * @return <code>true</code> when data block was decodable
    152153   */
    153   bool DecodeAntenna(unsigned char* buffer, int bufLen);
     154  bool DecodeAntennaReceiver(unsigned char* buffer, int bufLen);
    154155  /**
    155156   * Extract antenna type from 1005 or 1006 RTCM3 messages.
     
    166167
    167168  /** List of decoders for Clock and Orbit data */
    168   QMap<QByteArray, RTCM3coDecoder*> _coDecoders; 
     169  QMap<QByteArray, RTCM3coDecoder*> _coDecoders;
    169170
    170171  /** Message buffer for input parsing */
  • trunk/BNC/src/bncgetthread.cpp

    r8127 r8197  
    893893      }
    894894
     895      // RTCMv3 receiver descriptor
     896      // --------------------------
     897      for (int ii = 0; ii < decoder()->_recType.size(); ii++) {
     898        QString rec1 = QString("%1 ").arg(decoder()->_recType[ii]);
     899        emit(newMessage(_staID + ": Receiver descriptor " + rec1.toLatin1(), true));
     900      }
     901
    895902      // RTCM GLONASS slots
    896903      // ------------------
     
    939946  decoder()->_typeList.clear();
    940947  decoder()->_antType.clear();
     948  decoder()->_recType.clear();
    941949  decoder()->_antList.clear();
    942950}
Note: See TracChangeset for help on using the changeset viewer.