Changeset 8197 in ntrip for trunk/BNC/src/RTCM3


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

receiver type extraction from 1033 RTCM3 messages is added

Location:
trunk/BNC/src/RTCM3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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 */
Note: See TracChangeset for help on using the changeset viewer.