Skip to content

Commit e7aedc6

Browse files
committed
Comment the most verbose debug prints. Correct sscanf for UUPSDA
1 parent 8fee7e3 commit e7aedc6

File tree

1 file changed

+55
-55
lines changed

1 file changed

+55
-55
lines changed

src/SparkFun_u-blox_SARA-R5_Arduino_Library.cpp

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ bool SARA_R5::processURCEvent(const char *event)
330330
scanNum = sscanf(event, "+UUPSDA: %d,\"%d.%d.%d.%d\"",
331331
&result, &remoteIPstore[0], &remoteIPstore[1], &remoteIPstore[2], &remoteIPstore[3]);
332332

333-
if (scanNum == 1)
333+
if (scanNum == 5)
334334
{
335335
if (_printDebug == true)
336336
_debugPort->println(F("processReadEvent: packet switched data action"));
@@ -3565,7 +3565,7 @@ SARA_R5_error_t SARA_R5::waitForResponse(const char *expectedResponse, const cha
35653565
bool found = false;
35663566
int responseIndex = 0, errorIndex = 0;
35673567
int backlogIndex = strlen(saraResponseBacklog);
3568-
bool printedSomething = false;
3568+
//bool printedSomething = false;
35693569

35703570
timeIn = millis();
35713571

@@ -3574,13 +3574,13 @@ SARA_R5_error_t SARA_R5::waitForResponse(const char *expectedResponse, const cha
35743574
if (hwAvailable() > 0) //hwAvailable can return -1 if the serial port is NULL
35753575
{
35763576
char c = readChar();
3577-
if (_printDebug == true)
3578-
{
3579-
if (printedSomething == false)
3580-
_debugPort->print(F("waitForResponse: "));
3581-
_debugPort->print(c);
3582-
printedSomething = true;
3583-
}
3577+
// if (_printDebug == true)
3578+
// {
3579+
// if (printedSomething == false)
3580+
// _debugPort->print(F("waitForResponse: "));
3581+
// _debugPort->print(c);
3582+
// printedSomething = true;
3583+
// }
35843584
if (c == expectedResponse[responseIndex])
35853585
{
35863586
if (++responseIndex == (int)strlen(expectedResponse))
@@ -3611,9 +3611,9 @@ SARA_R5_error_t SARA_R5::waitForResponse(const char *expectedResponse, const cha
36113611
}
36123612
}
36133613

3614-
if (_printDebug == true)
3615-
if (printedSomething)
3616-
_debugPort->println();
3614+
// if (_printDebug == true)
3615+
// if (printedSomething)
3616+
// _debugPort->println();
36173617

36183618
pruneBacklog(); // Prune any incoming non-actionable URC's and responses/errors from the backlog
36193619

@@ -3640,12 +3640,12 @@ SARA_R5_error_t SARA_R5::sendCommandWithResponse(
36403640
int index = 0;
36413641
int destIndex = 0;
36423642
unsigned int charsRead = 0;
3643-
bool printedSomething = false;
3643+
//bool printedSomething = false;
36443644

3645-
if (_printDebug == true)
3646-
_debugPort->print(F("sendCommandWithResponse: Command: "));
3647-
if (_printDebug == true)
3648-
_debugPort->println(String(command));
3645+
// if (_printDebug == true)
3646+
// _debugPort->print(F("sendCommandWithResponse: Command: "));
3647+
// if (_printDebug == true)
3648+
// _debugPort->println(String(command));
36493649

36503650
int backlogIndex = sendCommand(command, at); //Sending command needs to dump data to backlog buffer as well.
36513651
unsigned long timeIn = millis();
@@ -3655,13 +3655,13 @@ SARA_R5_error_t SARA_R5::sendCommandWithResponse(
36553655
if (hwAvailable() > 0) //hwAvailable can return -1 if the serial port is NULL
36563656
{
36573657
char c = readChar();
3658-
if (_printDebug == true)
3659-
{
3660-
if (printedSomething == false)
3661-
_debugPort->print(F("sendCommandWithResponse: Response: "));
3662-
_debugPort->print(c);
3663-
printedSomething = true;
3664-
}
3658+
// if (_printDebug == true)
3659+
// {
3660+
// if (printedSomething == false)
3661+
// _debugPort->print(F("sendCommandWithResponse: Response: "));
3662+
// _debugPort->print(c);
3663+
// printedSomething = true;
3664+
// }
36653665
if (responseDest != NULL)
36663666
{
36673667
responseDest[destIndex++] = c;
@@ -3686,9 +3686,9 @@ SARA_R5_error_t SARA_R5::sendCommandWithResponse(
36863686
}
36873687
}
36883688

3689-
if (_printDebug == true)
3690-
if (printedSomething)
3691-
_debugPort->println();
3689+
// if (_printDebug == true)
3690+
// if (printedSomething)
3691+
// _debugPort->println();
36923692

36933693
pruneBacklog(); // Prune any incoming non-actionable URC's and responses/errors from the backlog
36943694

@@ -4041,20 +4041,20 @@ void SARA_R5::pruneBacklog()
40414041
char pruneBuffer[RXBuffSize];
40424042
memset(pruneBuffer, 0, RXBuffSize); // Create a buffer to store the stuff we don't want to prune
40434043

4044-
if (strlen(saraResponseBacklog) > 0) //Handy for debugging new parsing.
4045-
{
4046-
if (_printDebug == true)
4047-
_debugPort->println(F("pruneBacklog: pruned backlog was:"));
4048-
if (_printDebug == true)
4049-
_debugPort->println(saraResponseBacklog);
4050-
if (_printDebug == true)
4051-
_debugPort->println(F("pruneBacklog: end of pruned backlog"));
4052-
}
4053-
else
4054-
{
4055-
if (_printDebug == true)
4056-
_debugPort->println(F("pruneBacklog: backlog was empty"));
4057-
}
4044+
// if (strlen(saraResponseBacklog) > 0) //Handy for debugging new parsing.
4045+
// {
4046+
// if (_printDebug == true)
4047+
// _debugPort->println(F("pruneBacklog: pruned backlog was:"));
4048+
// if (_printDebug == true)
4049+
// _debugPort->println(saraResponseBacklog);
4050+
// if (_printDebug == true)
4051+
// _debugPort->println(F("pruneBacklog: end of pruned backlog"));
4052+
// }
4053+
// else
4054+
// {
4055+
// if (_printDebug == true)
4056+
// _debugPort->println(F("pruneBacklog: backlog was empty"));
4057+
// }
40584058

40594059
event = strtok(saraResponseBacklog, "\r\n"); // Look for an 'event' - something ending in \r\n
40604060

@@ -4081,20 +4081,20 @@ void SARA_R5::pruneBacklog()
40814081
memset(saraResponseBacklog, 0, RXBuffSize); //Clear out backlog buffer.
40824082
strcpy(saraResponseBacklog, pruneBuffer); //Copy the stuff we didn't prune into the backlog
40834083

4084-
if (strlen(saraResponseBacklog) > 0) //Handy for debugging new parsing.
4085-
{
4086-
if (_printDebug == true)
4087-
_debugPort->println(F("pruneBacklog: pruned backlog is now:"));
4088-
if (_printDebug == true)
4089-
_debugPort->println(saraResponseBacklog);
4090-
if (_printDebug == true)
4091-
_debugPort->println(F("pruneBacklog: end of pruned backlog"));
4092-
}
4093-
else
4094-
{
4095-
if (_printDebug == true)
4096-
_debugPort->println(F("pruneBacklog: backlog is now empty"));
4097-
}
4084+
// if (strlen(saraResponseBacklog) > 0) //Handy for debugging new parsing.
4085+
// {
4086+
// if (_printDebug == true)
4087+
// _debugPort->println(F("pruneBacklog: pruned backlog is now:"));
4088+
// if (_printDebug == true)
4089+
// _debugPort->println(saraResponseBacklog);
4090+
// if (_printDebug == true)
4091+
// _debugPort->println(F("pruneBacklog: end of pruned backlog"));
4092+
// }
4093+
// else
4094+
// {
4095+
// if (_printDebug == true)
4096+
// _debugPort->println(F("pruneBacklog: backlog is now empty"));
4097+
// }
40984098

40994099
free(event);
41004100
}

0 commit comments

Comments
 (0)