6 years, 10 months ago.

the new class ATCmdParser,How to make an instance?

The demo given in ATCmdParser.h is:

  ATCmdParser at = ATCmdParser(serial, "\r\n");
  int value;
  char buffer[100];
 
  at.send("AT") && at.recv("OK");
  at.send("AT+CWMODE=%d", 3) && at.recv("OK");
  at.send("AT+CWMODE?") && at.recv("+CWMODE:%d\r\nOK", &value);
  at.recv("+IPD,%d:", &value);
  at.read(buffer, value);
  at.recv("OK");	

but "serial" defined as what type , there isn't a description. when I attempt to use Serial、UARTSerial, compile failed: main.cpp(5): error: #289: no instance of constructor "mbed::ATCmdParser::ATCmdParser" matches the argument list argument types are: (mbed::Serial, const char [3]) Any of gentlman can help me?

1 Answer

6 years, 9 months ago.

Hello,

It looks like you need to use a pointer to UARTSerial - https://github.com/ARMmbed/mbed-os/blob/master/platform/ATCmdParser.h#L84.

Please see this PR for an updated example that makes this more clear.

Accepted Answer

thanks a lot, my goddess.

posted by jerry liu 12 Jul 2017