diff options
author | Herbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com> | 2010-09-26 01:33:30 +0200 |
---|---|---|
committer | Herbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com> | 2010-09-26 01:33:30 +0200 |
commit | 80b98b1f2743f89244b0ed1dc66000e5a92f8d08 (patch) | |
tree | bdd41fdd5106263d40cb7f79d19c62d7f3969221 /src/org/broeuschmeul/android/gps/nmea | |
parent | 1a394d2c37a50dd2b7ba00a480cda41dd7e30ebf (diff) | |
download | BlueGPS-80b98b1f2743f89244b0ed1dc66000e5a92f8d08.zip BlueGPS-80b98b1f2743f89244b0ed1dc66000e5a92f8d08.tar.gz BlueGPS-80b98b1f2743f89244b0ed1dc66000e5a92f8d08.tar.bz2 |
reconnect on unexpected disconnection
Diffstat (limited to 'src/org/broeuschmeul/android/gps/nmea')
-rw-r--r-- | src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java b/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java index 5a3ac08..b690285 100644 --- a/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java +++ b/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java @@ -178,11 +178,13 @@ public class NmeaParser { }
// parse NMEA Sentence
- public void parseNmeaSentence(String gpsSentence){
+ public String parseNmeaSentence(String gpsSentence){
+ String nmeaSentence = null;
Log.e("BT test", "data: "+System.currentTimeMillis()+" "+gpsSentence);
Pattern xx = Pattern.compile("\\$([^*$]*)\\*([0-9A-F][0-9A-F])?\r\n");
Matcher m = xx.matcher(gpsSentence);
if (m.matches()){
+ nmeaSentence = m.group(0);
String sentence = m.group(1);
String checkSum = m.group(2);
Log.e("BT test", "data: "+System.currentTimeMillis()+" "+sentence+" cheksum; "+checkSum +" control: "+String.format("%X",computeChecksum(sentence)));
@@ -448,6 +450,7 @@ public class NmeaParser { // Mode indicator, (A=autonomous, D=differential, E=Estimated, N=not valid, S=Simulator )
}
}
+ return nmeaSentence;
}
public double parseNmeaLatitude(String lat,String orientation){
|