Skip to content

Commit 8691251

Browse files
committed
Add waitForNetworkTimeout constexpr
1 parent d1c9d4a commit 8691251

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: src/ArduinoCellular.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ bool ArduinoCellular::awaitNetworkRegistration(){
217217
if(this->debugStream != nullptr){
218218
this->debugStream->println("Waiting for network registration...");
219219
}
220-
while (!modem.waitForNetwork(20000L)) {
220+
while (!modem.waitForNetwork(waitForNetworkTimeout)) {
221221
if(this->debugStream != nullptr){
222222
this->debugStream->print(".");
223223
}

Diff for: src/ArduinoCellular.h

+2
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ class ArduinoCellular {
277277
Stream* debugStream = nullptr; /**< The stream to be used for printing debugging messages. */
278278

279279
static unsigned long getTime(); /** Callback for getting the current time as an unix timestamp. */
280+
281+
static constexpr unsigned long waitForNetworkTimeout = 20000L; /**< Maximum wait time for network registration (In milliseconds). */
280282
};
281283

282284

0 commit comments

Comments
 (0)