Skip to content

Commit 09506d0

Browse files
committed
fix(modem): Fixup the docs
1 parent 3a2acb4 commit 09506d0

File tree

20 files changed

+45
-879
lines changed

20 files changed

+45
-879
lines changed

.github/workflows/modem__build-host-tests.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,13 @@ jobs:
108108
steps:
109109
- name: Checkout esp-protocols
110110
uses: actions/checkout@v4
111+
- name: Compat check
111112
shell: bash
112113
run: |
113-
apt-get update -y
114-
apt-get install -y astyle
114+
sudo apt-get update -y
115+
sudo apt-get install -y astyle
115116
cd components/esp_modem
116117
find examples/ -type f -regex '.*/generate/.*\.\(hpp\|cpp\)' -exec ./scripts/generate.sh {} \;
117118
./scripts/generate.sh
119+
git diff --name-only
118120
git diff --quiet

components/esp_modem/command/include/cxx_include/esp_modem_command_library.hpp

-80
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@
1010
#include "cxx_include/esp_modem_dce_module.hpp"
1111
#include "cxx_include/esp_modem_types.hpp"
1212

13-
// --- ESP-MODEM command module starts here ---
1413
namespace esp_modem {
1514
namespace dce_commands {
16-
1715
/**
1816
* @defgroup ESP_MODEM_DCE_COMMAND ESP_MODEM DCE command library
1917
* @brief Library of the most useful DCE commands
2018
*/
2119
/** @addtogroup ESP_MODEM_DCE_COMMAND
2220
* @{
2321
*/
24-
2522
/**
2623
* @brief Generic AT command to be send with pass and fail phrases
2724
*
@@ -34,72 +31,32 @@ namespace dce_commands {
3431
command_result generic_command(CommandableIf *t, const std::string &command,
3532
const std::string &pass_phrase,
3633
const std::string &fail_phrase, uint32_t timeout_ms);
37-
3834
/**
3935
* @brief Declaration of all commands is generated from esp_modem_command_declare.inc
4036
*/
41-
42-
43-
//
44-
//#define INT_IN(name) int name
45-
//#ifdef __cplusplus
46-
//#define STRING_IN(name) const std::string& name
47-
//#define STRING_OUT(name) std::string& name
48-
//#define BOOL_IN(name) const bool name
49-
//#define BOOL_OUT(name) bool& name
50-
//#define INT_OUT(name) int& name
51-
//#define INTEGER_LIST_IN(name) const int* name
52-
//#define STRUCT_OUT(struct_name, name) struct_name& name
53-
//#else
54-
//#define STRING_IN(name) const char* name
55-
//#define STRING_OUT(name) char* name
56-
//#define BOOL_IN(name) const bool name
57-
//#define BOOL_OUT(name) bool* name
58-
//#define INT_OUT(name) int* name
59-
//#define INTEGER_LIST_IN(name) const int* name
60-
//#define STRUCT_OUT(struct_name, name) esp_modem_ ## struct_name ## _t* name
61-
//#endif
62-
//
63-
//#define FORWARD_INT_IN(name) name
64-
//#define FORWARD_STRING_IN(name) name
65-
//#define FORWARD_STRING_OUT(name) name
66-
//#define FORWARD_BOOL_IN(name) name
67-
//#define FORWARD_BOOL_OUT(name) name
68-
//#define FORWARD_INT_OUT(name) name
69-
//#define FORWARD_INTEGER_LIST_IN(name) name
70-
//#define FORWARD_STRUCT_OUT(struct_name, name) name
71-
72-
// Utility to count arguments (works for up to two parameters here)
73-
74-
75-
7637
/**
7738
* @brief Sends the initial AT sequence to sync up with the device
7839
* @return OK, FAIL or TIMEOUT
7940
*/
8041
command_result sync(CommandableIf *t );
81-
8242
/**
8343
* @brief Reads the operator name
8444
* @param[out] name operator name
8545
* @param[out] act access technology
8646
* @return OK, FAIL or TIMEOUT
8747
*/
8848
command_result get_operator_name(CommandableIf *t, std::string &name, int &act );
89-
9049
/**
9150
* @brief Stores current user profile
9251
* @return OK, FAIL or TIMEOUT
9352
*/
9453
command_result store_profile(CommandableIf *t );
95-
9654
/**
9755
* @brief Sets the supplied PIN code
9856
* @param[in] pin Pin
9957
* @return OK, FAIL or TIMEOUT
10058
*/
10159
command_result set_pin(CommandableIf *t, const std::string &pin );
102-
10360
/**
10461
* @brief Execute the supplied AT command in raw mode (doesn't append '\r' to command, returns everything)
10562
* @param[in] cmd String command that's send to DTE
@@ -110,7 +67,6 @@ command_result set_pin(CommandableIf *t, const std::string &pin );
11067
* @return OK, FAIL or TIMEOUT
11168
*/
11269
command_result at_raw(CommandableIf *t, const std::string &cmd, std::string &out, const std::string &pass, const std::string &fail, int timeout );
113-
11470
/**
11571
* @brief Execute the supplied AT command
11672
* @param[in] cmd AT command
@@ -119,116 +75,99 @@ command_result at_raw(CommandableIf *t, const std::string &cmd, std::string &out
11975
* @return OK, FAIL or TIMEOUT
12076
*/
12177
command_result at(CommandableIf *t, const std::string &cmd, std::string &out, int timeout );
122-
12378
/**
12479
* @brief Checks if the SIM needs a PIN
12580
* @param[out] pin_ok true if the SIM card doesn't need a PIN to unlock
12681
* @return OK, FAIL or TIMEOUT
12782
*/
12883
command_result read_pin(CommandableIf *t, bool &pin_ok );
129-
13084
/**
13185
* @brief Sets echo mode
13286
* @param[in] echo_on true if echo mode on (repeats the commands)
13387
* @return OK, FAIL or TIMEOUT
13488
*/
13589
command_result set_echo(CommandableIf *t, const bool echo_on );
136-
13790
/**
13891
* @brief Sets the Txt or Pdu mode for SMS (only txt is supported)
13992
* @param[in] txt true if txt mode
14093
* @return OK, FAIL or TIMEOUT
14194
*/
14295
command_result sms_txt_mode(CommandableIf *t, const bool txt );
143-
14496
/**
14597
* @brief Sets the default (GSM) character set
14698
* @return OK, FAIL or TIMEOUT
14799
*/
148100
command_result sms_character_set(CommandableIf *t );
149-
150101
/**
151102
* @brief Sends SMS message in txt mode
152103
* @param[in] number Phone number to send the message to
153104
* @param[in] message Text message to be sent
154105
* @return OK, FAIL or TIMEOUT
155106
*/
156107
command_result send_sms(CommandableIf *t, const std::string &number, const std::string &message );
157-
158108
/**
159109
* @brief Resumes data mode (Switches back to the data mode, which was temporarily suspended)
160110
* @return OK, FAIL or TIMEOUT
161111
*/
162112
command_result resume_data_mode(CommandableIf *t );
163-
164113
/**
165114
* @brief Sets php context
166115
* @param[in] p1 PdP context struct to setup modem cellular connection
167116
* @return OK, FAIL or TIMEOUT
168117
*/
169118
command_result set_pdp_context(CommandableIf *t, PdpContext &pdp );
170-
171119
/**
172120
* @brief Switches to the command mode
173121
* @return OK, FAIL or TIMEOUT
174122
*/
175123
command_result set_command_mode(CommandableIf *t );
176-
177124
/**
178125
* @brief Switches to the CMUX mode
179126
* @return OK, FAIL or TIMEOUT
180127
*/
181128
command_result set_cmux(CommandableIf *t );
182-
183129
/**
184130
* @brief Reads the IMSI number
185131
* @param[out] imsi Module's IMSI number
186132
* @return OK, FAIL or TIMEOUT
187133
*/
188134
command_result get_imsi(CommandableIf *t, std::string &imsi );
189-
190135
/**
191136
* @brief Reads the IMEI number
192137
* @param[out] imei Module's IMEI number
193138
* @return OK, FAIL or TIMEOUT
194139
*/
195140
command_result get_imei(CommandableIf *t, std::string &imei );
196-
197141
/**
198142
* @brief Reads the module name
199143
* @param[out] name module name
200144
* @return OK, FAIL or TIMEOUT
201145
*/
202146
command_result get_module_name(CommandableIf *t, std::string &name );
203-
204147
/**
205148
* @brief Sets the modem to data mode
206149
* @return OK, FAIL or TIMEOUT
207150
*/
208151
command_result set_data_mode(CommandableIf *t );
209-
210152
/**
211153
* @brief Get Signal quality
212154
* @param[out] rssi signal strength indication
213155
* @param[out] ber channel bit error rate
214156
* @return OK, FAIL or TIMEOUT
215157
*/
216158
command_result get_signal_quality(CommandableIf *t, int &rssi, int &ber );
217-
218159
/**
219160
* @brief Sets HW control flow
220161
* @param[in] dce_flow 0=none, 2=RTS hw flow control of DCE
221162
* @param[in] dte_flow 0=none, 2=CTS hw flow control of DTE
222163
* @return OK, FAIL or TIMEOUT
223164
*/
224165
command_result set_flow_control(CommandableIf *t, int dce_flow, int dte_flow );
225-
226166
/**
227167
* @brief Hangs up current data call
228168
* @return OK, FAIL or TIMEOUT
229169
*/
230170
command_result hang_up(CommandableIf *t );
231-
232171
/**
233172
* @brief Get voltage levels of modem power up circuitry
234173
* @param[out] voltage Current status in mV
@@ -237,26 +176,22 @@ command_result hang_up(CommandableIf *t );
237176
* @return OK, FAIL or TIMEOUT
238177
*/
239178
command_result get_battery_status(CommandableIf *t, int &voltage, int &bcs, int &bcl );
240-
241179
/**
242180
* @brief Power down the module
243181
* @return OK, FAIL or TIMEOUT
244182
*/
245183
command_result power_down(CommandableIf *t );
246-
247184
/**
248185
* @brief Reset the module
249186
* @return OK, FAIL or TIMEOUT
250187
*/
251188
command_result reset(CommandableIf *t );
252-
253189
/**
254190
* @brief Configures the baudrate
255191
* @param[in] baud Desired baud rate of the DTE
256192
* @return OK, FAIL or TIMEOUT
257193
*/
258194
command_result set_baud(CommandableIf *t, int baud );
259-
260195
/**
261196
* @brief Force an attempt to connect to a specific operator
262197
* @param[in] mode mode of attempt
@@ -273,49 +208,42 @@ command_result set_baud(CommandableIf *t, int baud );
273208
* @return OK, FAIL or TIMEOUT
274209
*/
275210
command_result set_operator(CommandableIf *t, int mode, int format, const std::string &oper );
276-
277211
/**
278212
* @brief Attach or detach from the GPRS service
279213
* @param[in] state 1-attach 0-detach
280214
* @return OK, FAIL or TIMEOUT
281215
*/
282216
command_result set_network_attachment_state(CommandableIf *t, int state );
283-
284217
/**
285218
* @brief Get network attachment state
286219
* @param[out] state 1-attached 0-detached
287220
* @return OK, FAIL or TIMEOUT
288221
*/
289222
command_result get_network_attachment_state(CommandableIf *t, int &state );
290-
291223
/**
292224
* @brief What mode the radio should be set to
293225
* @param[in] state state 1-full 0-minimum ...
294226
* @return OK, FAIL or TIMEOUT
295227
*/
296228
command_result set_radio_state(CommandableIf *t, int state );
297-
298229
/**
299230
* @brief Get current radio state
300231
* @param[out] state 1-full 0-minimum ...
301232
* @return OK, FAIL or TIMEOUT
302233
*/
303234
command_result get_radio_state(CommandableIf *t, int &state );
304-
305235
/**
306236
* @brief Set network mode
307237
* @param[in] mode preferred mode
308238
* @return OK, FAIL or TIMEOUT
309239
*/
310240
command_result set_network_mode(CommandableIf *t, int mode );
311-
312241
/**
313242
* @brief Preferred network mode (CAT-M and/or NB-IoT)
314243
* @param[in] mode preferred selection
315244
* @return OK, FAIL or TIMEOUT
316245
*/
317246
command_result set_preferred_mode(CommandableIf *t, int mode );
318-
319247
/**
320248
* @brief Set network bands for CAT-M or NB-IoT
321249
* @param[in] mode CAT-M or NB-IoT
@@ -324,30 +252,24 @@ command_result set_preferred_mode(CommandableIf *t, int mode );
324252
* @return OK, FAIL or TIMEOUT
325253
*/
326254
command_result set_network_bands(CommandableIf *t, const std::string &mode, const int *bands, int size );
327-
328255
/**
329256
* @brief Show network system mode
330257
* @param[out] mode current network mode
331258
* @return OK, FAIL or TIMEOUT
332259
*/
333260
command_result get_network_system_mode(CommandableIf *t, int &mode );
334-
335261
/**
336262
* @brief GNSS power control
337263
* @param[out] mode power mode (0 - off, 1 - on)
338264
* @return OK, FAIL or TIMEOUT
339265
*/
340266
command_result set_gnss_power_mode(CommandableIf *t, int mode );
341-
342267
/**
343268
* @brief GNSS power control
344269
* @param[out] mode power mode (0 - off, 1 - on)
345270
* @return OK, FAIL or TIMEOUT
346271
*/
347272
command_result get_gnss_power_mode(CommandableIf *t, int &mode );
348-
349-
350-
351273
/**
352274
* @brief Following commands that are different for some specific modules
353275
*/
@@ -359,10 +281,8 @@ command_result set_network_bands_sim76xx(CommandableIf *t, const std::string &mo
359281
command_result power_down_sim8xx(CommandableIf *t);
360282
command_result set_data_mode_alt(CommandableIf *t);
361283
command_result set_pdp_context(CommandableIf *t, PdpContext &pdp, uint32_t timeout_ms);
362-
363284
/**
364285
* @}
365286
*/
366-
367287
} // dce_commands
368288
} // esp_modem

0 commit comments

Comments
 (0)