Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit d97c4e0

Browse files
committed
Added maxWait for isConnected to avoid Serial begin problems
1 parent 48105d3 commit d97c4e0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/SparkFun_Ublox_Arduino_Library.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ void SFE_UBLOX_GPS::sendSerialCommand(ubxPacket outgoingUBX)
960960
}
961961

962962
//Returns true if I2C device ack's
963-
boolean SFE_UBLOX_GPS::isConnected()
963+
boolean SFE_UBLOX_GPS::isConnected(uint16_t maxWait)
964964
{
965965
if (commType == COMM_TYPE_I2C)
966966
{
@@ -975,7 +975,7 @@ boolean SFE_UBLOX_GPS::isConnected()
975975
packetCfg.len = 0;
976976
packetCfg.startingSpot = 0;
977977

978-
return sendCommand(packetCfg);
978+
return sendCommand(packetCfg, maxWait);
979979
}
980980
return false;
981981
}

src/SparkFun_Ublox_Arduino_Library.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,9 @@ class SFE_UBLOX_GPS
431431
//serialPort needs to be perviously initialized to correct baud rate
432432
boolean begin(Stream &serialPort); //Returns true if module is detected
433433

434-
boolean isConnected(); //Returns turn if device answers on _gpsI2Caddress address
434+
//Returns true if device answers on _gpsI2Caddress address or via Serial
435+
//maxWait is only used for Serial
436+
boolean isConnected(uint16_t maxWait = 1100);
435437

436438
boolean checkUblox(); //Checks module with user selected commType
437439
boolean checkUbloxI2C(); //Method for I2C polling of data, passing any new bytes to process()

0 commit comments

Comments
 (0)