mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-28 10:42:08 +00:00
no byte... just 8 unsigned bits please
This commit is contained in:
parent
134fc75b67
commit
4ff343b20f
@ -335,7 +335,7 @@ bool GPS::setupGPS()
|
|||||||
} else if (gnssModel == GNSS_MODEL_UBLOX) {
|
} else if (gnssModel == GNSS_MODEL_UBLOX) {
|
||||||
/*
|
/*
|
||||||
uint8_t buffer[768] = {0};
|
uint8_t buffer[768] = {0};
|
||||||
byte _message_GNSS[8] = {0xb5, 0x62, // Sync message for UBX protocol
|
uint8_t _message_GNSS[8] = {0xb5, 0x62, // Sync message for UBX protocol
|
||||||
0x06, 0x3e, // Message class and ID (UBX-CFG-GNSS)
|
0x06, 0x3e, // Message class and ID (UBX-CFG-GNSS)
|
||||||
0x00, 0x00, // Length of payload (28 bytes)
|
0x00, 0x00, // Length of payload (28 bytes)
|
||||||
0x00, 0x00};
|
0x00, 0x00};
|
||||||
@ -359,7 +359,7 @@ bool GPS::setupGPS()
|
|||||||
0) { // The original ublox 6 is GPS only and doesn't support the UBX-CFG-GNSS message
|
0) { // The original ublox 6 is GPS only and doesn't support the UBX-CFG-GNSS message
|
||||||
if (strncmp(info.hwVersion, "00070000", 8) == 0) { // Max7 seems to only support GPS *or* GLONASS
|
if (strncmp(info.hwVersion, "00070000", 8) == 0) { // Max7 seems to only support GPS *or* GLONASS
|
||||||
LOG_DEBUG("Setting GPS+SBAS\n");
|
LOG_DEBUG("Setting GPS+SBAS\n");
|
||||||
byte _message_GNSS[28] = {
|
uint8_t _message_GNSS[28] = {
|
||||||
0xb5, 0x62, // Sync message for UBX protocol
|
0xb5, 0x62, // Sync message for UBX protocol
|
||||||
0x06, 0x3e, // Message class and ID (UBX-CFG-GNSS)
|
0x06, 0x3e, // Message class and ID (UBX-CFG-GNSS)
|
||||||
0x14, 0x00, // Length of payload (28 bytes)
|
0x14, 0x00, // Length of payload (28 bytes)
|
||||||
@ -377,7 +377,7 @@ bool GPS::setupGPS()
|
|||||||
// Send the message to the module
|
// Send the message to the module
|
||||||
_serial_gps->write(_message_GNSS, sizeof(_message_GNSS));
|
_serial_gps->write(_message_GNSS, sizeof(_message_GNSS));
|
||||||
} else {
|
} else {
|
||||||
byte _message_GNSS[36] = {
|
uint8_t _message_GNSS[36] = {
|
||||||
0xb5, 0x62, // Sync message for UBX protocol
|
0xb5, 0x62, // Sync message for UBX protocol
|
||||||
0x06, 0x3e, // Message class and ID (UBX-CFG-GNSS)
|
0x06, 0x3e, // Message class and ID (UBX-CFG-GNSS)
|
||||||
0x1c, 0x00, // Length of payload (28 bytes)
|
0x1c, 0x00, // Length of payload (28 bytes)
|
||||||
@ -419,7 +419,7 @@ bool GPS::setupGPS()
|
|||||||
|
|
||||||
// Enable interference resistance, because we are using LoRa, WiFi and Bluetooth on same board,
|
// Enable interference resistance, because we are using LoRa, WiFi and Bluetooth on same board,
|
||||||
// and we need to reduce interference from them
|
// and we need to reduce interference from them
|
||||||
byte _message_JAM[16] = {
|
uint8_t _message_JAM[16] = {
|
||||||
0xB5, 0x62, // UBX protocol sync characters
|
0xB5, 0x62, // UBX protocol sync characters
|
||||||
0x06, 0x39, // Message class and ID (UBX-CFG-ITFM)
|
0x06, 0x39, // Message class and ID (UBX-CFG-ITFM)
|
||||||
0x08, 0x00, // Length of payload (8 bytes)
|
0x08, 0x00, // Length of payload (8 bytes)
|
||||||
@ -448,7 +448,7 @@ bool GPS::setupGPS()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Configure navigation engine expert settings:
|
// Configure navigation engine expert settings:
|
||||||
byte _message_NAVX5[48] = {
|
uint8_t _message_NAVX5[48] = {
|
||||||
0xb5, 0x62, // UBX protocol sync characters
|
0xb5, 0x62, // UBX protocol sync characters
|
||||||
0x06, 0x23, // Message class and ID (UBX-CFG-NAVX5)
|
0x06, 0x23, // Message class and ID (UBX-CFG-NAVX5)
|
||||||
0x28, 0x00, // Length of payload (40 bytes)
|
0x28, 0x00, // Length of payload (40 bytes)
|
||||||
@ -498,7 +498,7 @@ bool GPS::setupGPS()
|
|||||||
// Lowering the update rate helps to save power.
|
// Lowering the update rate helps to save power.
|
||||||
// Additionally, for some new modules like the M9/M10, an update rate lower than 5Hz
|
// Additionally, for some new modules like the M9/M10, an update rate lower than 5Hz
|
||||||
// is recommended to avoid a known issue with satellites disappearing.
|
// is recommended to avoid a known issue with satellites disappearing.
|
||||||
byte _message_1Hz[] = {
|
uint8_t _message_1Hz[] = {
|
||||||
0xB5, 0x62, // UBX protocol sync characters
|
0xB5, 0x62, // UBX protocol sync characters
|
||||||
0x06, 0x08, // Message class and ID (UBX-CFG-RATE)
|
0x06, 0x08, // Message class and ID (UBX-CFG-RATE)
|
||||||
0x06, 0x00, // Length of payload (6 bytes)
|
0x06, 0x00, // Length of payload (6 bytes)
|
||||||
@ -520,7 +520,7 @@ bool GPS::setupGPS()
|
|||||||
|
|
||||||
// Disable GGL. GGL - Geographic position (latitude and longitude), which provides the current geographical
|
// Disable GGL. GGL - Geographic position (latitude and longitude), which provides the current geographical
|
||||||
// coordinates.
|
// coordinates.
|
||||||
byte _message_GGL[] = {
|
uint8_t _message_GGL[] = {
|
||||||
0xB5, 0x62, // UBX sync characters
|
0xB5, 0x62, // UBX sync characters
|
||||||
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
||||||
0x08, 0x00, // Length of payload (8 bytes)
|
0x08, 0x00, // Length of payload (8 bytes)
|
||||||
@ -543,7 +543,7 @@ bool GPS::setupGPS()
|
|||||||
|
|
||||||
// Enable GSA. GSA - GPS DOP and active satellites, used for detailing the satellites used in the positioning and
|
// Enable GSA. GSA - GPS DOP and active satellites, used for detailing the satellites used in the positioning and
|
||||||
// the DOP (Dilution of Precision)
|
// the DOP (Dilution of Precision)
|
||||||
byte _message_GSA[] = {
|
uint8_t _message_GSA[] = {
|
||||||
0xB5, 0x62, // UBX sync characters
|
0xB5, 0x62, // UBX sync characters
|
||||||
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
||||||
0x08, 0x00, // Length of payload (8 bytes)
|
0x08, 0x00, // Length of payload (8 bytes)
|
||||||
@ -560,7 +560,7 @@ bool GPS::setupGPS()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Disable GSV. GSV - Satellites in view, details the number and location of satellites in view.
|
// Disable GSV. GSV - Satellites in view, details the number and location of satellites in view.
|
||||||
byte _message_GSV[] = {
|
uint8_t _message_GSV[] = {
|
||||||
0xB5, 0x62, // UBX sync characters
|
0xB5, 0x62, // UBX sync characters
|
||||||
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
||||||
0x08, 0x00, // Length of payload (8 bytes)
|
0x08, 0x00, // Length of payload (8 bytes)
|
||||||
@ -578,7 +578,7 @@ bool GPS::setupGPS()
|
|||||||
|
|
||||||
// Disable VTG. VTG - Track made good and ground speed, which provides course and speed information relative to
|
// Disable VTG. VTG - Track made good and ground speed, which provides course and speed information relative to
|
||||||
// the ground.
|
// the ground.
|
||||||
byte _message_VTG[] = {
|
uint8_t _message_VTG[] = {
|
||||||
0xB5, 0x62, // UBX sync characters
|
0xB5, 0x62, // UBX sync characters
|
||||||
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
||||||
0x08, 0x00, // Length of payload (8 bytes)
|
0x08, 0x00, // Length of payload (8 bytes)
|
||||||
@ -595,7 +595,7 @@ bool GPS::setupGPS()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enable RMC. RMC - Recommended Minimum data, the essential gps pvt (position, velocity, time) data.
|
// Enable RMC. RMC - Recommended Minimum data, the essential gps pvt (position, velocity, time) data.
|
||||||
byte _message_RMC[] = {
|
uint8_t _message_RMC[] = {
|
||||||
0xB5, 0x62, // UBX sync characters
|
0xB5, 0x62, // UBX sync characters
|
||||||
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
||||||
0x08, 0x00, // Length of payload (8 bytes)
|
0x08, 0x00, // Length of payload (8 bytes)
|
||||||
@ -612,7 +612,7 @@ bool GPS::setupGPS()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enable GGA. GGA - Global Positioning System Fix Data, which provides 3D location and accuracy data.
|
// Enable GGA. GGA - Global Positioning System Fix Data, which provides 3D location and accuracy data.
|
||||||
byte _message_GGA[] = {
|
uint8_t _message_GGA[] = {
|
||||||
0xB5, 0x62, // UBX sync characters
|
0xB5, 0x62, // UBX sync characters
|
||||||
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
0x06, 0x01, // Message class and ID (UBX-CFG-MSG)
|
||||||
0x08, 0x00, // Length of payload (8 bytes)
|
0x08, 0x00, // Length of payload (8 bytes)
|
||||||
@ -664,7 +664,7 @@ bool GPS::setupGPS()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// We need save configuration to flash to make our config changes persistent
|
// We need save configuration to flash to make our config changes persistent
|
||||||
byte _message_SAVE[21] = {
|
uint8_t _message_SAVE[21] = {
|
||||||
0xB5, 0x62, // UBX protocol header
|
0xB5, 0x62, // UBX protocol header
|
||||||
0x06, 0x09, // UBX class ID (Configuration Input Messages), message ID (UBX-CFG-CFG)
|
0x06, 0x09, // UBX class ID (Configuration Input Messages), message ID (UBX-CFG-CFG)
|
||||||
0x0D, 0x00, // Length of payload (13 bytes)
|
0x0D, 0x00, // Length of payload (13 bytes)
|
||||||
@ -1029,7 +1029,7 @@ GnssModel_t GPS::probe(int serialSpeed)
|
|||||||
// setting will not output command messages in UART1, resulting in unrecognized module information
|
// setting will not output command messages in UART1, resulting in unrecognized module information
|
||||||
if (serialSpeed != 9600) {
|
if (serialSpeed != 9600) {
|
||||||
// Set the UART port to 9600
|
// Set the UART port to 9600
|
||||||
byte _message_prt[] = {0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00,
|
uint8_t _message_prt[] = {0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00,
|
||||||
0x80, 0x25, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
0x80, 0x25, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
UBXChecksum(_message_prt, sizeof(_message_prt));
|
UBXChecksum(_message_prt, sizeof(_message_prt));
|
||||||
_serial_gps->write(_message_prt, sizeof(_message_prt));
|
_serial_gps->write(_message_prt, sizeof(_message_prt));
|
||||||
@ -1045,7 +1045,7 @@ GnssModel_t GPS::probe(int serialSpeed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset(buffer, 0, sizeof(buffer));
|
memset(buffer, 0, sizeof(buffer));
|
||||||
byte _message_MONVER[8] = {
|
uint8_t _message_MONVER[8] = {
|
||||||
0xB5, 0x62, // Sync message for UBX protocol
|
0xB5, 0x62, // Sync message for UBX protocol
|
||||||
0x0A, 0x04, // Message class and ID (UBX-MON-VER)
|
0x0A, 0x04, // Message class and ID (UBX-MON-VER)
|
||||||
0x00, 0x00, // Length of payload (we're asking for an answer, so no payload)
|
0x00, 0x00, // Length of payload (we're asking for an answer, so no payload)
|
||||||
|
Loading…
Reference in New Issue
Block a user