Changeset 8234 in ntrip


Ignore:
Timestamp:
Jan 5, 2018, 10:52:16 AM (6 years ago)
Author:
stuerze
Message:

antenna and receiver info from message type 1007, 1008 and 1033 completed

Location:
trunk/BNC/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM/RTCM2Decoder.cpp

    r8204 r8234  
    202202    if (_PP.ID() == 3) {
    203203      if (_msg03.validMsg) {
    204         _antList.push_back(t_antInfo());
    205 
    206         this->getStaCrd(_antList.back().xx, _antList.back().yy,
    207             _antList.back().zz);
    208 
    209         _antList.back().type = t_antInfo::APC;
     204        _antList.push_back(t_antRefPoint());
     205
     206        this->getStaCrd(_antList.back().xx, _antList.back().yy, _antList.back().zz);
     207
     208        _antList.back().type = t_antRefPoint::APC;
    210209        _antList.back().message = _PP.ID();
    211210      }
    212211    } else if (_PP.ID() == 23) {
    213       if (_msg23.validMsg && !_antType.contains(_msg23.antType.c_str())) {
    214         _antType.push_back(_msg23.antType.c_str());
     212      if (_msg23.validMsg) {
     213        int antlen = strlen(_msg23.antType.c_str());
     214        int serlen = strlen(_msg23.antSN.c_str());
     215        if ((antlen) &&
     216            (_antType.empty() || strncmp(_antType.back().descriptor, _msg23.antType.c_str(), antlen) != 0)) {
     217          _antType.push_back(t_antInfo());
     218          memcpy(_antType.back().descriptor, _msg23.antType.c_str(), antlen);
     219          _antType.back().descriptor[antlen] = 0;
     220          if (serlen) {
     221            memcpy(_antType.back().serialnumber,  _msg23.antSN.c_str(), serlen);
     222            _antType.back().serialnumber[serlen] = 0;
     223          }
     224        }
    215225      }
    216226    } else if (_PP.ID() == 24) {
    217227      if (_msg24.validMsg) {
    218         _antList.push_back(t_antInfo());
     228        _antList.push_back(t_antRefPoint());
    219229
    220230        _antList.back().xx = _msg24.x;
     
    225235        _antList.back().height = _msg24.h;
    226236
    227         _antList.back().type = t_antInfo::ARP;
     237        _antList.back().type = t_antRefPoint::ARP;
    228238        _antList.back().message = _PP.ID();
    229239      }
  • trunk/BNC/src/RTCM/RTCM2Decoder.h

    r6443 r8234  
    2929#include <vector>
    3030#include <list>
     31#include <stdio.h>
    3132
    3233#include "GPSDecoder.h"
     
    7172    rtcm2::RTCM2_24    _msg24;
    7273    rtcm2::RTCM2_2021  _msg2021;
    73     bncEphUser         _ephUser;       
     74    bncEphUser         _ephUser;
    7475};
    7576
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r8204 r8234  
    13821382////////////////////////////////////////////////////////////////////////////
    13831383bool RTCM3Decoder::DecodeAntennaReceiver(unsigned char* data, int size) {
    1384   char *antenna, anttype[256];
    1385   char *dummy;
    1386   char *receiver, rectype[256];
    1387 
     1384  char *antenna;
     1385  char *antserialnum;
     1386  char *receiver;
     1387  char *recfirmware;
     1388  char *recserialnum;
    13881389  int type;
    1389 
    1390   int dnum = -1;
     1390  int antsernum = -1;
    13911391  int antnum = -1;
    13921392  int recnum = -1;
     1393  int recsernum = -1;
     1394  int recfirnum = -1;
    13931395  uint64_t numbits = 0, bitfield = 0;
    13941396
     
    13971399
    13981400  GETBITS(type, 12)
    1399   SKIPBITS(12)
     1401  SKIPBITS(12) /* reference station ID */
    14001402  GETSTRING(antnum, antenna)
    1401   if (antnum > -1 && antnum < 265) {
    1402     memcpy(anttype, antenna, antnum);
    1403     anttype[antnum] = 0;
    1404     if (!_antType.contains(anttype)) {
    1405       _antType.push_back(anttype);
     1403  if ((antnum > -1 && antnum < 265) &&
     1404      (_antType.empty() || strncmp(_antType.back().descriptor, antenna, recnum) != 0)) {
     1405    _antType.push_back(t_antInfo());
     1406    memcpy(_antType.back().descriptor, antenna, antnum);
     1407    _antType.back().descriptor[antnum] = 0;
     1408  }
     1409  SKIPBITS(8) /* antenna setup ID */
     1410  if (type == 1008 || type == 1033 ) {
     1411    GETSTRING(antsernum, antserialnum)
     1412    if ((antsernum > -1 && antsernum < 265)) {
     1413      memcpy(_antType.back().serialnumber, antserialnum, antsernum);
     1414      _antType.back().serialnumber[antsernum] = 0;
    14061415    }
    14071416  }
     1417
    14081418  if (type == 1033) {
    1409     SKIPBITS(8)
    1410     GETSTRING(dnum, dummy)
    14111419    GETSTRING(recnum, receiver)
    1412     if (recnum > -1 && recnum < 265) {
    1413       memcpy(rectype, receiver, recnum);
    1414       rectype[recnum] = 0;
    1415       if (!_recType.contains(rectype)) {
    1416         _recType.push_back(rectype);
     1420    GETSTRING(recfirnum, recfirmware)
     1421    GETSTRING(recsernum, recserialnum)
     1422    if ((recnum > -1 && recnum < 265) &&
     1423        (_recType.empty() || strncmp(_recType.back().descriptor, receiver, recnum) != 0)) {
     1424      _recType.push_back(t_recInfo());
     1425      memcpy(_recType.back().descriptor, receiver, recnum);
     1426      _recType.back().descriptor[recnum] = 0;
     1427      if (recfirnum > -1 && recfirnum < 265) {
     1428        memcpy(_recType.back().firmware, recfirmware, recfirnum);
     1429        _recType.back().firmware[recfirnum] = 0;
     1430      }
     1431      if (recsernum > -1 && recsernum < 265) {
     1432        memcpy(_recType.back().serialnumber, recserialnum, recsernum);
     1433        _recType.back().serialnumber[recsernum] = 0;
    14171434      }
    14181435    }
     
    14321449
    14331450  GETBITS(type, 12)
    1434   _antList.push_back(t_antInfo());
    1435   _antList.back().type = t_antInfo::ARP;
     1451  _antList.push_back(t_antRefPoint());
     1452  _antList.back().type = t_antRefPoint::ARP;
    14361453  SKIPBITS(22)
    14371454  GETBITSSIGN(x, 38)
Note: See TracChangeset for help on using the changeset viewer.