Add TMODE3 struct and matching getSurveyMode
This commit is contained in:
@@ -7320,6 +7320,36 @@ bool SFE_UBLOX_GNSS::getSurveyMode(uint16_t maxWait)
|
||||
return ((sendCommand(&packetCfg, maxWait)) == SFE_UBLOX_STATUS_DATA_RECEIVED); // We are expecting data and an ACK
|
||||
}
|
||||
|
||||
// Get the current TimeMode3 settings - these contain survey in statuses
|
||||
bool SFE_UBLOX_GNSS::getSurveyMode(UBX_CFG_TMODE3_data_t *data, uint16_t maxWait)
|
||||
{
|
||||
if (data == NULL) // Check if the user forgot to include the data pointer
|
||||
return (false); // Bail
|
||||
|
||||
packetCfg.cls = UBX_CLASS_CFG;
|
||||
packetCfg.id = UBX_CFG_TMODE3;
|
||||
packetCfg.len = 0;
|
||||
packetCfg.startingSpot = 0;
|
||||
|
||||
if (sendCommand(&packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
|
||||
return (false);
|
||||
|
||||
// Extract the data
|
||||
data->version = extractByte(&packetCfg, 0);
|
||||
data->flags.all = extractInt(&packetCfg, 2);
|
||||
data->ecefXOrLat = extractSignedLong(&packetCfg, 4);
|
||||
data->ecefYOrLon = extractSignedLong(&packetCfg, 8);
|
||||
data->ecefZOrAlt = extractSignedLong(&packetCfg, 12);
|
||||
data->ecefXOrLatHP = extractSignedChar(&packetCfg, 16);
|
||||
data->ecefYOrLonHP = extractSignedChar(&packetCfg, 17);
|
||||
data->ecefZOrAltHP = extractSignedChar(&packetCfg, 18);
|
||||
data->fixedPosAcc = extractLong(&packetCfg, 20);
|
||||
data->svinMinDur = extractLong(&packetCfg, 24);
|
||||
data->svinAccLimit = extractLong(&packetCfg, 28);
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
||||
// Control Survey-In for NEO-M8P
|
||||
bool SFE_UBLOX_GNSS::setSurveyMode(uint8_t mode, uint16_t observationTime, float requiredAccuracy, uint16_t maxWait)
|
||||
{
|
||||
|
||||
@@ -861,6 +861,7 @@ public:
|
||||
|
||||
// Functions used for RTK and base station setup
|
||||
bool getSurveyMode(uint16_t maxWait = defaultMaxWait); // Get the current TimeMode3 settings
|
||||
bool getSurveyMode(UBX_CFG_TMODE3_data_t *data = NULL, uint16_t maxWait = defaultMaxWait); // Get the current TimeMode3 settings
|
||||
bool setSurveyMode(uint8_t mode, uint16_t observationTime, float requiredAccuracy, uint16_t maxWait = defaultMaxWait); // Control survey in mode
|
||||
bool setSurveyModeFull(uint8_t mode, uint32_t observationTime, float requiredAccuracy, uint16_t maxWait = defaultMaxWait); // Control survey in mode
|
||||
bool enableSurveyMode(uint16_t observationTime, float requiredAccuracy, uint16_t maxWait = defaultMaxWait); // Begin Survey-In for NEO-M8P / ZED-F9x
|
||||
|
||||
@@ -1754,6 +1754,35 @@ typedef struct
|
||||
} config2;
|
||||
} UBX_CFG_ITFM_data_t;
|
||||
|
||||
// UBX-CFG-TMODE3 (0x06 0x71): Time Mode Settings 3
|
||||
const uint16_t UBX_CFG_TMODE3_LEN = 40;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t version; // Message version (0x00 for this version)
|
||||
uint8_t reserved1;
|
||||
union
|
||||
{
|
||||
uint16_t all;
|
||||
struct
|
||||
{
|
||||
uint16_t mode : 8; // Receiver Mode: 0 Disabled; 1 Survey In; 2 Fixed Mode (true ARP position information required); 3-255 Reserved
|
||||
uint16_t lla : 1; // Position is given in LAT/LON/ALT (default is ECEF)
|
||||
} bits;
|
||||
} flags;
|
||||
int32_t ecefXOrLat; // WGS84 ECEF X coordinate (or latitude) of the ARP position, depending on flags above: cm or deg*1e-7
|
||||
int32_t ecefYOrLon; // WGS84 ECEF Y coordinate (or latitude) of the ARP position, depending on flags above: cm or deg*1e-7
|
||||
int32_t ecefZOrAlt; // WGS84 ECEF Z coordinate (or altitude) of the ARP position, depending on flags above: cm
|
||||
int8_t ecefXOrLatHP; // High-precision WGS84 ECEF X coordinate (or latitude) of the ARP position, depending on flags above: 0.1 mm or deg*1e-9
|
||||
int8_t ecefYOrLonHP; // High-precision WGS84 ECEF Y coordinate (or longitude) of the ARP position, depending on flags above: 0.1 mm or deg*1e-9
|
||||
int8_t ecefZOrAltHP; // High-precision WGS84 ECEF Z coordinate (or altitude) of the ARP position, depending on flags above: 0.1 mm
|
||||
uint8_t reserved2;
|
||||
uint32_t fixedPosAcc; // Fixed position 3D accuracy: 0.1 mm
|
||||
uint32_t svinMinDur; // Survey-in minimum duration: s
|
||||
uint32_t svinAccLimit; // Survey-in position accuracy limit: 0.1 mm
|
||||
uint8_t reserved3[8];
|
||||
} UBX_CFG_TMODE3_data_t;
|
||||
|
||||
// MON-specific structs
|
||||
|
||||
// UBX-MON-HW (0x0A 0x09): Hardware status
|
||||
|
||||
Reference in New Issue
Block a user