Skip to content

Commit

Permalink
Upadte comments and Readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Aug 26, 2023
1 parent ce575f0 commit 54bfbf3
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ The SPI Ethernet module that uses WIZNet W5100, W5500 and ENC28J60 are supported
// by not set any buffer size or set the rx buffer size to maximum SSL record size (16384) and 512 for tx buffer size.
ssl_client.setBufferSizes(1024 /* rx */, 512 /* tx */);

// assign the basic client
// Assign the basic client
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
// as long as it was used by ssl_client for transportation.
ssl_client.setClient(&basic_client);

Serial.print("Connecting to server...");
Expand Down Expand Up @@ -182,6 +184,8 @@ param **`client`** The pointer to Client interface.

param **`enableSSL`** The ssl option; true for enable, false for disable.

Due to the client pointer is assigned, to avoid dangling pointer, basic_client should be existed as long as it was used by ssl_client for transportation.

```cpp
void setClient(Client *client, bool enableSSL = true);
```
Expand Down
4 changes: 3 additions & 1 deletion examples/certificate/certificate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ void setup()
*/
ssl_client.setDebugLevel(1);

// assign the basic client
// Assign the basic client
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
// as long as it was used by ssl_client for transportation.
ssl_client.setClient(&basic_client);
}

Expand Down
4 changes: 3 additions & 1 deletion examples/ethernet/ethernet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ void setup()
*/
ssl_client.setDebugLevel(1);

// assign the basic client
// Assign the basic client
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
// as long as it was used by ssl_client for transportation.
ssl_client.setClient(&basic_client);
}

Expand Down
4 changes: 3 additions & 1 deletion examples/gsm/gsm.ino
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ void loop()
*/
ssl_client.setDebugLevel(1);

// assign the basic client
// Assign the basic client
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
// as long as it was used by ssl_client for transportation.
ssl_client.setClient(&basic_client);

Serial.println("---------------------------------");
Expand Down
4 changes: 3 additions & 1 deletion examples/http_upgrade/http_upgrade.ino
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ void setup()
*/
ssl_client.setDebugLevel(1);

// assign the basic client
// Assign the basic client
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
// as long as it was used by ssl_client for transportation.
ssl_client.setClient(&basic_client, false /* set enable SSL option to false */);
}

Expand Down
4 changes: 3 additions & 1 deletion examples/https/https.ino
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ void setup()
*/
ssl_client.setDebugLevel(1);

// assign the basic client
// Assign the basic client
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
// as long as it was used by ssl_client for transportation.
ssl_client.setClient(&basic_client);
}

Expand Down
4 changes: 3 additions & 1 deletion examples/mqtt/mqtt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ void setup()
*/
ssl_client.setDebugLevel(1);

// assign the basic client
// Assign the basic client
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
// as long as it was used by ssl_client for transportation.
ssl_client.setClient(&basic_client);

Serial.print("Attempting to connect to the MQTT broker over ssl: ");
Expand Down
4 changes: 3 additions & 1 deletion examples/session/session.ino
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ void setup()
*/
ssl_client.setDebugLevel(1);

// assign the basic client
// Assign the basic client
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
// as long as it was used by ssl_client for transportation.
ssl_client.setClient(&basic_client);
}

Expand Down
3 changes: 3 additions & 0 deletions src/client/BSSL_TCP_Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class BSSL_TCP_Client : public Client
* Set the client.
* @param client The pointer to Client interface.
* @param enableSSL The ssl option; true for enable, false for disable.
*
* Due to the client pointer is assigned, to avoid dangling pointer,
* basic_client should be existed as long as it was used by ssl_client for transportation.
*/
void setClient(Client *client, bool enableSSL = true);

Expand Down

0 comments on commit 54bfbf3

Please sign in to comment.