Skip to content

Commit f466872

Browse files
committed
More tidying...
1 parent 34029b7 commit f466872

File tree

3 files changed

+34
-296
lines changed

3 files changed

+34
-296
lines changed

src/LG290P_structs.h

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,6 @@ struct PvtDomain
3434
double heading = 0;
3535

3636
void clear() { *this = PvtDomain(); }
37-
38-
#if false
39-
uint8_t timeStatus = 3; // 0 = valid, 3 = invalid
40-
uint8_t dateStatus = 0; // 0 = Invalid, 1 = valid, 2 = leap second warning
41-
double verticalSpeed = 0;
42-
double trackGround = 0;
43-
44-
float latitudeDeviation = 0;
45-
float longitudeDeviation = 0;
46-
float heightDeviation = 0;
47-
float horizontalSpeedDeviation = 0;
48-
float verticalSpeedDeviation = 0;
49-
50-
uint8_t positionType = 0; // 0 = None, 1 = FixedPos, 8 = DopplerVelocity, 16 = Single, ...
51-
uint8_t velocityType = 0; // 0 = None, 1 = FixedPos, 8 = DopplerVelocity, 16 = Single, ...
52-
53-
uint8_t
54-
solutionStatus = 0; // 0 = Solution computed, 1 = Insufficient observation, 3 = No convergence, 4 = Covariance trace
55-
56-
uint8_t satellitesTracked = 0;
57-
58-
uint8_t rtkSolution = 0;
59-
uint8_t pseudorangeCorrection = 0;
60-
#endif
6137
};
6238

6339
struct RtcmDomain
@@ -293,100 +269,5 @@ struct RtcmPacket
293269
static bool FromBuffer(uint8_t *buffer, size_t bufferLen, RtcmPacket &result);
294270
};
295271

296-
#if false
297-
typedef struct
298-
{
299-
double latitude;
300-
double longitude;
301-
double altitude;
302-
double horizontalSpeed;
303-
double verticalSpeed;
304-
double trackGround;
305-
306-
float latitudeDeviation;
307-
float longitudeDeviation;
308-
float heightDeviation;
309-
float horizontalSpeedDeviation;
310-
float verticalSpeedDeviation;
311-
312-
uint8_t positionType; // 0 = None, 1 = FixedPos, 8 = DopplerVelocity, 16 = Single, ...
313-
uint8_t velocityType; // 0 = None, 1 = FixedPos, 8 = DopplerVelocity, 16 = Single, ...
314-
315-
uint8_t
316-
solutionStatus; // 0 = Solution computed, 1 = Insufficient observation, 3 = No convergence, 4 = Covariance trace
317-
318-
uint8_t satellitesTracked;
319-
uint8_t satellitesUsed;
320-
321-
uint8_t rtkSolution = 0;
322-
uint8_t pseudorangeCorrection = 0;
323-
} UNICORE_BESTNAV_data_t;
324-
325-
typedef struct
326-
{
327-
// ubxAutomaticFlags automaticFlags;
328-
UNICORE_BESTNAV_data_t data;
329-
void (*callbackPointerPtr)(UNICORE_BESTNAV_data_t *);
330-
UNICORE_BESTNAV_data_t *callbackData;
331-
} UNICORE_BESTNAV_t;
332-
333-
typedef struct
334-
{
335-
double ecefX = 0;
336-
double ecefY = 0;
337-
double ecefZ = 0;
338-
float ecefXDeviation = 0;
339-
float ecefYDeviation = 0;
340-
float ecefZDeviation = 0;
341-
} UNICORE_BESTNAVXYZ_data_t;
342-
343-
typedef struct
344-
{
345-
// ubxAutomaticFlags automaticFlags;
346-
UNICORE_BESTNAVXYZ_data_t data;
347-
void (*callbackPointerPtr)(UNICORE_BESTNAVXYZ_data_t *);
348-
UNICORE_BESTNAVXYZ_data_t *callbackData;
349-
} UNICORE_BESTNAVXYZ_t;
350-
351-
typedef struct
352-
{
353-
uint16_t year = 0;
354-
uint8_t month = 0;
355-
uint8_t day = 0;
356-
uint8_t hour = 0;
357-
uint8_t minute = 0;
358-
uint8_t second = 0;
359-
uint16_t millisecond = 0;
360-
uint8_t timeStatus = 3; // 0 = valid, 3 = invalid
361-
uint8_t dateStatus = 0; // 0 = Invalid, 1 = valid, 2 = leap second warning
362-
double timeOffset = 0;
363-
double timeDeviation = 0;
364-
} UNICORE_RECTIME_data_t;
365-
366-
typedef struct
367-
{
368-
// ubxAutomaticFlags automaticFlags;
369-
UNICORE_RECTIME_data_t data;
370-
void (*callbackPointerPtr)(UNICORE_RECTIME_data_t *);
371-
UNICORE_RECTIME_data_t *callbackData;
372-
} UNICORE_RECTIME_t;
373-
374-
// #VERSION,98,GPS,UNKNOWN,1,711000,0,0,18,144;UM980,R4.10Build7923,HRPT00-S10C-P,2310415000001-MD22B1224961040,ff3bd496fd7ca68b,2022/09/28*55f61e51
375-
typedef struct
376-
{
377-
uint8_t modelType = 0;
378-
char swVersion[33 + 1] = {0}; // Add terminator
379-
char efuseID[33 + 1] = {0}; // Add terminator
380-
char compileTime[43 + 1] = {0}; // Add terminator
381-
} UNICORE_VERSION_data_t;
382-
383-
typedef struct
384-
{
385-
// ubxAutomaticFlags automaticFlags;
386-
UNICORE_VERSION_data_t data;
387-
void (*callbackPointerPtr)(UNICORE_VERSION_data_t *);
388-
UNICORE_VERSION_data_t *callbackData;
389-
} UNICORE_VERSION_t;
390-
#endif
391272

392273
#endif // _SPARKFUN_LG290P_STRUCTS_H

src/SparkFun_LG290P_GNSS.cpp

Lines changed: 1 addition & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,45 +1261,6 @@ bool LG290P::isNewSatelliteInfoAvailable()
12611261
return r;
12621262
}
12631263

1264-
double LG290P::getLatitude()
1265-
{
1266-
ensurePvtEnabled();
1267-
return pvtDomain.latitude;
1268-
}
1269-
1270-
double LG290P::getLongitude()
1271-
{
1272-
ensurePvtEnabled();
1273-
return pvtDomain.longitude;
1274-
}
1275-
1276-
double LG290P::getAltitude()
1277-
{
1278-
ensurePvtEnabled();
1279-
return pvtDomain.altitude;
1280-
}
1281-
1282-
double LG290P::getHorizontalSpeed()
1283-
{
1284-
ensurePvtEnabled();
1285-
return pvtDomain.groundSpeed;
1286-
}
1287-
1288-
double LG290P::getEcefX()
1289-
{
1290-
return rtcmDomain.ecefX;
1291-
}
1292-
1293-
double LG290P::getEcefY()
1294-
{
1295-
return rtcmDomain.ecefY;
1296-
}
1297-
1298-
double LG290P::getEcefZ()
1299-
{
1300-
return rtcmDomain.ecefZ;
1301-
}
1302-
13031264
uint16_t LG290P::getSatellitesInViewCount()
13041265
{
13051266
uint16_t count = 0;
@@ -1308,36 +1269,8 @@ uint16_t LG290P::getSatellitesInViewCount()
13081269
return count;
13091270
}
13101271

1311-
uint16_t LG290P::getSatellitesUsedCount()
1312-
{
1313-
ensurePvtEnabled();
1314-
return pvtDomain.satellitesUsed;
1315-
}
1316-
1317-
// 0 = Fix not available or invalid.
1318-
// 1 = GPS SPS Mode, fix valid.
1319-
// 2 = Differential GPS, SPS Mode, or Satellite Based Augmentation. System (SBAS), fix valid.
1320-
// 3 = GPS PPS Mode, fix valid.
1321-
// 4 = Real Time Kinematic (RTK) System used in RTK mode with fixed integers.
1322-
// 5 = Float RTK. Satellite system used in RTK mode, floating integers.
1323-
// Note: this function is unique in using the "quality" field from GGA rather than PQTMPVT.
1324-
// PQTMPVT has a more limited response: only 0-3.
1325-
uint8_t LG290P::getFixQuality()
1326-
{
1327-
ensureGgaEnabled();
1328-
return pvtDomain.quality - '0'; // Convert ASCII to uint8_t
1329-
}
1330-
1331-
// 'V' = Fix not available or invalid (void).
1332-
// 'A' = Fix available
1333-
char LG290P::getFixStatus()
1334-
{
1335-
ensureRmcEnabled();
1336-
return pvtDomain.fixStatus;
1337-
}
1338-
13391272
// Return the number of millis since last update
1340-
uint32_t LG290P::getGeodeticAgeMs()
1273+
uint32_t LG290P::getPVTDomainAgeMs()
13411274
{
13421275
return millis() - lastUpdatePvtDomain;
13431276
}
@@ -1422,72 +1355,6 @@ void LG290P::ecefToGeodetic(double x, double y, double z, double &latOut, double
14221355
lonOut *= RAD_TO_DEG;
14231356
}
14241357

1425-
uint16_t LG290P::getYear()
1426-
{
1427-
ensurePvtEnabled();
1428-
return pvtDomain.year;
1429-
}
1430-
1431-
uint8_t LG290P::getMonth()
1432-
{
1433-
ensurePvtEnabled();
1434-
return pvtDomain.month;
1435-
}
1436-
1437-
uint8_t LG290P::getDay()
1438-
{
1439-
ensurePvtEnabled();
1440-
return pvtDomain.day;
1441-
}
1442-
1443-
uint8_t LG290P::getHour()
1444-
{
1445-
ensurePvtEnabled();
1446-
return pvtDomain.hour;
1447-
}
1448-
1449-
uint8_t LG290P::getMinute()
1450-
{
1451-
ensurePvtEnabled();
1452-
return pvtDomain.minute;
1453-
}
1454-
1455-
uint8_t LG290P::getSecond()
1456-
{
1457-
ensurePvtEnabled();
1458-
return pvtDomain.second;
1459-
}
1460-
1461-
uint16_t LG290P::getMillisecond()
1462-
{
1463-
ensurePvtEnabled();
1464-
return (uint16_t)(pvtDomain.nanosecond / 1000000);
1465-
}
1466-
1467-
uint16_t LG290P::getLeapSeconds()
1468-
{
1469-
ensurePvtEnabled();
1470-
return pvtDomain.leapSeconds;
1471-
}
1472-
1473-
double LG290P::getCourse()
1474-
{
1475-
ensurePvtEnabled();
1476-
return pvtDomain.course;
1477-
}
1478-
1479-
double LG290P::getHdop()
1480-
{
1481-
ensurePvtEnabled();
1482-
return pvtDomain.hdop;
1483-
}
1484-
1485-
double LG290P::getPdop()
1486-
{
1487-
ensurePvtEnabled();
1488-
return pvtDomain.pdop;
1489-
}
1490-
14911358
NmeaPacket NmeaPacket::FromString(const std::string &str)
14921359
{
14931360
NmeaPacket s;

0 commit comments

Comments
 (0)