Changeset View
Changeset View
Standalone View
Standalone View
dataengines/geolocation/location_gps.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | #if GPSD_API_MAJOR_VERSION >= 7 | 54 | #if GPSD_API_MAJOR_VERSION >= 7 | ||
55 | if (gps_read(m_gpsdata, NULL, 0) != -1) { | 55 | if (gps_read(m_gpsdata, NULL, 0) != -1) { | ||
56 | #elif GPSD_API_MAJOR_VERSION >= 5 | 56 | #elif GPSD_API_MAJOR_VERSION >= 5 | ||
57 | if (gps_read(m_gpsdata) != -1) { | 57 | if (gps_read(m_gpsdata) != -1) { | ||
58 | #else | 58 | #else | ||
59 | if (gps_poll(m_gpsdata) != -1) { | 59 | if (gps_poll(m_gpsdata) != -1) { | ||
60 | #endif | 60 | #endif | ||
61 | //qDebug() << "poll ok"; | 61 | //qDebug() << "poll ok"; | ||
62 | #if GPSD_API_MAJOR_VERSION >= 9 | ||||
63 | if (m_gpsdata->online.tv_sec || m_gpsdata->online.tv_nsec) { | ||||
64 | #else | ||||
62 | if (m_gpsdata->online) { | 65 | if (m_gpsdata->online) { | ||
66 | #endif | ||||
63 | //qDebug() << "online"; | 67 | //qDebug() << "online"; | ||
64 | if (m_gpsdata->status != STATUS_NO_FIX) { | 68 | if (m_gpsdata->status != STATUS_NO_FIX) { | ||
65 | //qDebug() << "fix"; | 69 | //qDebug() << "fix"; | ||
66 | d["accuracy"] = 30; | 70 | d["accuracy"] = 30; | ||
67 | d["latitude"] = QString::number(m_gpsdata->fix.latitude); | 71 | d["latitude"] = QString::number(m_gpsdata->fix.latitude); | ||
68 | d["longitude"] = QString::number(m_gpsdata->fix.longitude); | 72 | d["longitude"] = QString::number(m_gpsdata->fix.longitude); | ||
69 | } | 73 | } | ||
70 | } | 74 | } | ||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |