55 Commits

Author SHA1 Message Date
David Cermak
858f85706d feat(modem): Support esp-modem use without PPP
Closes https://github.com/espressif/esp-protocols/issues/851
2025-08-14 17:29:50 +02:00
David Cermak
e2fa11103c fix(modem): Use generated AT command definitions for IDE navigation
BREAKING CHANGE: inc headers for AT command definitions are no longer used directly, but pregenerated into *.h(pp)
2025-04-04 15:39:39 +02:00
robbedptechnics
317faf89ff fix(modem): fixed minor code mistakes. 2025-03-25 11:27:14 +01:00
robbedptechnics
8560f02191 feat(module): add support for sequans GM02S modem 2025-03-19 14:45:32 +01:00
David Cermak
18f196fa1e feat(modem): Add mode detection to the example 2024-12-06 09:48:00 +01:00
David Cermak
247f1681e8 feat(modem): Add support for pausing netif
Closes https://github.com/espressif/esp-protocols/issues/699
2024-12-05 20:16:41 +01:00
David Cermak
8b6ea3311a fix(modem): Refine mode switch data->command
* netif.stop() moved after setting the transition callback
* send PPP escape sequence if enabled before waiting for transition to
complete
* add newline character before sync() command (after the "+++")

Closes https://github.com/espressif/esp-protocols/issues/692
2024-12-04 14:39:01 +01:00
David Cermak
52598e5f03 feat(modem): Add support for guessing mode 2024-11-01 13:49:52 +01:00
David Cermak
1b6a3b3b75 feat(modem): Add support for handling URC
Closes https://github.com/espressif/esp-protocols/issues/180
2024-09-16 15:17:29 +02:00
David Cermak
70fa3af771 fix(modem): Fixed clang-tidy warnings
* private field 'netif' is not used [clang-diagnostic-unused-private-field]
* private field 'instance' is not used [clang-diagnostic-unused-private-field]
* Call to virtual method 'FdTerminal::stop' during destruction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]
* unused variable 'TAG' [clang-diagnostic-unused-const-variable]
* Null pointer passed as 2nd argument to memory copy function [clang-analyzer-unix.cstring.NullArg]
* Array access (from variable 'data') results in a null pointer dereference [clang-analyzer-core.NullDereference]
2024-06-07 12:43:23 +02:00
David Cermak
741d166034 fix(modem): Fixed AT commands to copy strings to prevent overrides
Previously we used std::string_view, which pointed to the lower-layers
buffer which might have been reused for other asynchronous operations
before processing it, thus causing corruption of replies.

Closes https://github.com/espressif/esp-protocols/issues/463
2024-01-16 09:51:51 +01:00
David Cermak
0998f3dd4f fix(modem): Fixed incorrect dial command format
ATD command is used to switch generic device to the data mode
by dialing GPRS_SRC. The generic version of the command was incorrect
`ATD*99##` (containing extra trailing # char, which is accepted by most
devices). Command has been fixed, but the extra #'s been kept for devices
that we cannot test (to be fixed in IDFGH-9470).

Closes https://github.com/espressif/esp-protocols/issues/433
2024-01-09 12:48:16 +01:00
David Cermak
1d80cbc179 fix(modem): Fixed set_pdp_context() command timeout
Closes https://github.com/espressif/esp-protocols/issues/455
2023-12-19 16:43:59 +01:00
David Cermak
020b407472 fix(modem): Fixed API docs within doxygen comments 2023-11-02 15:46:38 +01:00
David Cermak
0254d50128 fix(modem): Support for custom modules with C-API
MAJOR CHANGE: Added support for implementing user defined modules in standard C-API
2023-11-02 13:35:07 +01:00
David Cermak
8edbac6974 fix(modem): More error handling in cmux protocol
Add error path to all CMUX protocol potential issues, checks for
consistency and add recovery.
2023-09-22 08:39:31 +02:00
David Cermak
4cf9e505e1 feat(modem): Add factory method for simple creation of custom DCEs
This allows calling directly:
auto dce = dce_factory::Factory::create_unique_dce_from<SIM7600>(&dce_config, uart_dte, esp_netif);
instead of:
auto dce = create_SIM7600_dce(&dce_config, uart_dte, esp_netif);
Which is very useful when adding a custom module, so we won't need to
update factory layers and add the new device to enums, etc.
To add a new module, you just:
1) Define the module class NewModule: public GenericModule { };
2) Implement the specific commands:
command_result do_work_new_module(CommandableIf *t, params) {}
3) Connect 1) and 2)
command_result NewModule::do_work_new_module(params...)
{
    return dce_commands::do_work_new_module(dte.get(), params...);
}
2023-08-28 10:27:16 +02:00
David Cermak
c8c05075fb fix(modem): Fix netif data race causing PPP startup delays
Removes PPP_started signal on reception, since lwip handles data
reception if the netif is up/down (which we correctly set in start()
stop() methods)

Closes https://github.com/espressif/esp-protocols/issues/308
2023-08-28 10:27:16 +02:00
David Cermak
cb6e03ac62 fix(modem): Added support for inflatable buffer
As a configurable option, if disabled we report an error.

Closes https://github.com/espressif/esp-protocols/issues/272
2023-08-28 10:27:10 +02:00
Victor
60c87ddf26 fix(modem): Fix LoadProhibited after failed CMUX initialization (IDFGH-10845) 2023-08-18 12:44:37 +03:00
David Cermak
bf114d3624 feat(modem): DTE to support sending and receiving raw data
MAJOR CHANGE: Enable DTE to redefine on_read() and write(cmd) directly
2023-03-16 19:39:13 +01:00
Tomas Rezucha
01c26c82fa esp_modem: Dual DTE support
Modems can expose 2 terminals, which can be used simultaneously.
One for AT commands, the other one for data.
2023-03-07 13:35:34 +01:00
David Cermak
2180ab17d8 fix(esp-modem): Support AT with callback in C-API
Closes https://github.com/espressif/esp-protocols/issues/143
2022-11-21 14:58:15 +01:00
David Cermak
ac5d43882b feat(esp-modem): Add support for manual CMUX operations
Closes https://github.com/espressif/esp-protocols/issues/168
2022-11-21 14:58:15 +01:00
David Cermak
65c0e0e195 fix(esp_modem): Cleanup custom lib-commands and factory 2022-10-20 16:11:19 +02:00
Franz Höpfinger
652314e73d fix(esp_modem) Add example that reads GNSS info 2022-10-17 20:30:55 +02:00
Suren Gabrielyan
945bd17701 CI: fixing the files to be complient with pre-commit hooks 2022-10-17 18:16:52 +02:00
David Cermak
a02bf05eed fix(esp-modem): Uart Terminal read_cb race 2022-10-10 15:39:09 +02:00
Tomas Rezucha
ae8479c77e esp_modem: Expose set_error_cb method 2022-09-02 09:17:49 +02:00
David Cermak
89e1bd27b3 fix(esp-modem): Add filename/line info to exception message
This is useful if exceptions are enabled, but caught internally on C++ API boundary
2022-08-18 14:52:21 +02:00
David Cermak
a286634359 feat(esp_modem): Add optional ACT to operator-name
Closes https://github.com/espressif/esp-protocols/issues/80
2022-07-13 09:56:29 +02:00
David Cermak
66e6d4cbf8 fix(esp_modem): Implement movable unique_buffer to bundle data, size, ptr
Also improves and fixes tests
2022-06-18 12:19:07 +02:00
David Cermak
f3ff98bb82 fix(exp_modem): DTE should own both command and data terminal
reworks to clear shared_ptr<> of both command and data terminals
and having DTE own it. When we swith to CMUX mode the ownership is transfered to CMux terminal
2022-06-11 21:33:51 +02:00
David Cermak
58a0b57e12 fix(esp_modem): Update CMUX example to use CMUX mode automatically 2022-06-11 21:29:25 +02:00
David Cermak
a16aab6979 feat(esp_modem): Add support to CMUX exit
Closes https://github.com/espressif/esp-protocols/issues/37
2022-06-11 15:07:39 +02:00
David Cermak
1e0aefd72a fix(esp-modem): Improve PPP exit sequence
* Implement retry mechanism if escape PPP mode failed
* Stop networking and checking for NO-CARRIER manually on PPP exit

Closes https://github.com/espressif/esp-protocols/issues/47
2022-06-11 15:07:39 +02:00
Sjur G. Wroldsen
15ed885035 Add: Sim7600 extended support 2022-04-19 16:23:22 +02:00
Sjur G. Wroldsen
0733ea8ff4 Add: Support for SIM7000 modules 2022-04-13 15:36:15 +02:00
Sjur G. Wroldsen
15cbc9bd50 Update: modem_mode::UNDEF initially 2022-04-13 13:44:11 +02:00
Sjur G. Wroldsen
bb7f198bea Add: sim7070 support 2022-04-13 13:42:57 +02:00
Vladimir Chistyakov
face03e4e5 fix: add virtual destructors to ModuleIf and CommandableIf 2022-01-28 22:34:03 +07:00
David Cermak
8417e232aa fix(esp_modem): Read module name with AT commands
This fixes basic IDF test case which supplied dummy module name.
2021-11-25 16:24:52 +01:00
Sudeep Mohanty
5d9ad9cffd esp_modem: Update FreeRTOS EventQueueHandle_t forward declaration
This commit includes freertos/event_groups.h header and removes the
forward declaration for EventGroupHandle_t.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2021-11-18 16:24:35 +05:30
David Cermak
5299b425e8 esp_modem: Add missing AT commands to plain C-API 2021-11-16 08:03:30 +01:00
Sudeep Mohanty
58887170d2 esp_modem: Update Task handle and Event Group handle to match freertos v10.4.3
This commit updates the default handles for Task type and Signal Group
type to match the struct type handle from freertos v10.4.3.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2021-11-08 10:46:53 +05:30
David Cermak
c1b1330680 esp_modem(Docs): Minor correction of the docs 2021-10-04 11:32:55 +02:00
David Cermak
fb6029b66c CMUX: Refactor the protocol decoder to multiple methods per cmux state 2021-10-04 11:32:55 +02:00
David Cermak
6e34954677 Factory: Rename Builder class to Creator, since it's not 100% builder pattern 2021-10-04 11:32:55 +02:00
David Čermák
148a9300a4 esp_modem: Formal updates per code review 2021-10-04 11:32:55 +02:00
David Cermak
a61e9e2d40 Applied astyle code formatting 2021-10-04 11:32:55 +02:00