You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Call isConnected up to three times - tests on the NEO-M8U show the CFG RATE poll occasionally being ignored
464
-
bool connected = isConnected();
464
+
bool connected = isConnected(maxWait);
465
465
466
466
if (!connected)
467
-
connected = isConnected();
467
+
{
468
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
469
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
470
+
{
471
+
_debugSerial->println(F("begin: isConnected - second attempt"));
472
+
}
473
+
#endif
474
+
connected = isConnected(maxWait);
475
+
}
468
476
469
477
if (!connected)
470
-
connected = isConnected();
478
+
{
479
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
480
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
481
+
{
482
+
_debugSerial->println(F("begin: isConnected - third attempt"));
483
+
}
484
+
#endif
485
+
connected = isConnected(maxWait);
486
+
}
487
+
488
+
if ((!connected ) && assumeSuccess) // Advanced users can assume success if required. Useful if the port is outputting messages at high navigation rate.
489
+
{
490
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
491
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
492
+
{
493
+
_debugSerial->println(F("begin: third attempt failed. Assuming success..."));
// Call isConnected up to three times - tests on the NEO-M8U show the CFG RATE poll occasionally being ignored
489
-
bool connected = isConnected();
516
+
bool connected = isConnected(maxWait);
490
517
491
518
if (!connected)
492
-
connected = isConnected();
519
+
{
520
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
521
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
522
+
{
523
+
_debugSerial->println(F("begin: isConnected - second attempt"));
524
+
}
525
+
#endif
526
+
connected = isConnected(maxWait);
527
+
}
493
528
494
529
if (!connected)
495
-
connected = isConnected();
530
+
{
531
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
532
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
533
+
{
534
+
_debugSerial->println(F("begin: isConnected - third attempt"));
535
+
}
536
+
#endif
537
+
connected = isConnected(maxWait);
538
+
}
539
+
540
+
if ((!connected ) && assumeSuccess) // Advanced users can assume success if required. Useful if the port is outputting messages at high navigation rate.
541
+
{
542
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
543
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
544
+
{
545
+
_debugSerial->println(F("begin: third attempt failed. Assuming success..."));
// Call isConnected up to three times - tests on the NEO-M8U show the CFG RATE poll occasionally being ignored
596
+
bool connected = isConnected(maxWait);
543
597
544
598
if (!connected)
545
-
connected = isConnected();
599
+
{
600
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
601
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
602
+
{
603
+
_debugSerial->println(F("begin: isConnected - second attempt"));
604
+
}
605
+
#endif
606
+
connected = isConnected(maxWait);
607
+
}
546
608
547
609
if (!connected)
548
-
connected = isConnected();
610
+
{
611
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
612
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
613
+
{
614
+
_debugSerial->println(F("begin: isConnected - third attempt"));
615
+
}
616
+
#endif
617
+
connected = isConnected(maxWait);
618
+
}
619
+
620
+
if ((!connected ) && assumeSuccess) // Advanced users can assume success if required. Useful if the port is outputting messages at high navigation rate.
621
+
{
622
+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
623
+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
624
+
{
625
+
_debugSerial->println(F("begin: third attempt failed. Assuming success..."));
Copy file name to clipboardExpand all lines: src/SparkFun_u-blox_GNSS_Arduino_Library.h
+11-9
Original file line number
Diff line number
Diff line change
@@ -598,12 +598,13 @@ class SFE_UBLOX_GNSS
598
598
//New in v2.0: allow the payload size for packetCfg to be changed
599
599
voidsetPacketCfgPayloadSize(size_t payloadSize); // Set packetCfgPayloadSize
600
600
601
+
//Begin communication with the GNSS. Advanced users can assume success if required. Useful if the port is already outputting messages at high navigation rate.
601
602
//By default use the default I2C address, and use Wire port
602
-
boolbegin(TwoWire &wirePort = Wire, uint8_t deviceAddress = 0x42); //Returns true if module is detected
voidhardReset(); //Perform a reset leading to a cold start (zero info start-up)
783
-
boolfactoryDefault(uint16_t maxWait = defaultMaxWait); //Reset module to factory defaults
784
+
voidsoftwareResetGNSSOnly(); //Controlled Software Reset (GNSS only) only restarts the GNSS tasks, without reinitializing the full system or reloading any stored configuration.
785
+
boolfactoryDefault(uint16_t maxWait = defaultMaxWait); //Reset module to factory defaults
uint32_tgetPositionAccuracy(uint16_t maxWait = 1100); //Returns the 3D accuracy of the current high-precision fix, in mm. Supported on NEO-M8P, ZED-F9P,
1240
+
uint32_tgetPositionAccuracy(uint16_t maxWait = defaultMaxWait); //Returns the 3D accuracy of the current high-precision fix, in mm. Supported on NEO-M8P, ZED-F9P,
1239
1241
1240
1242
// Helper functions for HPPOSLLH
1241
1243
@@ -1291,8 +1293,8 @@ class SFE_UBLOX_GNSS
1291
1293
1292
1294
// Helper functions for HNR
1293
1295
1294
-
boolsetHNRNavigationRate(uint8_t rate, uint16_t maxWait = 1100); // Returns true if the setHNRNavigationRate is successful
1295
-
uint8_tgetHNRNavigationRate(uint16_t maxWait = 1100); // Returns 0 if the getHNRNavigationRate fails
1296
+
boolsetHNRNavigationRate(uint8_t rate, uint16_t maxWait = defaultMaxWait); // Returns true if the setHNRNavigationRate is successful
1297
+
uint8_tgetHNRNavigationRate(uint16_t maxWait = defaultMaxWait); // Returns 0 if the getHNRNavigationRate fails
1296
1298
floatgetHNRroll(uint16_t maxWait = defaultMaxWait); // Returned as degrees
1297
1299
floatgetHNRpitch(uint16_t maxWait = defaultMaxWait); // Returned as degrees
1298
1300
floatgetHNRheading(uint16_t maxWait = defaultMaxWait); // Returned as degrees
0 commit comments