21 struct gps_data_t gps_data;
22 memset(&gps_data, 0,
sizeof gps_data);
25 qDebug() <<
"code: " << rc <<
", reason: ", gps_errstr(rc);
32 gps_stream(&gps_data, WATCH_ENABLE | WATCH_JSON, NULL);
37 if (gps_waiting (&gps_data, 1000000))
39 printf(
"Read GPS data\n");
41 if ((rc = gps_read(&gps_data)) == -1)
43 qDebug() <<
"error occured reading gps data. code: " << rc <<
", reason: " << gps_errstr(rc);
51 if ((gps_data.status == STATUS_FIX) &&
52 (gps_data.fix.mode == MODE_2D || gps_data.fix.mode == MODE_3D) &&
53 !isnan(gps_data.fix.latitude) &&
54 !isnan(gps_data.fix.longitude))
61 if(isnan(gps_data.fix.eps))
71 if(isnan(gps_data.fix.epd))
85 qDebug() <<
"no GPS data available";
101 printf(
"Leaving GPS\n");
104 gps_stream(&gps_data, WATCH_DISABLE, NULL);
105 gps_close (&gps_data);
110 if(!epv || isnan(epv))
ReferencePosition_t make_ReferencePosition()
make_ReferencePosition Make a default ReferencePosition_t.
void constr_Speed(Speed_t *s)
constr_Speed Check Speed_t constraints.
HeadingConfidence_t headingConfidence
void constr_ReferencePosition(ReferencePosition_t *r)
constr_ReferencePosition Check ReferencePosition_t constraints.
void getPosition()
getPosition Get the position from GPSProvider signal. (c.f. execute()).
Heading_t make_Heading()
make_Heading Make a default Heading_t.
AltitudeConfidence_t getAltitudeConfidence(int epv)
getAltitudeConfidence Translate altitude uncertainty from GPS signal to ETSI's altitude confidence...
quint64 getTimestamp()
getTimestamp Get ITS timestamp from system timestamp.
HeadingValue_t headingValue
void execute()
execute Execute the GPS client. I.e. wait for GPS signal and feed GPS attributes. If no GPS signal or...
ParameterGPS & data()
data GPS data getter.
AltitudeConfidence_t altitudeConfidence
long AltitudeConfidence_t
void checkConstraints()
checkConstraints Check the constraints and change to correct values.
void positionChanged()
positionChanged Signal used when GPS position change.
AltitudeValue_t altitudeValue
Speed_t make_Speed()
make_Speed Make a default Speed_t.
GPSProvider()
GPSProvider GPSProvider constructor.
void constr_Heading(Heading_t *h)
constr_Heading Make a check of an Heading_t constraints.
ReferencePosition_t m_referencePosition
SpeedConfidence_t speedConfidence