@@ -256,11 +256,29 @@ protected IGPSObject parsePOLL(final JSONObject json) throws ParseException {
256256 IGPSObject gps ;
257257 // for gpsd version > 3.5
258258 final PollObject poll = new PollObject ();
259- poll .setTimestamp (this .parseTimestamp (json , "time" ));
259+ if (json .has ("time" )) {
260+ poll .setTimestamp (this .parseTimestamp (json , "time" ));
261+ } else if (json .has ("timestamp" )) {
262+ poll .setTimestamp (json .optDouble ("timestamp" , Double .NaN ));
263+ }
264+
260265 poll .setActive (json .optInt ("active" , 0 ));
261- poll .setFixes (this .parseObjectArray (json .optJSONArray ("tpv" ), TPVObject .class ));
262- poll .setSkyviews (this .parseObjectArray (json .optJSONArray ("sky" ), SKYObject .class ));
263- poll .setGst (this .parseObjectArray (json .optJSONArray ("gst" ), GSTObject .class ));
266+
267+ if (json .has ("tpv" )) {
268+ poll .setFixes (this .parseObjectArray (json .optJSONArray ("tpv" ), TPVObject .class ));
269+ } else if (json .has ("fixes" )) {
270+ poll .setFixes (this .parseObjectArray (json .optJSONArray ("fixes" ), TPVObject .class ));
271+ }
272+
273+ if (json .has ("sky" )) {
274+ poll .setSkyviews (this .parseObjectArray (json .optJSONArray ("sky" ), SKYObject .class ));
275+ } else if (json .has ("skyviews" )) {
276+ poll .setSkyviews (this .parseObjectArray (json .optJSONArray ("skyviews" ), SKYObject .class ));
277+ }
278+
279+ if (json .has ("gst" )) {
280+ poll .setGst (this .parseObjectArray (json .optJSONArray ("gst" ), GSTObject .class ));
281+ }
264282 gps = poll ;
265283 return gps ;
266284 }
0 commit comments