Kismet Wireless

Kismet Forums

 

Posted by:Dutch
Subject:Speed from JSON type GPSD not working.
Date:13:45:51 17/06/2011

> If you want a patch, just holler, but just duplicating of the lat or lon parsing and changing the field indicator an variables took care of it.

Patch to fix the two above issues.

Index: kis_panel_windows.cc
===================================================================
--- kis_panel_windows.cc (revision 3159)
+++ kis_panel_windows.cc (working copy)
@@ -823,8 +823,8 @@
int eng = StrLower(kpinterface->prefs->FetchOpt("GPSUNIT")) != "metric";

gpstext = string("GPS ") +
- NtoString<float>(lat).Str() + string(" ") +
- NtoString<float>(lon).Str() + string(" ");
+ NtoString<float>(lat, 6).Str() + string(" ") +
+ NtoString<float>(lon, 6).Str() + string(" ");

// Convert to m/hr
spd *= 3600;
@@ -3038,8 +3038,8 @@
gpsmoveinfo->SetText("");
} else {
gpstext = string("Lat ") +
- NtoString<float>(lat).Str() + string(" Lon ") +
- NtoString<float>(lon).Str();
+ NtoString<float>(lat, 6).Str() + string(" Lon ") +
+ NtoString<float>(lon, 6).Str();
gpslocinfo->SetText(gpstext);

if (eng) {
Index: gpsdclient.cc
===================================================================
--- gpsdclient.cc (revision 3159)
+++ gpsdclient.cc (working copy)
@@ -319,6 +319,13 @@
in_hed = n;
use_hed = 1;
}
+
+ // Speed
+ n = JSON_dict_get_number(json, "speed", err);
+ if (err.length() == 0) {
+ in_spd = n;
+ use_spd = 1;
+ }
}
} else if (msg_class == "SKY") {
GPSCore::sat_pos sp;


Reply to this message