Skip to content

Commit 9e8949a

Browse files
committed
Add documentation
1 parent 372ab54 commit 9e8949a

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

src/ArduinoCellular.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,17 @@ class ArduinoCellular {
236236
#endif
237237

238238
/**
239-
* @brief Gets the HTTP client for the specified server and port.
239+
* @brief Gets a HTTP client for the specified server and port.
240+
* The maximum number of HTTP clients is limited by the number of sockets available.
240241
* @param server The server address.
241242
* @param port The server port.
242243
* @return The HTTP client.
243244
*/
244245
HttpClient getHTTPClient(const char * server, const int port);
245246

246247
/**
247-
* @brief Gets the HTTPS client for the specified server and port.
248+
* @brief Gets a HTTPS client for the specified server and port.
249+
* The maximum number of HTTP clients is limited by the number of sockets available.
248250
* @param server The server address.
249251
* @param port The server port.
250252
* @return The HTTPS client.

src/ManagedTinyGsmClient.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,58 @@ class ManagedTinyGsmClient : public TinyGsmClient {
1515
static void unlockSockets();
1616

1717
public:
18+
/**
19+
* @brief Constructs a ManagedTinyGsmClient with the specified modem.
20+
* @param modem The TinyGsm modem to use.
21+
*/
1822
ManagedTinyGsmClient(TinyGsm& modem);
23+
24+
/**
25+
* Copy constructor for ManagedTinyGsmClient.
26+
*/
1927
ManagedTinyGsmClient(const ManagedTinyGsmClient& other);
28+
29+
/**
30+
* Assignment operator for ManagedTinyGsmClient.
31+
* @param other The other ManagedTinyGsmClient to copy from.
32+
* @return A reference to this ManagedTinyGsmClient.
33+
*/
2034
ManagedTinyGsmClient& operator=(const ManagedTinyGsmClient& other);
35+
36+
/**
37+
* Move constructor for ManagedTinyGsmClient.
38+
* @param other The other ManagedTinyGsmClient to move from.
39+
*/
2140
ManagedTinyGsmClient(ManagedTinyGsmClient&& other);
41+
42+
/**
43+
* Move assignment operator for ManagedTinyGsmClient.
44+
* This operator transfers ownership of the socket from the other client to this one.
45+
* @param other The other ManagedTinyGsmClient to move from.
46+
* @return A reference to this ManagedTinyGsmClient.
47+
*/
2248
ManagedTinyGsmClient& operator=(ManagedTinyGsmClient&& other);
49+
50+
/**
51+
* Destructor for ManagedTinyGsmClient.
52+
* Releases the socket if it is valid.
53+
*/
2354
~ManagedTinyGsmClient();
2455

56+
/**
57+
* Get the socket ID for this client.
58+
* The maximum number of sockets is defined by TINY_GSM_MUX_COUNT.
59+
* If the client is invalid, the socketId will be -1.
60+
* @return The socket ID (0 - (TINY_GSM_MUX_COUNT - 1) or -1 if invalid).
61+
*/
2562
int getSocketId() const { return socketId; }
63+
64+
/**
65+
* Check if the client is valid.
66+
* A client is valid if it has a socket ID >= 0.
67+
* This is useful to check if the client can be used for network operations.
68+
* @return True if the client is valid, false otherwise.
69+
*/
2670
bool isValid() const { return socketId >= 0; }
2771
};
2872

0 commit comments

Comments
 (0)