Add support for UBX-MON-HW2. Add Example30_NEO-D9S

This commit is contained in:
PaulZC
2022-03-07 12:42:10 +00:00
parent cf47a92895
commit de3fd81739
5 changed files with 175 additions and 0 deletions
@@ -8232,6 +8232,32 @@ bool SFE_UBLOX_GNSS::getHWstatus(UBX_MON_HW_data_t *data, uint16_t maxWait)
return (true);
}
// Get the extended hardware status using UBX_MON_HW2
bool SFE_UBLOX_GNSS::getHW2status(UBX_MON_HW2_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_MON;
packetCfg.id = UBX_MON_HW2;
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->ofsI = extractSignedChar(&packetCfg, 0);
data->magI = extractByte(&packetCfg, 1);
data->ofsQ = extractSignedChar(&packetCfg, 2);
data->magQ = extractByte(&packetCfg, 3);
data->cfgSource = extractByte(&packetCfg, 4);
data->lowLevCfg = extractLong(&packetCfg, 8); // Low-level configuration (obsolete for protocol versions greater than 15.00)
data->postStatus = extractLong(&packetCfg, 20);
return (true);
}
// UBX-CFG-NAVX5 - get/set the ackAiding byte. If ackAiding is 1, UBX-MGA-ACK messages will be sent by the module to acknowledge the MGA data
uint8_t SFE_UBLOX_GNSS::getAckAiding(uint16_t maxWait) // Get the ackAiding byte - returns 255 if the sendCommand fails
{
@@ -928,6 +928,9 @@ public:
// Hardware status (including jamming)
bool getHWstatus(UBX_MON_HW_data_t *data = NULL, uint16_t maxWait = defaultMaxWait); // Get the hardware status using UBX_MON_HW
// Extended hardware status
bool getHW2status(UBX_MON_HW2_data_t *data = NULL, uint16_t maxWait = defaultMaxWait); // Get the extended hardware status using UBX_MON_HW2
// UBX-CFG-NAVX5 - get/set the ackAiding byte. If ackAiding is 1, UBX-MGA-ACK messages will be sent by the module to acknowledge the MGA data
uint8_t getAckAiding(uint16_t maxWait = defaultMaxWait); // Get the ackAiding byte - returns 255 if the sendCommand fails
bool setAckAiding(uint8_t ackAiding, uint16_t maxWait = defaultMaxWait); // Set the ackAiding byte
+17
View File
@@ -1734,6 +1734,23 @@ typedef struct
uint8_t pullL; // Mask of pins value using the PIO pull low resistor
} UBX_MON_HW_data_t;
// UBX-MON-HW2 (0x0A 0x0B): Extended hardware status
const uint16_t UBX_MON_HW2_LEN = 28;
typedef struct
{
int8_t ofsI; // Imbalance of I-part of complex signal, scaled (-128 = max. negative imbalance, 127 = max. positive imbalance)
uint8_t magI; // Magnitude of I-part of complex signal, scaled (0 = no signal, 255 = max. magnitude)
int8_t ofsQ; // Imbalance of Q-part of complex signal, scaled (-128 = max. negative imbalance, 127 = max. positive imbalance)
uint8_t magQ; // Magnitude of Q-part of complex signal, scaled (0 = no signal, 255 = max. magnitude)
uint8_t cfgSource; // Source of low-level configuration (114 = ROM, 111 = OTP, 112 = config pins, 102 = flash image)
uint8_t reserved0[3];
uint32_t lowLevCfg; // Low-level configuration (obsolete for protocol versions greater than 15.00)
uint8_t reserved1[8];
uint32_t postStatus; // POST status word
uint8_t reserved2[4]; // Reserved
} UBX_MON_HW2_data_t;
// UBX-MON-RF (0x0a 0x38): RF information
const uint16_t UBX_MON_RF_MAX_BLOCKS = 2; // 0 = L1; 1 = L2 / L5
const uint16_t UBX_MON_RF_MAX_LEN = 4 + (24 * UBX_MON_RF_MAX_BLOCKS);