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)
This commit is contained in:
David Cermak
2024-11-01 17:32:02 +01:00
parent d2e94e5db2
commit e2fa11103c
47 changed files with 4839 additions and 560 deletions

View File

@@ -815,22 +815,22 @@ WARN_LOGFILE =
# Note: If this tag is empty the current directory is searched.
INPUT = \
$(PROJECT_PATH)/../components/esp_modem/include/esp_modem_api.h \
$(PROJECT_PATH)/../components/esp_modem/command/include/esp_modem_api.h \
$(PROJECT_PATH)/../components/esp_modem/include/esp_modem_c_api_types.h \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_api.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/esp_modem_config.h \
$(PROJECT_PATH)/../components/esp_modem/include/esp_modem_dce_config.h \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_dce_factory.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_command_library.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_dce_module.hpp \
$(PROJECT_PATH)/../components/esp_modem/command/include/cxx_include/esp_modem_command_library.hpp \
$(PROJECT_PATH)/../components/esp_modem/command/include/cxx_include/esp_modem_dce_module.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_dte.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_netif.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_types.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_terminal.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_cmux.hpp \
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_dce.hpp \
$(PROJECT_PATH)/../docs/esp_modem/en/esp_modem_api_commands.h \
$(PROJECT_PATH)/../docs/esp_modem/en/esp_modem_dce.hpp
$(PROJECT_PATH)/../components/esp_modem/include/cxx_include/esp_modem_dce_template.hpp \
$(PROJECT_PATH)/../docs/esp_modem/command/dce.h \
$(PROJECT_PATH)/../docs/esp_modem/command/dce.hpp
# The last two are generated

View File

@@ -45,7 +45,7 @@ Note that the functions which implement AT commands returning textual values use
pointer as the return value. The API expects the output data to point to user allocated space of at least
``CONFIG_ESP_MODEM_C_API_STR_MAX`` (128 by default) bytes, it also truncates the output data to this size.
.. doxygenfile:: esp_modem_api_commands.h
.. doxygenfile:: dce.h
.. _api_config:

View File

@@ -33,7 +33,10 @@ Mode switching commands
Modem commands
--------------
.. include:: cxx_api_links.rst
.. include:: ../command/dce.rst
.. doxygenclass:: esp_modem::DCE
:members:
.. _cpp_destroy:

View File

@@ -0,0 +1,6 @@
// --- ESP-MODEM command module starts here ---
#include "esp_modem_command_declare_helper.inc"
#define ESP_MODEM_DECLARE_DCE_COMMAND(name, return_type, ...) return_type esp_modem_ ## name (ESP_MODEM_COMMAND_PARAMS(__VA_ARGS__));
#include "esp_modem_command_declare.inc"

View File

@@ -0,0 +1,16 @@
// --- ESP-MODEM command module starts here ---
class esp_modem::DCE : public DCE_T<GenericModule> {
public:
using DCE_T<GenericModule>::DCE_T;
#include "esp_modem_command_declare_helper.inc"
#define ESP_MODEM_DECLARE_DCE_COMMAND(name, return_type, ...) \
return_type name(ESP_MODEM_COMMAND_PARAMS(__VA_ARGS__));
#include "esp_modem_command_declare.inc"
#undef ESP_MODEM_DECLARE_DCE_COMMAND
};

View File

@@ -0,0 +1,7 @@
// --- ESP-MODEM command module starts here ---
#define ESP_MODEM_DECLARE_DCE_COMMAND(name, return_type, ...) \
* :cpp:func:`esp_modem::DCE::name`
#include "esp_modem_command_declare.inc"

View File

@@ -3,15 +3,14 @@
# Cleanup the generated html
rm -rf html docs
# Generate C++ API header of the DCE
cat ../../components/esp_modem/include/generate/esp_modem_command_declare.inc | clang++ -E -P -CC -xc++ -I../../components/esp_modem/include -DGENERATE_DOCS - | sed -n '1,/DCE command documentation/!p' > en/esp_modem_dce.hpp
pushd `pwd`
# Generate C API header of the modem_api.h
cat ../../components/esp_modem/include/generate/esp_modem_command_declare.inc | clang -E -P -CC -xc -I../../components/esp_modem/include -DGENERATE_DOCS - | sed -n '1,/DCE command documentation/!p' > en/esp_modem_api_commands.h
cd ../../components/esp_modem/scripts
./generate.sh ../../docs/esp_modem/generate/dce.rst
./generate.sh ../../docs/esp_modem/generate/dce.hpp
./generate.sh ../../docs/esp_modem/generate/dce.h
# RST with links to C++ API
cat ../../components/esp_modem/include/generate/esp_modem_command_declare.inc | clang -E -P -xc -I../../components/esp_modem/include -DGENERATE_DOCS -DGENERATE_RST_LINKS - | sed 's/NL/\n/g' > en/cxx_api_links.rst
popd
build-docs --target esp32 --language en