ESP8266 Developer Zone The Official ESP8266 Forum 2015-07-28T12:57:41+08:00 https://bbs.espressif.com:443/feed.php?f=61&t=837 2015-07-28T12:57:41+08:00 2015-07-28T12:57:41+08:00 https://bbs.espressif.com:443/viewtopic.php?t=837&p=2890#p2890 <![CDATA[Q: How do I define my own functions in the AT+ commands? How do I pass parameters between them?]]> Q: How do I define my own functions in the AT+ commands? How do I pass parameters between them?
In the example of \ESP8266_NONOS_SDK\examples\at\user\user_main.c, ways are delivered on how to implement a self-defined AT Command, "AT+TEST".
The structure, at_funcationType, is used to define four types of a command, e.g., "AT+TEST".
  • "at_testCmd" is a testing command and it’s formatted as AT+TEST=?. In the example of AT, the registered callback is "at_testCmdTest"; the testing demand could be designed as the value range of the return parameter. If registered as NULL, there will be no testing command.
  • "at_queryCmd" is a query command and it’s formatted as AT+TEST?.In the example of AT, the registered callback is "at_queryCmdTest"; the query command could be designed as returning the current value. If registered as NULL, there will be no query command.
  • "at_setupCmd" is a setup command and it’s formatted as AT+TEST=parameter1,parameter2,........ In the example of AT, the registered callback is "at_setupCmdTest"; the setup command could be designed as the value of the parameter; if registered as NULL, there will be no setup command.
  • "at_exeCmd" is an execution command and it’s formatted as AT+TEST. In the example of AT, the registered callback is "at_exeCmdTest"; if registered as NULL, there will be no execution command.

Statistics: Posted by Guest — Tue Jul 28, 2015 12:57 pm


]]>