Open ckrey opened 6 years ago
I had a similar thought and am using something like this already in tline.c
:
lat = GET_D(pos + dp -> lat);
lon = GET_D(pos + dp -> lon);
obj = json_mkobject();
if (!isnan(lat) && !isnan(lon)) {
json_append_member(obj, "lat", json_mkdouble(lat, 6));
json_append_member(obj, "lon", json_mkdouble(lon, 6));
json_append_member(obj, "_type", json_mkstring("location"));
} else {
json_append_member(obj, "_type", json_mkstring("status"));
}
This removes the need for setting the location here
GL300(W) devices (battery driven, not car connected) send GTPNA / GTPFA messages when manually switched on or off. As these messages do not contain a position (lat/lon), they are not processed