Changeset 8646 in ntrip


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

big fixed in NMEA checksum

Location:
trunk/BNC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncutils.cpp

    r8617 r8646  
    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.toLatin1().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].toLatin1();
    312308  }
    313309  gga = "$" + gga + QString("*%1").arg(XOR, 2, 16, QLatin1Char('0'));
  • trunk/BNC/src/pppRun.cpp

    r8403 r8646  
    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.