Skip to content

Commit 317faf8

Browse files
fix(modem): fixed minor code mistakes.
1 parent b97dfc0 commit 317faf8

File tree

8 files changed

+123
-123
lines changed

8 files changed

+123
-123
lines changed

.pre-commit-config.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.3.0
5+
rev: v5.0.0
66
hooks:
77
- id: check-yaml
88
- id: check-added-large-files
@@ -13,12 +13,12 @@ repos:
1313
- id: mixed-line-ending
1414
- id: debug-statements
1515
- repo: https://github.com/pycqa/flake8
16-
rev: 5.0.4
16+
rev: 7.1.2
1717
hooks:
1818
- id: flake8
1919
args: ['--config=.flake8', '--tee', '--benchmark']
2020
- repo: https://github.com/pre-commit/mirrors-mypy
21-
rev: v0.981
21+
rev: v1.14.1
2222
hooks:
2323
- id: mypy
2424
exclude: >
@@ -39,25 +39,25 @@ repos:
3939
hooks:
4040
- id: isort
4141
- repo: https://github.com/myint/eradicate/
42-
rev: v2.1.0
42+
rev: 2.3.0
4343
hooks:
4444
- id: eradicate
4545
- repo: https://github.com/espressif/check-copyright/
46-
rev: v1.0.3
46+
rev: v1.1.0
4747
hooks:
4848
- id: check-copyright
4949
args: ['--ignore', 'ci/check_copyright_ignore.txt', '--config', 'ci/check_copyright_config.yaml']
5050
- repo: https://github.com/igrr/astyle_py.git
51-
rev: v1.0.5
51+
rev: v1.1.0
5252
hooks:
5353
- id: astyle_py
5454
args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper', '--unpad-paren', '--max-continuation-indent=120', '--exclude-list=ci/ignore_astyle.txt']
5555
- repo: https://github.com/commitizen-tools/commitizen
56-
rev: v2.42.1
56+
rev: v4.4.1
5757
hooks:
5858
- id: commitizen
5959
- id: commitizen-branch
60-
stages: [push, manual]
60+
stages: [pre-push, manual]
6161
- repo: local
6262
hooks:
6363
- id: commit message scopes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include <string>
7+
#include <list>
8+
#include "esp_log.h"
9+
#include "cxx_include/esp_modem_dte.hpp"
10+
#include "cxx_include/esp_modem_dce_module.hpp"
11+
12+
static const char *TAG = "command_lib";
13+
14+
namespace esp_modem::dce_commands {
15+
command_result generic_command(CommandableIf *t, const std::string &command,
16+
const std::list<std::string_view> &pass_phrase,
17+
const std::list<std::string_view> &fail_phrase,
18+
uint32_t timeout_ms);
19+
}

components/esp_modem/include/cxx_include/esp_modem_dce_module.hpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -115,7 +115,7 @@ class GenericModule: public ModuleIf {
115115
#define ESP_MODEM_DECLARE_DCE_COMMAND(name, return_type, num, ...) \
116116
virtual return_type name(__VA_ARGS__);
117117

118-
DECLARE_ALL_COMMAND_APIS(virtual return_type name(...); )
118+
DECLARE_ALL_COMMAND_APIS(virtual return_type name(...);)
119119

120120
#undef ESP_MODEM_DECLARE_DCE_COMMAND
121121

@@ -177,8 +177,7 @@ class BG96: public GenericModule {
177177
command_result set_pdp_context(PdpContext &pdp) override;
178178
};
179179

180-
class SQNGM02S : public GenericModule
181-
{
180+
class SQNGM02S : public GenericModule {
182181
using GenericModule::GenericModule;
183182

184183
public:

components/esp_modem/include/esp_private/c_api_wrapper.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ inline dce_factory::ModemType convert_modem_enum(esp_modem_dce_device_t module)
4343
return esp_modem::dce_factory::ModemType::BG96;
4444
case ESP_MODEM_DCE_SIM800:
4545
return esp_modem::dce_factory::ModemType::SIM800;
46+
case ESP_MODEM_DCE_SQNGM02S:
47+
return esp_modem::dce_factory::ModemType::SQNGM02S;
4648
default:
4749
case ESP_MODEM_DCE_GENERIC:
4850
return esp_modem::dce_factory::ModemType::GenericModule;

components/esp_modem/include/generate/esp_modem_command_declare.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ ESP_MODEM_DECLARE_DCE_COMMAND(config_mobile_termination_error, command_result, 1
352352
* @param[in] edrx_value nible string containing encoded eDRX time
353353
* @param[in] ptw_value nible string containing encoded Paging Time Window
354354
*/ \
355-
ESP_MODEM_DECLARE_DCE_COMMAND(config_edrx, command_result, 3, INT_IN(p1, mode), INT_IN(p2, access_technology), STRING_IN(p3, edrx_value), STRING_IN(p4, ptw_value)) \
355+
ESP_MODEM_DECLARE_DCE_COMMAND(config_edrx, command_result, 3, INT_IN(p1, mode), INT_IN(p2, access_technology), STRING_IN(p3, edrx_value)) \
356356

357357
#ifdef GENERATE_DOCS
358358
// cat ../include/generate/esp_modem_command_declare.inc | clang++ -E -P -CC -xc++ -I../include -DGENERATE_DOCS - | sed -n '1,/DCE command documentation/!p'

components/esp_modem/src/esp_modem_c_api.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ extern "C" esp_err_t esp_modem_config_mobile_termination_error(esp_modem_dce_t *
486486
return command_response_to_esp_err(dce_wrap->dce->config_mobile_termination_error(mode));
487487
}
488488

489-
extern "C" esp_err_t esp_modem_config_edrx(esp_modem_dce_t *dce, int mode, int access_technology, const char *edrx_value, const char *ptw_value)
489+
extern "C" esp_err_t esp_modem_config_edrx(esp_modem_dce_t *dce_wrap, int mode, int access_technology, const char *edrx_value, const char *ptw_value)
490490
{
491491
if (dce_wrap == nullptr || dce_wrap->dce == nullptr || mode > 3 || access_technology > 5) {
492492
return ESP_ERR_INVALID_ARG;

0 commit comments

Comments
 (0)