Skip to content

Commit 1dce5e7

Browse files
committed
FileUtils::begin(bool) handles opt MODEM::begin()
1 parent 7fc49f7 commit 1dce5e7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/GSMFileUtils.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@ GSMFileUtils::GSMFileUtils(bool debug)
99
{
1010
}
1111

12-
bool GSMFileUtils::begin(const unsigned long timeout)
12+
bool GSMFileUtils::begin(const bool restart)
1313
{
1414
int status;
1515

16+
if (restart)
1617
MODEM.begin();
1718

1819
if (_debug) {
1920
MODEM.debug();
2021
MODEM.send("AT+CMEE=2");
2122
MODEM.waitForResponse();
2223
}
23-
MODEM.send("AT+CMEE=2");
24-
MODEM.waitForResponse();
2524

26-
for (unsigned long start = millis(); (millis() - start) < timeout;) {
25+
for (unsigned long start = millis(); (millis() - start) < 10000;) {
2726
status = _getFileList();
2827
if (status == 1) {
2928
_countFiles();

src/GSMFileUtils.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ class GSMFileUtils {
77
public:
88
GSMFileUtils(bool debug = false);
99

10-
bool begin(const unsigned long timeout);
11-
bool begin() { return begin(10000); };
10+
bool begin(const bool restart);
11+
bool begin() { return begin(true); };
12+
1213
uint32_t fileCount() const { return _count; };
1314
size_t listFiles(String list[]) const;
1415
uint32_t listFile(const String filename) const;

0 commit comments

Comments
 (0)