Skip to content

Commit 14bbb61

Browse files
committed
Add maxWaitMs overrides to set/get Port info
1 parent dfe859a commit 14bbb61

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/SparkFun_LG290P_GNSS.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,27 +449,27 @@ bool LG290P::getMode(int &mode)
449449
return ret;
450450
}
451451

452-
bool LG290P::setPortBaudrate(int port, uint32_t newBaud)
452+
bool LG290P::setPortBaudrate(int port, uint32_t newBaud, uint16_t maxWaitMs)
453453
{
454454
char parms[50];
455455
snprintf(parms, sizeof parms, ",W,%d,%d", port, (int)newBaud);
456-
return sendOkCommand("PQTMCFGUART", parms);
456+
return sendOkCommand("PQTMCFGUART", parms, maxWaitMs);
457457
}
458458

459459
// Set baud rate on current port
460-
bool LG290P::setBaudrate(uint32_t newBaud)
460+
bool LG290P::setBaudrate(uint32_t newBaud, uint16_t maxWaitMs)
461461
{
462462
char parms[50];
463463
snprintf(parms, sizeof parms, ",W,%d", (int)newBaud);
464-
return sendOkCommand("PQTMCFGUART", parms);
464+
return sendOkCommand("PQTMCFGUART", parms, maxWaitMs);
465465
}
466466

467467
bool LG290P::getPortInfo(int port, uint32_t &newBaud, uint8_t &databits, uint8_t &parity, uint8_t &stop,
468-
uint8_t &flowControl)
468+
uint8_t &flowControl, uint16_t maxWaitMs)
469469
{
470470
char parms[50];
471471
snprintf(parms, sizeof parms, ",R,%d", port);
472-
bool ret = sendCommand("PQTMCFGUART", parms);
472+
bool ret = sendCommand("PQTMCFGUART", parms, maxWaitMs);
473473
if (ret)
474474
{
475475
auto packet = getCommandResponse();

src/SparkFun_LG290P_GNSS.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,14 @@ class LG290P
314314
* @param newBaud the new baud rate of the port
315315
* @return true if the new baud rate was set correctly
316316
*/
317-
bool setPortBaudrate(int port, uint32_t newBaud);
317+
bool setPortBaudrate(int port, uint32_t newBaud, uint16_t maxWaitMs = 1500);
318318

319319
/**
320320
* @brief Set the baud rate of the current port
321321
* @param newBaud the new baud rate of the port
322322
* @return true if the new baud rate was set correctly
323323
*/
324-
bool setBaudrate(uint32_t newBaud);
324+
bool setBaudrate(uint32_t newBaud, uint16_t maxWaitMs = 1500);
325325

326326
/**
327327
* @brief Get information about the designated UART
@@ -334,7 +334,7 @@ class LG290P
334334
* @return true if the port info was acquired without problem
335335
*/
336336
bool getPortInfo(int port, uint32_t &newBaud, uint8_t &dataBits, uint8_t &parity, uint8_t &stop,
337-
uint8_t &flowControl);
337+
uint8_t &flowControl, uint16_t maxWaitMs = 1500);
338338

339339
/**
340340
* @brief Enable or disable the protocols available for input on the specified port

0 commit comments

Comments
 (0)