You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`class `[`ArduinoCellular`](#class_arduino_cellular) | This class provides methods to interact with the Arduino Pro Modem, such as connecting to the network, sending [SMS](#class_s_m_s) messages, getting GPS location, and more.
6
+
`class `[`ManagedTinyGsmClient`](#class_managed_tiny_gsm_client) | A managed client for TinyGSM that automatically handles socket allocation and release. This class allows you to create multiple clients without worrying about socket management. It uses a static bit field to track used sockets and provides methods to lock and unlock the sockets.
6
7
`class `[`ModemInterface`](#class_modem_interface) | Represents the interface to the 4G modem module which extends the TinyGsmBG96 class.
7
8
`class `[`SMS`](#class_s_m_s) | Represents an [SMS](#class_s_m_s) message.
8
9
`class `[`Time`](#class_time) | Represents a point in time with year, month, day, hour, minute, second, and offset.
@@ -19,26 +20,28 @@ This class provides methods to interact with the Arduino Pro Modem, such as conn
19
20
|[`ArduinoCellular`](#class_arduino_cellular_1a96d1d9f3fbe80adc3d460b4364d47870)| Creates an instance of the [ArduinoCellular](#class_arduino_cellular) class. |
20
21
|[`begin`](#class_arduino_cellular_1ad5ca7cf61f48c40569f41f3029d6516e)| Initializes the modem. This function must be called before using any other functions in the library. |
21
22
|[`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. |
23
+
|[`connect`](#class_arduino_cellular_1ad50b506df65a6ac4c81b9e88095ecd24)| Registers with the cellular network and connects to the Internet if the APN, GPRS username, and GPRS password are provided. |
24
+
|[`connect`](#class_arduino_cellular_1a247ff63f5852b42f32103d4cef84b2a3)| Registers with the cellular network and connects to the Internet if the APN, GPRS username, and GPRS password are provided. |
23
25
|[`isConnectedToOperator`](#class_arduino_cellular_1af7453ef90702e9042e2b4b18fa89db03)| Checks if the modem is registered on the network. |
24
26
|[`isConnectedToInternet`](#class_arduino_cellular_1a6f8251e06de1810897b8bd8f8fb1b1a2)| Checks if the GPRS network is connected. |
25
27
|[`enableGPS`](#class_arduino_cellular_1abe77a53e0eba6e8d62ba5db3bb6f5e92)| Enables or disables the GPS functionality. |
26
28
|[`getGPSLocation`](#class_arduino_cellular_1a41225f52d059df173f028ecd0c039ec3)| Gets the GPS location. (Blocking call) |
27
29
|[`getCellularTime`](#class_arduino_cellular_1a6b3ce5485badff582584d539e790aff4)| Gets the current time from the network. |
28
30
|[`getGPSTime`](#class_arduino_cellular_1a4aeb898c958e6eb001d606f0c7da8799)| Gets the current time from the GPS module. |
29
31
|[`sendSMS`](#class_arduino_cellular_1a371aef1318857f0863f443eaeabf4ac2)| Sends an [SMS](#class_s_m_s) message to the specified number. |
30
-
|[`getReadSMS`](#class_arduino_cellular_1ae032c4e4cade6579a2c1edfe53d2ff2b)| Gets the list of read [SMS](#class_s_m_s) messages. |
31
-
|[`getUnreadSMS`](#class_arduino_cellular_1a212513654884058947a2a4d332f6ccfc)| Gets the list of unread [SMS](#class_s_m_s) messages. |
32
+
|[`getReadSMS`](#class_arduino_cellular_1a5da65683df86af75590c7a68766236ee)| Gets the list of read [SMS](#class_s_m_s) messages. |
33
+
|[`getUnreadSMS`](#class_arduino_cellular_1af1e3b2fad0a64f3b7675c88100ddbca5)| Gets the list of unread [SMS](#class_s_m_s) messages. |
32
34
|[`deleteSMS`](#class_arduino_cellular_1abe4337f0bc8c486a076011309120ace1)| Deletes an [SMS](#class_s_m_s) message at the specified index. |
33
35
|[`sendATCommand`](#class_arduino_cellular_1a58a3e3713af0c01ad1075a2509c6874d)| Sends an AT command to the modem and waits for a response, then returns the response. |
34
36
|[`sendUSSDCommand`](#class_arduino_cellular_1a6886aec5850836ea8e8f135d4e5632ab)| Sends a USSD command to the network operator and waits for a response. |
35
-
|[`getNetworkClient`](#class_arduino_cellular_1acff92474af3bd819b62f132cf12f45ba)| Gets the Network client. (OSI Layer 3) |
37
+
|[`getNetworkClient`](#class_arduino_cellular_1acff92474af3bd819b62f132cf12f45ba)| Gets a new Network client. (OSI Layer 3) The library automatically manages the sockets, so you can create multiple clients without worrying about socket management. You should ensure that you release the client when you are done with it. It's possible that the client is invalid if no sockets are available. This is indicated by the isValid() method and the socketId will be -1.|
36
38
|[`getSecureNetworkClient`](#class_arduino_cellular_1a8b7486d1a682787588c015af8d65a38e)| Gets the Transport Layer Security (TLS) client. (OSI Layer 4) |
37
-
|[`getHTTPClient`](#class_arduino_cellular_1aa1b4c3bbd14984d2a7ed1db7fa1ac930)| Gets the HTTP client for the specified server and port. |
38
-
|[`getHTTPSClient`](#class_arduino_cellular_1aeb2d1bff0405e92197c0de750cef87e0)| Gets the HTTPS client for the specified server and port. |
39
+
|[`getHTTPClient`](#class_arduino_cellular_1aa1b4c3bbd14984d2a7ed1db7fa1ac930)| Gets a HTTP client for the specified server and port. The maximum number of HTTP clients is limited by the number of sockets available. |
40
+
|[`getHTTPSClient`](#class_arduino_cellular_1aeb2d1bff0405e92197c0de750cef87e0)| Gets a HTTPS client for the specified server and port. The maximum number of HTTP clients is limited by the number of sockets available. |
39
41
|[`getIPAddress`](#class_arduino_cellular_1aabf2ad2144827d34c3ba298b5f423344)| Gets the local IP address. |
40
42
|[`getSignalQuality`](#class_arduino_cellular_1aefdae9cb2b8c9f05130b09c18c3f245e)| Gets the signal quality. |
41
43
|[`setDebugStream`](#class_arduino_cellular_1aae2cacf5a5778293f0bd3312d2289327)| Sets the debug stream for [ArduinoCellular](#class_arduino_cellular). |
44
+
|[`getSimStatus`](#class_arduino_cellular_1a25aae9d375b5a0e1c4271f06815adc49)| Gets the SIM card status. |
42
45
43
46
## Members
44
47
@@ -77,10 +80,10 @@ Unlocks the SIM card using the specified PIN.
77
80
True if the SIM card is unlocked, false otherwise.
@@ -265,10 +287,10 @@ The response from the network operator. (Note: The response may be an [SMS](#cla
265
287
TinyGsmClient getNetworkClient()
266
288
```
267
289
268
-
Gets the Network client. (OSI Layer 3)
290
+
Gets a new Network client. (OSI Layer 3) The library automatically manages the sockets, so you can create multiple clients without worrying about socket management. You should ensure that you release the client when you are done with it. It's possible that the client is invalid if no sockets are available. This is indicated by the isValid() method and the socketId will be -1.
269
291
270
292
#### Returns
271
-
The GSM client.
293
+
A GSM client object that can be used to connect to a server.
# class `ManagedTinyGsmClient` <aid="class_managed_tiny_gsm_client"class="anchor"></a>
393
+
394
+
```cpp
395
+
classManagedTinyGsmClient
396
+
: public TinyGsmClient
397
+
```
398
+
399
+
A managed client for TinyGSM that automatically handles socket allocation and release. This class allows you to create multiple clients without worrying about socket management. It uses a static bit field to track used sockets and provides methods to lock and unlock the sockets.
| [`ManagedTinyGsmClient`](#class_managed_tiny_gsm_client_1ae8426b2b9cbc4fd5cc42fc63b29c4765) | Constructs a [ManagedTinyGsmClient](#class_managed_tiny_gsm_client) with the specified modem. |
406
+
| [`ManagedTinyGsmClient`](#class_managed_tiny_gsm_client_1afaea0452624a337c1b9833be6ccb5432) | Copy constructor for [ManagedTinyGsmClient](#class_managed_tiny_gsm_client). This constructor allocates a new socket for the copied client. |
407
+
| [`operator=`](#class_managed_tiny_gsm_client_1af87b0fec92e954c59b7a660f2fb4e8f4) | Assignment operator for [ManagedTinyGsmClient](#class_managed_tiny_gsm_client). |
408
+
| [`ManagedTinyGsmClient`](#class_managed_tiny_gsm_client_1a50389bc67386357c251be242f8a5edb1) | Move constructor for [ManagedTinyGsmClient](#class_managed_tiny_gsm_client). |
409
+
| [`operator=`](#class_managed_tiny_gsm_client_1aadcf674f40d9af11dae82fb85dde41d4) | Move assignment operator for [ManagedTinyGsmClient](#class_managed_tiny_gsm_client). This operator transfers ownership of the socket from the other client to this one. |
410
+
| [`~ManagedTinyGsmClient`](#class_managed_tiny_gsm_client_1af227af40b0e787ef8323c5346b69679a) | Destructor for [ManagedTinyGsmClient](#class_managed_tiny_gsm_client). Releases the socket if it is valid. |
411
+
| [`getSocketId`](#class_managed_tiny_gsm_client_1a8c1bd76a1728ddefacfdd30c81ac70d7) | Get the socket ID for this client. The maximum number of sockets is defined by TINY_GSM_MUX_COUNT. If the client is invalid, the socketId will be -1. |
412
+
| [`isValid`](#class_managed_tiny_gsm_client_1a62617c1a63c68e4cd31a4fcca52fe229) | Check if the client is valid. A client is valid if it has a socket ID >= 0. This is useful to check if the client can be used for network operations. |
Copy constructor for [ManagedTinyGsmClient](#class_managed_tiny_gsm_client). This constructor allocates a new socket for the copied client.
435
+
#### Parameters
436
+
* `other` The other [ManagedTinyGsmClient](#class_managed_tiny_gsm_client) to copy from. Note: If the other client is invalid, this will also create an invalid client. The socketId will be -1.
Move assignment operator for [ManagedTinyGsmClient](#class_managed_tiny_gsm_client). This operator transfers ownership of the socket from the other client to this one.
471
+
#### Parameters
472
+
*`other` The other [ManagedTinyGsmClient](#class_managed_tiny_gsm_client) to move from.
473
+
474
+
#### Returns
475
+
A reference to this [ManagedTinyGsmClient](#class_managed_tiny_gsm_client).
0 commit comments