mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 17:28:50 -05:00
Merge pull request #1342 from srcejon/fix_1333
AIS: Terminate NMEA sentences with CR/LF.
This commit is contained in:
commit
cb09035fa3
@ -60,7 +60,11 @@ QString AISMessage::toNMEA(const QByteArray bytes)
|
||||
int c = 0;
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
c = (c << 1) | ((bytes[i] >> (bits - 1)) & 0x1);
|
||||
if (i < bytes.size()) {
|
||||
c = (c << 1) | ((bytes[i] >> (bits - 1)) & 0x1);
|
||||
} else {
|
||||
c = (c << 1);
|
||||
}
|
||||
bits--;
|
||||
if (bits == 0)
|
||||
{
|
||||
@ -92,7 +96,7 @@ QString AISMessage::toNMEA(const QByteArray bytes)
|
||||
sentence++;
|
||||
}
|
||||
|
||||
return nmeaSentences.join("\n");
|
||||
return nmeaSentences.join("\r\n").append("\r\n"); // NMEA-0183 requires CR and LF
|
||||
}
|
||||
|
||||
QString AISMessage::toNMEA()
|
||||
|
Loading…
Reference in New Issue
Block a user