Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TLS_axTLS-Example HTTPSClientExample
TLSConnection Class Reference
This class provides a user-friendly interface for the axTLS library. More...
#include <TLSConnection.h>
Public Member Functions | |
| bool | connect (const char *host) |
| This function tries to establish a TLS connection with the given host. | |
| bool | is_connected (void) |
| Indicates whether a connection is established or not. | |
| int | send_all (char *data, int length) |
| Sends some data to the host. | |
| int | receive (char *data, int length) |
| Receive some data from the host. | |
| bool | close (bool shutdown=true) |
| Close the connection. | |
Detailed Description
This class provides a user-friendly interface for the axTLS library.
Definition at line 11 of file TLSConnection.h.
Member Function Documentation
| bool close | ( | bool | shutdown = true ) |
Close the connection.
- Parameters:
-
shutdown
- Returns:
- True if the connection was closed with success, false otherwise. If no connection was established, returns true immediately.
Definition at line 65 of file TLSConnection.cpp.
| bool connect | ( | const char * | host ) |
This function tries to establish a TLS connection with the given host.
It will first try to establish a TCP connection on port 443 with the host. Then, it runs the TLS handshake protocol.
- Parameters:
-
host A valid hostname (e.g. "mbed.org")
- Returns:
- True if it managed to establish a connection with the host. False otherwise.
Definition at line 15 of file TLSConnection.cpp.
| bool is_connected | ( | void | ) |
Indicates whether a connection is established or not.
- Returns:
- true if a connection is established, otherwise returns false.
Definition at line 47 of file TLSConnection.cpp.
| int receive | ( | char * | data, |
| int | length | ||
| ) |
Receive some data from the host.
- Parameters:
-
data length Maximum number of bytes to receive
- Returns:
- Number of bytes read in range 0..length, or -1 if an error occured.
Definition at line 60 of file TLSConnection.cpp.
| int send_all | ( | char * | data, |
| int | length | ||
| ) |
Sends some data to the host.
This method does not return until length bytes have been sent.
- Parameters:
-
data A pointer to some data length Number of bytes to send
- Returns:
- Number of bytes sent, or -1 if an error occured.
Definition at line 52 of file TLSConnection.cpp.
Generated on Wed Jul 13 2022 19:30:08 by
1.7.2