21
21
#include " ATCmdParser.h"
22
22
#include " mbed_poll.h"
23
23
#include " mbed_debug.h"
24
+ #include < stdio.h>
25
+ #include < stdlib.h>
26
+ #include < string.h>
24
27
25
28
#ifdef LF
26
29
#undef LF
@@ -102,7 +105,7 @@ int ATCmdParser::read(char *data, int size)
102
105
103
106
104
107
// printf/scanf handling
105
- int ATCmdParser::vprintf (const char *format, va_list args)
108
+ int ATCmdParser::vprintf (const char *format, std:: va_list args)
106
109
{
107
110
108
111
if (vsprintf (_buffer, format, args) < 0 ) {
@@ -118,7 +121,7 @@ int ATCmdParser::vprintf(const char *format, va_list args)
118
121
return i;
119
122
}
120
123
121
- int ATCmdParser::vscanf (const char *format, va_list args)
124
+ int ATCmdParser::vscanf (const char *format, std:: va_list args)
122
125
{
123
126
// Since format is const, we need to copy it into our buffer to
124
127
// add the line's null terminator and clobber value-matches with asterisks.
@@ -181,7 +184,7 @@ int ATCmdParser::vscanf(const char *format, va_list args)
181
184
182
185
183
186
// Command parsing with line handling
184
- bool ATCmdParser::vsend (const char *command, va_list args)
187
+ bool ATCmdParser::vsend (const char *command, std:: va_list args)
185
188
{
186
189
// Create and send command
187
190
if (vsprintf (_buffer, command, args) < 0 ) {
@@ -205,7 +208,7 @@ bool ATCmdParser::vsend(const char *command, va_list args)
205
208
return true ;
206
209
}
207
210
208
- bool ATCmdParser::vrecv (const char *response, va_list args)
211
+ bool ATCmdParser::vrecv (const char *response, std:: va_list args)
209
212
{
210
213
restart:
211
214
_aborted = false ;
@@ -331,7 +334,7 @@ bool ATCmdParser::vrecv(const char *response, va_list args)
331
334
// Mapping to vararg functions
332
335
int ATCmdParser::printf (const char *format, ...)
333
336
{
334
- va_list args;
337
+ std:: va_list args;
335
338
va_start (args, format);
336
339
int res = vprintf (format, args);
337
340
va_end (args);
@@ -340,7 +343,7 @@ int ATCmdParser::printf(const char *format, ...)
340
343
341
344
int ATCmdParser::scanf (const char *format, ...)
342
345
{
343
- va_list args;
346
+ std:: va_list args;
344
347
va_start (args, format);
345
348
int res = vscanf (format, args);
346
349
va_end (args);
@@ -349,7 +352,7 @@ int ATCmdParser::scanf(const char *format, ...)
349
352
350
353
bool ATCmdParser::send (const char *command, ...)
351
354
{
352
- va_list args;
355
+ std:: va_list args;
353
356
va_start (args, command);
354
357
bool res = vsend (command, args);
355
358
va_end (args);
@@ -358,7 +361,7 @@ bool ATCmdParser::send(const char *command, ...)
358
361
359
362
bool ATCmdParser::recv (const char *response, ...)
360
363
{
361
- va_list args;
364
+ std:: va_list args;
362
365
va_start (args, response);
363
366
bool res = vrecv (response, args);
364
367
va_end (args);
0 commit comments