Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@szerwi
Copy link
Contributor

@szerwi szerwi commented Nov 16, 2025

Description of Change

Current String PPPClass::cmd(const char *at_command, int timeout) function can return empty string in 3 cases:

  • when timeout occurs
  • when OK AT response is received
  • when ERROR AT response is received.

That is because esp_modem_at() from esp-modem does not return basic AT responses (OK/ERROR) as output strings, only as esp_err_t returned by a function.


This PR adds bool PPPClass::cmd(const char *at_command, String &response, int timeout); function and its bool PPPClass::cmd(String at_command, String &response, int timeout) variation.

These functions allow to return command response in more detailed way:

  • When PPP is not started or timeout occurs: Function returns false; response is empty (not touched)
  • When AT error response is received: Function returns false; response contains ERROR or detailed AT response
  • When AT success response is received: Function returns true; response contains OK or detailed AT response

Example output from the functions:

  • Success of AT+CFUN=1 returns true; response contains OK or AT+CFUN=1 if command echo is enabled
  • Success of AT+CFUN=4 returns true; response contains +PPPD: DISCONNECTED. Response is caused by SIM7600E sending +PPPD: DISCONNECTED before sending the OK response.
  • Success of AT+CPSI? returns true; response contains +CPSI: LTE,Online, [...]

Test Scenarios

Tested on arduino-esp32 v3.3.4; ESP32 DevKit; SIM7600E modem

Related links

Add variation of PPPClass::cmd() function that returns more detailed response.
@szerwi szerwi requested a review from me-no-dev as a code owner November 16, 2025 16:15
@github-actions
Copy link
Contributor

Messages
📖 🎉 Good Job! All checks are passing!

👋 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 ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 1899a0a

@github-actions
Copy link
Contributor

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.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32C5000.000.00000.000.00
ESP32P4000.000.00000.000.00
ESP32S30⚠️ +320.00⚠️ +0.01000.000.00
ESP32S20⚠️ +320.00⚠️ +0.01000.000.00
ESP32C3000.000.00000.000.00
ESP32C6000.000.00000.000.00
ESP32H2000.000.00000.000.00
ESP320⚠️ +320.00⚠️ +0.01000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32P4ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/PPP/examples/PPP_Basic0000⚠️ +320⚠️ +320000000⚠️ +320
libraries/PPP/examples/PPP_WIFI_BRIDGE0000⚠️ +320⚠️ +3200000--⚠️ +320

@github-actions
Copy link
Contributor

Test Results

 76 files   76 suites   15m 13s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit 1899a0a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant