Skip to content

Commit 12a02c9

Browse files
Api docs
1 parent ecab85d commit 12a02c9

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

libraries/WiFiS3/src/WiFiSSLClient.h

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,85 @@
2929
class WiFiSSLClient : public WiFiClient {
3030

3131
public:
32+
/**
33+
* Initializes objects of the `WiFiSSLClient` class.
34+
*/
3235
WiFiSSLClient();
3336
~WiFiSSLClient();
37+
38+
/**
39+
* Establishes a secure SSL connection to a specified IP address and port.
40+
* It takes an `IPAddress` object representing the IP address of the server
41+
* and a `uint16_t` port number as parameters.
42+
*/
3443
virtual int connect(IPAddress ip, uint16_t port);
44+
45+
/**
46+
* Establishes a secure SSL connection to a specified host (domain name) and port.
47+
*/
3548
virtual int connect(const char* host, uint16_t port);
49+
50+
/**
51+
* Sets the Certificate Authority (CA) certificate for establishing secure SSL connections.
52+
*/
3653
void setCACert(const char* root_ca);
54+
55+
/**
56+
* Sets the ECC (Elliptic Curve Cryptography) key slot and
57+
* certificate for establishing secure SSL connections.
58+
* `int ecc508KeySlot` specifies the ECC key slot to be used for the SSL connection.
59+
* `const byte cert[]` is a pointer to the certificate data in the form of an array of bytes.
60+
* `int certLength` specifies the length of the certificate data array.
61+
*/
3762
void setEccSlot(int ecc508KeySlot, const byte cert[], int certLength);
63+
64+
/**
65+
* Allows writing a single byte of data to the SSL connection.
66+
* The `uint8_t` parameter represents the byte of data to be written.
67+
*/
3868
virtual size_t write(uint8_t);
69+
70+
/**
71+
* Allows writing a buffer of data to the SSL connection.
72+
*/
3973
virtual size_t write(const uint8_t *buf, size_t size);
74+
75+
/**
76+
* Checks the number of bytes available for reading from the SSL connection.
77+
* It returns the number of bytes available to read from the SSL connection without blocking.
78+
*/
4079
virtual int available();
80+
81+
/**
82+
* Reads a single byte of data from the SSL connection.
83+
*/
4184
virtual int read();
85+
86+
/**
87+
* Reads a buffer of data from the SSL connection.
88+
*/
4289
virtual int read(uint8_t *buf, size_t size);
90+
91+
/**
92+
* Peeks at the next byte of incoming data without removing it
93+
* from the internal buffer of the SSL connection.
94+
*/
4395
virtual int peek();
96+
97+
/**
98+
* Flushes any pending data in the SSL connection.
99+
* When called, this function ensures that any buffered outgoing data is
100+
* sent over the SSL connection immediately.
101+
*/
44102
virtual void flush();
103+
104+
/**
105+
* Closes the SSL connection.
106+
* When called, this function will terminate the SSL connection and
107+
* release any associated resources.
108+
*/
45109
virtual void stop();
110+
46111
virtual uint8_t connected();
47112
virtual operator bool() {
48113
return _sock != -1;

libraries/WiFiS3/src/WiFiServer.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,42 @@ class WiFiServer : public Server {
3434
WiFiClient client;
3535

3636
public:
37+
/**
38+
* Initializes a `WiFiServer` object.
39+
*/
3740
WiFiServer();
3841
WiFiServer(int p);
42+
43+
/**
44+
* Checks if there are any incoming client connections waiting to be accepted.
45+
* It returns a `WiFiClient` object representing the next client connection that is available
46+
* for processing.
47+
*/
3948
WiFiClient available();
49+
50+
/**
51+
* Accepts and returns a new client connection that is waiting to be processed.
52+
* When called, it will accept the next incoming client connection and
53+
* return a `WiFiClient` object representing that connection.
54+
*/
4055
WiFiClient accept();
56+
57+
/**
58+
* Initializes the WiFi server on a specific port.
59+
* When this function is called with a port number as an argument,
60+
* it sets up the server to listen for incoming client connections on that specified port.
61+
*/
4162
void begin(int port);
63+
4264
void begin();
4365
virtual size_t write(uint8_t);
4466
virtual size_t write(const uint8_t *buf, size_t size);
67+
68+
/**
69+
* Closes the server and release any resources associated with it.
70+
* When you call `end()`, it stops the server from listening for incoming client connections
71+
* and cleans up any allocated memory or resources.
72+
*/
4573
void end();
4674
explicit operator bool();
4775
virtual bool operator==(const WiFiServer&);

0 commit comments

Comments
 (0)