Remove debug messages. Update Example1

This commit is contained in:
PaulZC
2021-11-26 11:54:15 +00:00
parent 9e8670851f
commit 142ca9853e
2 changed files with 14 additions and 25 deletions
@@ -56,7 +56,11 @@ void setup()
delay(1000);
Serial.begin(115200);
Serial.println("AssistNow Example");
Serial.println(F("AssistNow Example"));
while (Serial.available()) Serial.read(); // Empty the serial buffer
Serial.println(F("Press any key to begin..."));
while (!Serial.available()); // Wait for a keypress
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Start I2C. Connect to the GNSS.
@@ -75,16 +79,16 @@ void setup()
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Connect to WiFi.
Serial.print("Connecting to local WiFi");
Serial.print(F("Connecting to local WiFi"));
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
Serial.print(F("."));
}
Serial.println();
Serial.println("WiFi connected!");
Serial.println(F("WiFi connected!"));
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Use HTTP GET to receive the AssistNow_Online data
@@ -105,7 +109,7 @@ void setup()
getGNSS,
getDataType);
Serial.print("HTTP URL is: ");
Serial.print(F("HTTP URL is: "));
Serial.println(theURL);
HTTPClient http;
@@ -157,8 +161,8 @@ void setup()
if (payloadSize > 0)
{
// Enable the 'major' debug messages on Serial so we can see what AssistNow data is being sent
myGNSS.enableDebugging(Serial, true);
// Uncomment the next line to enable the 'major' debug messages on Serial so you can see what AssistNow data is being sent
//myGNSS.enableDebugging(Serial, true);
#ifndef USE_MGA_ACKs
@@ -191,6 +195,8 @@ void setup()
#endif
}
Serial.println(F("Here we go!"));
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+1 -18
View File
@@ -3987,11 +3987,6 @@ bool SFE_UBLOX_GNSS::pushRawData(uint8_t *dataBytes, size_t numDataBytes, bool s
// allowing the user to override with their own time data with setUTCTimeAssistance.
size_t SFE_UBLOX_GNSS::pushAssistNowData(const String &dataBytes, size_t numDataBytes, sfe_ublox_mga_assist_ack_e mgaAck, uint16_t maxWait)
{
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
{
_debugSerial->println(F("pushAssistNowData: OK so far... (1)"));
_debugSerial->flush();
}
return (pushAssistNowDataInternal(false, (const uint8_t *)dataBytes.c_str(), numDataBytes, mgaAck, maxWait));
}
size_t SFE_UBLOX_GNSS::pushAssistNowData(const uint8_t *dataBytes, size_t numDataBytes, sfe_ublox_mga_assist_ack_e mgaAck, uint16_t maxWait)
@@ -4011,12 +4006,6 @@ size_t SFE_UBLOX_GNSS::pushAssistNowDataInternal(bool skipTime, const uint8_t *d
size_t dataPtr = 0; // Pointer into dataBytes
size_t packetsProcessed = 0; // Keep count of how many packets have been processed
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
{
_debugSerial->println(F("pushAssistNowData: OK so far... (2)"));
_debugSerial->flush();
}
bool checkForAcks = (mgaAck == SFE_UBLOX_MGA_ASSIST_ACK_YES); // If mgaAck is YES, always check for Acks
// If mgaAck is ENQUIRE, we need to check UBX-CFG-NAVX5 ackAiding to determine if UBX-MGA-ACK's are expected
@@ -4052,12 +4041,6 @@ size_t SFE_UBLOX_GNSS::pushAssistNowDataInternal(bool skipTime, const uint8_t *d
dataIsOK &= (*(dataBytes + dataPtr + 1) == UBX_SYNCH_2); // Check for 0x62
dataIsOK &= (*(dataBytes + dataPtr + 2) == UBX_CLASS_MGA); // Check for class UBX-MGA
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
{
_debugSerial->println(F("pushAssistNowData: OK so far... (3)"));
_debugSerial->flush();
}
size_t packetLength = ((size_t)*(dataBytes + dataPtr + 4)) | (((size_t)*(dataBytes + dataPtr + 5)) << 8); // Extract the length
uint8_t checksumA = 0;
@@ -4262,7 +4245,7 @@ bool SFE_UBLOX_GNSS::setUTCTimeAssistance(uint16_t year, uint8_t month, uint8_t
}
// Return true if the one packet was pushed successfully
return (pushAssistNowData(true, iniTimeUTC, 32, mgaAck, maxWait) == 1);
return (pushAssistNowDataInternal(true, iniTimeUTC, 32, mgaAck, maxWait) == 1);
}
// Support for data logging