-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Add variation of PPPClass::cmd() #12034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add variation of PPPClass::cmd() function that returns more detailed response.
👋 Hello szerwi, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Test Results 76 files 76 suites 16m 1s ⏱️ For more details on these failures, see this check. Results for commit 35de665. ♻️ This comment has been updated with latest results. |
|
Description of Change
Current
String PPPClass::cmd(const char *at_command, int timeout)function can return empty string in 3 cases:OKAT response is receivedERRORAT response is received.That is because
esp_modem_at()from esp-modem does not return basic AT responses (OK/ERROR) as output strings, only asesp_err_treturned by a function.This PR adds
bool PPPClass::cmd(const char *at_command, String &response, int timeout);function and itsbool PPPClass::cmd(String at_command, String &response, int timeout)variation.These functions allow to return command response in more detailed way:
responseis empty (not touched)responsecontainsERRORor detailed AT responseresponsecontainsOKor detailed AT responseExample output from the functions:
AT+CFUN=1returns true; response containsOKorAT+CFUN=1if command echo is enabledAT+CFUN=4returns true; response contains+PPPD: DISCONNECTED. Response is caused by SIM7600E sending+PPPD: DISCONNECTEDbefore sending theOKresponse.AT+CPSI?returns true; response contains+CPSI: LTE,Online, [...]Test Scenarios
Tested on arduino-esp32 v3.3.4; ESP32 DevKit; SIM7600E modem
Related links