Skip to content

Commit 42aa528

Browse files
committed
Update documentation
1 parent 5612288 commit 42aa528

File tree

1 file changed

+68
-42
lines changed

1 file changed

+68
-42
lines changed

Diff for: docs/api.md

+68-42
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ This class provides methods to interact with the Arduino Pro Modem, such as conn
1818
--------------------------------|---------------------------------------------
1919
| [`ArduinoCellular`](#class_arduino_cellular_1a96d1d9f3fbe80adc3d460b4364d47870) | Default constructor. |
2020
| [`begin`](#class_arduino_cellular_1ad5ca7cf61f48c40569f41f3029d6516e) | Initializes the modem. |
21-
| [`connect`](#class_arduino_cellular_1a041c9d5c546b82858b01859383d11fb7) | Connects to the network using the specified APN, GPRS username, and GPRS password. |
21+
| [`unlockSIM`](#class_arduino_cellular_1aa0be2795ff7b23c39ecef90d9906bbdf) | Unlocks the SIM card using the specified PIN. |
22+
| [`connect`](#class_arduino_cellular_1a7fb3c3e841b39c4faacef32cec6277b4) | Registers with the cellular network and connects to the Internet if the APN, GPRS username, and GPRS password are provided. |
2223
| [`isConnectedToOperator`](#class_arduino_cellular_1af7453ef90702e9042e2b4b18fa89db03) | Checks if the modem is registered on the network. |
2324
| [`isConnectedToInternet`](#class_arduino_cellular_1a6f8251e06de1810897b8bd8f8fb1b1a2) | Checks if the GPRS network is connected. |
2425
| [`enableGPS`](#class_arduino_cellular_1abe77a53e0eba6e8d62ba5db3bb6f5e92) | Enables or disables the GPS module. |
2526
| [`getGPSLocation`](#class_arduino_cellular_1aee57a2eec5be06172b2fb7cd574d9106) | Gets the GPS location. (Blocking call) |
26-
| [`getCellularLocation`](#class_arduino_cellular_1ac94da4914e08cc549134e6fe5575b5a6) | Gets the cellular location. (Blocking call) |
2727
| [`getCellularTime`](#class_arduino_cellular_1a6b3ce5485badff582584d539e790aff4) | Gets the current time from the network. |
2828
| [`getGPSTime`](#class_arduino_cellular_1a4aeb898c958e6eb001d606f0c7da8799) | Gets the current time from the GPS module. |
2929
| [`sendSMS`](#class_arduino_cellular_1a371aef1318857f0863f443eaeabf4ac2) | Sends an [SMS](#class_s_m_s) message to the specified number. |
3030
| [`getReadSMS`](#class_arduino_cellular_1a5da65683df86af75590c7a68766236ee) | Gets the list of read [SMS](#class_s_m_s) messages. |
3131
| [`getUnreadSMS`](#class_arduino_cellular_1af1e3b2fad0a64f3b7675c88100ddbca5) | Gets the list of unread [SMS](#class_s_m_s) messages. |
32-
| [`sendATCommand`](#class_arduino_cellular_1a1d20e97f47d05d5420a98f79f213f978) | Sends an AT command to the modem and waits for a response, then returns the response. |
32+
| [`deleteSMS`](#class_arduino_cellular_1abe4337f0bc8c486a076011309120ace1) | Deletes an [SMS](#class_s_m_s) message at the specified index. |
33+
| [`sendATCommand`](#class_arduino_cellular_1a58a3e3713af0c01ad1075a2509c6874d) | Sends an AT command to the modem and waits for a response, then returns the response. |
3334
| [`getNetworkClient`](#class_arduino_cellular_1acff92474af3bd819b62f132cf12f45ba) | Gets the Network client. (OSI Layer 3) |
3435
| [`getSecureNetworkClient`](#class_arduino_cellular_1a8b7486d1a682787588c015af8d65a38e) | Gets the Transport Layer Security (TLS) client. (OSI Layer 4) |
3536
| [`getHTTPClient`](#class_arduino_cellular_1aa1b4c3bbd14984d2a7ed1db7fa1ac930) | Gets the HTTP client for the specified server and port. |
@@ -60,22 +61,35 @@ Initializes the modem.
6061

6162
<hr />
6263

63-
### `connect` <a id="class_arduino_cellular_1a041c9d5c546b82858b01859383d11fb7" class="anchor"></a>
64+
### `unlockSIM` <a id="class_arduino_cellular_1aa0be2795ff7b23c39ecef90d9906bbdf" class="anchor"></a>
6465

6566
```cpp
66-
bool connect(String apn, String gprsUser, String gprsPass, String pin)
67+
bool unlockSIM(String pin)
6768
```
6869
69-
Connects to the network using the specified APN, GPRS username, and GPRS password.
70+
Unlocks the SIM card using the specified PIN.
7071
7172
#### Parameters
72-
* `apn` The Access Point Name.
73+
* `pin` The SIM card PIN.
7374
74-
* `gprsUser` The GPRS username.
75+
#### Returns
76+
True if the SIM card is unlocked, false otherwise.
77+
<hr />
7578
76-
* `gprsPass` The GPRS password.
79+
### `connect` <a id="class_arduino_cellular_1a7fb3c3e841b39c4faacef32cec6277b4" class="anchor"></a>
7780
78-
* `pin` The SIM card PIN.
81+
```cpp
82+
bool connect(String apn, String username, String password)
83+
```
84+
85+
Registers with the cellular network and connects to the Internet if the APN, GPRS username, and GPRS password are provided.
86+
87+
#### Parameters
88+
* `apn` The Access Point Name.
89+
90+
* `username` The APN username.
91+
92+
* `password` The APN password.
7993

8094
#### Returns
8195
True if the connection is successful, false otherwise.
@@ -135,21 +149,6 @@ Gets the GPS location. (Blocking call)
135149
The GPS location. If the location is not retrieved, the latitude and longitude will be 0.0.
136150
<hr />
137151

138-
### `getCellularLocation` <a id="class_arduino_cellular_1ac94da4914e08cc549134e6fe5575b5a6" class="anchor"></a>
139-
140-
```cpp
141-
Location getCellularLocation(unsigned long timeout)
142-
```
143-
144-
Gets the cellular location. (Blocking call)
145-
146-
#### Parameters
147-
* `timeout` The timeout (In milliseconds) to wait for the cellular location.
148-
149-
#### Returns
150-
The cellular location. If the location is not retrieved, the latitude and longitude will be 0.0.
151-
<hr />
152-
153152
### `getCellularTime` <a id="class_arduino_cellular_1a6b3ce5485badff582584d539e790aff4" class="anchor"></a>
154153

155154
```cpp
@@ -212,18 +211,33 @@ Gets the list of unread [SMS](#class_s_m_s) messages.
212211
A vector of [SMS](#class_s_m_s) messages.
213212
<hr />
214213

215-
### `sendATCommand` <a id="class_arduino_cellular_1a1d20e97f47d05d5420a98f79f213f978" class="anchor"></a>
214+
### `deleteSMS` <a id="class_arduino_cellular_1abe4337f0bc8c486a076011309120ace1" class="anchor"></a>
215+
216+
```cpp
217+
bool deleteSMS(uint16_t index)
218+
```
219+
220+
Deletes an [SMS](#class_s_m_s) message at the specified index.
221+
222+
#### Parameters
223+
* `index` The index of the [SMS](#class_s_m_s) message to delete.
224+
225+
#### Returns
226+
True if the [SMS](#class_s_m_s) message was successfully deleted, false otherwise.
227+
<hr />
228+
229+
### `sendATCommand` <a id="class_arduino_cellular_1a58a3e3713af0c01ad1075a2509c6874d" class="anchor"></a>
216230
217231
```cpp
218-
String sendATCommand(char * command, unsigned long timeout)
232+
String sendATCommand(const char * command, unsigned long timeout)
219233
```
220234

221235
Sends an AT command to the modem and waits for a response, then returns the response.
222236

223237
#### Parameters
224238
* `command` The AT command to send.
225239

226-
* `timeout` The timeout (In milliseconds) to wait for the response.
240+
* `timeout` The timeout (In milliseconds) to wait for the response. Default is 1000ms.
227241

228242
#### Returns
229243
The response from the modem.
@@ -339,8 +353,8 @@ Represents the interface to the 4G modem module.
339353
Members | Descriptions
340354
--------------------------------|---------------------------------------------
341355
| [`stream`](#class_modem_interface_1a4a8be6e54608e2cbd9704614b807b4b0) | The stream object for communication with the modem. |
342-
| [`power_pin`](#class_modem_interface_1a3b23e45b1497e372a4965d87656523d6) | The pin number for controlling the power of the modem. |
343-
| [`ModemInterface`](#class_modem_interface_1a4fad197930f994b036cc3f1645612fce) | Constructor for the [ModemInterface](#class_modem_interface) class. |
356+
| [`powerPin`](#class_modem_interface_1a26e5e7417ff90759520c89776fb0c7f2) | The pin number for controlling the power of the modem. |
357+
| [`ModemInterface`](#class_modem_interface_1aa364cae2d778d717ca1c53a0e4ee8702) | Constructor for the [ModemInterface](#class_modem_interface) class. |
344358
| [`init`](#class_modem_interface_1a2f8f381994be24bb821ace646f7fde9b) | Initializes the modem interface. |
345359

346360
## Members
@@ -354,27 +368,27 @@ Stream * stream
354368
The stream object for communication with the modem.
355369
<hr />
356370

357-
### `power_pin` <a id="class_modem_interface_1a3b23e45b1497e372a4965d87656523d6" class="anchor"></a>
371+
### `powerPin` <a id="class_modem_interface_1a26e5e7417ff90759520c89776fb0c7f2" class="anchor"></a>
358372

359373
```cpp
360-
int power_pin
374+
int powerPin
361375
```
362376

363377
The pin number for controlling the power of the modem.
364378
<hr />
365379

366-
### `ModemInterface` <a id="class_modem_interface_1a4fad197930f994b036cc3f1645612fce" class="anchor"></a>
380+
### `ModemInterface` <a id="class_modem_interface_1aa364cae2d778d717ca1c53a0e4ee8702" class="anchor"></a>
367381

368382
```cpp
369-
inline explicit ModemInterface(Stream & stream, int power_pin)
383+
inline explicit ModemInterface(Stream & stream, int powerPin)
370384
```
371385
372386
Constructor for the [ModemInterface](#class_modem_interface) class.
373387
374388
#### Parameters
375389
* `stream` The stream object for communication with the modem.
376390
377-
* `power_pin` The pin number for controlling the power of the modem.
391+
* `powerPin` The pin number for controlling the power of the modem.
378392
<hr />
379393
380394
### `init` <a id="class_modem_interface_1a2f8f381994be24bb821ace646f7fde9b" class="anchor"></a>
@@ -400,18 +414,28 @@ Represents an [SMS](#class_s_m_s) message.
400414

401415
Members | Descriptions
402416
--------------------------------|---------------------------------------------
403-
| [`number`](#class_s_m_s_1a7e93b46a5ea599e6fdc27295afaf4c51) | The phone number associated with the [SMS](#class_s_m_s). |
417+
| [`index`](#class_s_m_s_1a1d7df5242fd17e58cb5c7ef1f81472fb) | The index of the [SMS](#class_s_m_s) message. |
418+
| [`sender`](#class_s_m_s_1aafb60a0ef09724cc5e3f659505c9dab3) | The phone number associated with the [SMS](#class_s_m_s). |
404419
| [`message`](#class_s_m_s_1ad2f3aac08b66f78472b18727a653c7c4) | The content of the [SMS](#class_s_m_s) message. |
405420
| [`timestamp`](#class_s_m_s_1a8f275bdda4111b2ecc95f269cec70940) | The timestamp when the [SMS](#class_s_m_s) was received. |
406421
| [`SMS`](#class_s_m_s_1ac4a683a43558570b5a9cb3a92100c29e) | Default constructor for [SMS](#class_s_m_s). Initializes the number, message, and timestamp to empty values. |
407-
| [`SMS`](#class_s_m_s_1a964afc86f65da37c4bf8e099e250f9de) | Constructor for [SMS](#class_s_m_s). |
422+
| [`SMS`](#class_s_m_s_1abb10fd15a6e3d1f3b6a9bb24123d4e0a) | Constructor for [SMS](#class_s_m_s). |
408423

409424
## Members
410425

411-
### `number` <a id="class_s_m_s_1a7e93b46a5ea599e6fdc27295afaf4c51" class="anchor"></a>
426+
### `index` <a id="class_s_m_s_1a1d7df5242fd17e58cb5c7ef1f81472fb" class="anchor"></a>
427+
428+
```cpp
429+
int16_t index
430+
```
431+
432+
The index of the [SMS](#class_s_m_s) message.
433+
<hr />
434+
435+
### `sender` <a id="class_s_m_s_1aafb60a0ef09724cc5e3f659505c9dab3" class="anchor"></a>
412436

413437
```cpp
414-
String number
438+
String sender
415439
```
416440

417441
The phone number associated with the [SMS](#class_s_m_s).
@@ -444,15 +468,17 @@ inline SMS()
444468
Default constructor for [SMS](#class_s_m_s). Initializes the number, message, and timestamp to empty values.
445469
<hr />
446470

447-
### `SMS` <a id="class_s_m_s_1a964afc86f65da37c4bf8e099e250f9de" class="anchor"></a>
471+
### `SMS` <a id="class_s_m_s_1abb10fd15a6e3d1f3b6a9bb24123d4e0a" class="anchor"></a>
448472

449473
```cpp
450-
inline SMS(String number, String message, Time timestamp)
474+
inline SMS(int16_t index, String sender, String message, Time timestamp)
451475
```
452476
453477
Constructor for [SMS](#class_s_m_s).
454478
#### Parameters
455-
* `number` The phone number associated with the [SMS](#class_s_m_s).
479+
* `index` The index of the [SMS](#class_s_m_s) message.
480+
481+
* `sender` The phone number associated with the sender of the [SMS](#class_s_m_s).
456482
457483
* `message` The content of the [SMS](#class_s_m_s) message.
458484

0 commit comments

Comments
 (0)