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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.