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.
Fork of MiniTLS-GPL by
TLSSocket Class Reference
TLS Socket. More...
#include <TLSSocket.h>
Public Member Functions | |
| TLSSocket (MiniTLS *pMiniTLS) | |
| Instantiate a TLS socket. | |
| minitls_err_t | init () |
| Initialize socket. | |
| minitls_err_t | connect (const char *hostname, uint16_t port, int timeout) |
| Connect to server. | |
| minitls_err_t | read (uint8_t *buf, size_t minLength, size_t maxLength, size_t *readLength, int timeout) |
| Read data from server. | |
| minitls_err_t | write (uint8_t *buf, size_t length, size_t *writtenLength, int timeout) |
| Write data to server. | |
| minitls_err_t | flush (int timeout) |
| Call to ensure transmission of bytes written using write. | |
| minitls_err_t | close () |
| Tear down TLS connection and close socket. | |
Detailed Description
TLS Socket.
- Parameters:
-
pMiniTLS pointer to MiniTLS instance
Definition at line 41 of file TLSSocket.h.
Constructor & Destructor Documentation
Instantiate a TLS socket.
Definition at line 40 of file TLSSocket.cpp.
Member Function Documentation
| minitls_err_t close | ( | ) |
Tear down TLS connection and close socket.
- Returns:
- MINITLS_OK on success, MINITLS_ERR_* error code otherwise
Definition at line 183 of file TLSSocket.cpp.
| minitls_err_t connect | ( | const char * | hostname, |
| uint16_t | port, | ||
| int | timeout | ||
| ) |
Connect to server.
- Parameters:
-
hostname server to connect to port port to connect to timeout timeout in ms
- Returns:
- MINITLS_OK on success, MINITLS_ERR_* error code otherwise
Definition at line 71 of file TLSSocket.cpp.
| minitls_err_t flush | ( | int | timeout ) |
Call to ensure transmission of bytes written using write.
- Parameters:
-
timeout timeout in ms
- Returns:
- MINITLS_OK on success, MINITLS_ERR_* error code otherwise
Definition at line 170 of file TLSSocket.cpp.
| minitls_err_t init | ( | ) |
Initialize socket.
- Returns:
- MINITLS_OK on success, MINITLS_ERR_* error code otherwise
Definition at line 53 of file TLSSocket.cpp.
| minitls_err_t read | ( | uint8_t * | buf, |
| size_t | minLength, | ||
| size_t | maxLength, | ||
| size_t * | readLength, | ||
| int | timeout | ||
| ) |
Read data from server.
- Parameters:
-
buf buffer to read bytes to minLength minimum number of bytes to read (will block before this number of bytes are read) maxLength maximum number of bytes to read readLength will receive actual number of bytes read timeout timeout in ms
- Returns:
- MINITLS_OK on success, MINITLS_ERR_* error code otherwise
Definition at line 89 of file TLSSocket.cpp.
| minitls_err_t write | ( | uint8_t * | buf, |
| size_t | length, | ||
| size_t * | writtenLength, | ||
| int | timeout | ||
| ) |
Write data to server.
- Parameters:
-
buf buffer to write bytes from length number of bytes to write writtenLength will receive actual number of bytes written timeout timeout in ms
- Returns:
- MINITLS_OK on success, MINITLS_ERR_* error code otherwise
Definition at line 131 of file TLSSocket.cpp.
Generated on Tue Jul 12 2022 19:20:11 by
1.7.2
