Skip to content

Commit

Permalink
msm8974-common: gps: Return the correct length of nmea sentence
Browse files Browse the repository at this point in the history
Return the correct length of nmea sentence in the
function loc_eng_nmea_put_checksum(). The correct
length is length of NMEA string including ‘$’
character alongwith length of checksum.

CRs-Fixed: 1020044
Change-Id: I50d80b9c4492de4664bb3ccb7295b0eb4fee15a9
  • Loading branch information
Dante Russo authored and ArianK16a committed Aug 14, 2019
1 parent 52ec51e commit 12543c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp
Expand Up @@ -93,8 +93,12 @@ int loc_eng_nmea_put_checksum(char *pNmea, int maxSize)
length++;
}

// length now contains nmea sentence string length not including $ sign.
int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum);
return (length + checksumLength);

// total length of nmea sentence is length of nmea sentence inc $ sign plus
// length of checksum (+1 is to cover the $ character in the length).
return (length + checksumLength + 1);
}

/*===========================================================================
Expand Down

0 comments on commit 12543c3

Please sign in to comment.