File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -9,21 +9,20 @@ GSMFileUtils::GSMFileUtils(bool debug)
9
9
{
10
10
}
11
11
12
- bool GSMFileUtils::begin (const unsigned long timeout )
12
+ bool GSMFileUtils::begin (const bool restart )
13
13
{
14
14
int status;
15
15
16
+ if (restart)
16
17
MODEM.begin ();
17
18
18
19
if (_debug) {
19
20
MODEM.debug ();
20
21
MODEM.send (" AT+CMEE=2" );
21
22
MODEM.waitForResponse ();
22
23
}
23
- MODEM.send (" AT+CMEE=2" );
24
- MODEM.waitForResponse ();
25
24
26
- for (unsigned long start = millis (); (millis () - start) < timeout ;) {
25
+ for (unsigned long start = millis (); (millis () - start) < 10000 ;) {
27
26
status = _getFileList ();
28
27
if (status == 1 ) {
29
28
_countFiles ();
Original file line number Diff line number Diff line change @@ -7,8 +7,9 @@ class GSMFileUtils {
7
7
public:
8
8
GSMFileUtils (bool debug = false );
9
9
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
+
12
13
uint32_t fileCount () const { return _count; };
13
14
size_t listFiles (String list[]) const ;
14
15
uint32_t listFile (const String filename) const ;
You can’t perform that action at this time.
0 commit comments