diff options
author | Herbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com> | 2012-11-04 19:48:48 +0100 |
---|---|---|
committer | Herbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com> | 2012-11-05 00:17:19 +0100 |
commit | 03185b306b27184bc67da06e11234542d032fde2 (patch) | |
tree | ce60c9cbac11f34a596886eed80e3d70975fd96b | |
parent | e67872ca05740d9b01a6ef14a3424ccafcb1a17c (diff) | |
download | BlueGPS-03185b306b27184bc67da06e11234542d032fde2.zip BlueGPS-03185b306b27184bc67da06e11234542d032fde2.tar.gz BlueGPS-03185b306b27184bc67da06e11234542d032fde2.tar.bz2 |
Correction in NMEA checksum calcul
-rw-r--r-- | src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java | 2 | ||||
-rw-r--r-- | src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java index da76754..d85130e 100644 --- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java +++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java @@ -722,7 +722,7 @@ public class BlueetoothGpsManager { * @param sentence the NMEA sentence without the first "$", the last "*" and the checksum.
*/
public void sendNmeaCommand(String sentence){
- String command = String.format((Locale)null,"$%s*%X\r\n", sentence, parser.computeChecksum(sentence));
+ String command = String.format((Locale)null,"$%s*%02X\r\n", sentence, parser.computeChecksum(sentence));
sendPackagedNmeaCommand(command);
}
diff --git a/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java b/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java index 7c361a9..fe2e70c 100644 --- a/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java +++ b/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java @@ -220,7 +220,7 @@ public class NmeaParser { nmeaSentence = m.group(0);
String sentence = m.group(1);
String checkSum = m.group(2);
- Log.v(LOG_TAG, "data: "+System.currentTimeMillis()+" "+sentence+" cheksum; "+checkSum +" control: "+String.format("%X",computeChecksum(sentence)));
+ Log.v(LOG_TAG, "data: "+System.currentTimeMillis()+" "+sentence+" cheksum; "+checkSum +" control: "+String.format("%02X",computeChecksum(sentence)));
SimpleStringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
splitter.setString(sentence);
String command = splitter.next();
|