mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-22 23:07:28 +02:00
feat(modem): Added support for at_raw() command
at_raw() sends raw string and supports custom pass/fail phrases for the API to return OK/FAIL. It also returns raw, unprocessed string as output. This allows sending custom requests, such as: * dce->at_raw("", resp, "RDY", "...", 20000) -- waiting for reset * esp_modem_at_raw(dce, "+++", resp, "DISCONNECTED", "ERROR", 5000) -- exits PPP mode Closes https://github.com/espressif/esp-protocols/issues/471 Partially addresses https://github.com/espressif/esp-protocols/issues/468
This commit is contained in:
@ -44,6 +44,18 @@ ESP_MODEM_DECLARE_DCE_COMMAND(store_profile, command_result, 0) \
|
||||
*/\
|
||||
ESP_MODEM_DECLARE_DCE_COMMAND(set_pin, command_result, 1, STRING_IN(p1, pin)) \
|
||||
\
|
||||
/**
|
||||
* @brief Execute the supplied AT command in raw mode (doesn't append '\r' to command, returns everything)
|
||||
* @param[in] cmd String command that's send to DTE
|
||||
* @param[out] out Raw output from DTE
|
||||
* @param[in] pass Pattern in response for the API to return OK
|
||||
* @param[in] fail Pattern in response for the API to return FAIL
|
||||
* @param[in] cmd String command that's send to DTE
|
||||
* @param[in] timeout AT command timeout in milliseconds
|
||||
* @return OK, FAIL or TIMEOUT
|
||||
*/\
|
||||
ESP_MODEM_DECLARE_DCE_COMMAND(at_raw, command_result, 5, STRING_IN(p1, cmd), STRING_OUT(p2, out), STRING_IN(p3, pass), STRING_IN(p4, fail), INT_IN(p5, timeout)) \
|
||||
\
|
||||
/**
|
||||
* @brief Execute the supplied AT command
|
||||
* @param[in] cmd AT command
|
||||
|
Reference in New Issue
Block a user