Changeset 8645 in ntrip for branches


Ignore:
Timestamp:
Mar 29, 2019, 9:22:59 AM (6 years ago)
Author:
stuerze
Message:

big fixed in NMEA checksum

Location:
branches/BNC_2.12/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/bncutils.cpp

    r8616 r8645  
    302302  gga += QString(",%1,").arg(hei, 2, 'f', 1);
    303303  gga += QString("M,10.000,M,,");
    304   int xori;
    305 
    306   char XOR = 0;
    307   char Buff[gga.size()];
    308   strncpy(Buff, gga.toAscii().data(), gga.size());
    309   int iLen = strlen(Buff);
    310   for (xori = 0; xori < iLen; xori++) {
    311     XOR ^= (char)Buff[xori];
     304
     305  unsigned char XOR = 0;
     306  for (int ii = 0; ii < gga.length(); ii++) {
     307    XOR ^= (unsigned char) gga[ii].toAscii();
    312308  }
    313309  gga = "$" + gga + QString("*%1").arg(XOR, 2, 16, QLatin1Char('0'));
  • branches/BNC_2.12/src/pppRun.cpp

    r8404 r8645  
    692692  }
    693693
    694   return '$' + nmStr + QString("*%1\n").arg(int(XOR), 0, 16).toUpper();
     694  return '$' + nmStr + QString("*%1").arg(XOR, 2, 16, QLatin1Char('0'));
    695695}
    696696
Note: See TracChangeset for help on using the changeset viewer.