aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2012-11-04 19:48:48 +0100
committerHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2012-11-05 00:17:19 +0100
commit03185b306b27184bc67da06e11234542d032fde2 (patch)
treece60c9cbac11f34a596886eed80e3d70975fd96b
parente67872ca05740d9b01a6ef14a3424ccafcb1a17c (diff)
downloadBlueGPS-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.java2
-rw-r--r--src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java2
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();