Skip to content

Commit

Permalink
Remove new line characters from NMEA sentences before logging
Browse files Browse the repository at this point in the history
Some devices such as the Samsung Galaxy S8+ (SM-G955U) add a new line character at the end of the NMEA sentence, which breaks logging by pushing the timestamp for the NMEA sentence to the following line
  • Loading branch information
barbeau committed Sep 7, 2019
1 parent 2f6ba51 commit 67e4dd8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public void onNmeaReceived(long timestamp, String s) {
if (mFileWriter == null) {
return;
}
String nmeaStream = String.format(Locale.US, "NMEA,%s,%d", s, timestamp);
String nmeaStream = String.format(Locale.US, "NMEA,%s,%d", s.trim(), timestamp);
try {
mFileWriter.write(nmeaStream);
mFileWriter.newLine();
Expand Down

0 comments on commit 67e4dd8

Please sign in to comment.