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.
M2MConnectionSecurityPimpl Class Reference
The M2MConnectionSecurityPimpl class. More...
#include <m2mconnectionsecuritypimpl.h>
Public Member Functions | |
M2MConnectionSecurityPimpl (M2MConnectionSecurity::SecurityMode mode) | |
Constructor. | |
virtual | ~M2MConnectionSecurityPimpl () |
Destructor. | |
void | reset () |
Resets the socket connection states. | |
int | init (const M2MSecurity *security, uint16_t security_instance_id) |
Initiatlizes the socket connection states. | |
int | connect (M2MConnectionHandler *connHandler) |
Connects the client to the server. | |
int | send_message (unsigned char *message, int len) |
Sends data to the server. | |
int | read (unsigned char *buffer, uint16_t len) |
Reads the data received from the server. | |
void | set_random_number_callback (random_number_cb callback) |
This function is no longer used. | |
void | set_entropy_callback (entropy_cb callback) |
Sets the function callback that will be called by mbed-client for providing entropy source from application for ensuring strong entropy. | |
void | set_socket (palSocket_t socket, palSocketAddress_t *address) |
Set socket information for this secure connection. |
Detailed Description
The M2MConnectionSecurityPimpl class.
Definition at line 33 of file m2mconnectionsecuritypimpl.h.
Constructor & Destructor Documentation
M2MConnectionSecurityPimpl | ( | M2MConnectionSecurity::SecurityMode | mode ) |
Constructor.
Definition at line 42 of file m2mconnectionsecuritypimpl.cpp.
~M2MConnectionSecurityPimpl | ( | ) | [virtual] |
Destructor.
Definition at line 52 of file m2mconnectionsecuritypimpl.cpp.
Member Function Documentation
int connect | ( | M2MConnectionHandler * | connHandler ) |
Connects the client to the server.
- Parameters:
-
connHandler The ConnectionHandler object that maintains the socket.
- Returns:
- Returns the state of the connection. Successful or not. If 2MConnectionHandlerCONNECTION_ERROR_WANTS_READ is returned this function must be called again later to continue the handshake.
Definition at line 269 of file m2mconnectionsecuritypimpl.cpp.
int init | ( | const M2MSecurity * | security, |
uint16_t | security_instance_id | ||
) |
Initiatlizes the socket connection states.
Definition at line 73 of file m2mconnectionsecuritypimpl.cpp.
int read | ( | unsigned char * | buffer, |
uint16_t | len | ||
) |
Reads the data received from the server.
- Parameters:
-
message The data to be read. len The length of the data.
- Returns:
- Indicates whether the data is read successfully or not.
Definition at line 315 of file m2mconnectionsecuritypimpl.cpp.
void reset | ( | void | ) |
Resets the socket connection states.
Definition at line 62 of file m2mconnectionsecuritypimpl.cpp.
int send_message | ( | unsigned char * | message, |
int | len | ||
) |
Sends data to the server.
- Parameters:
-
message The data to be sent. len The length of the data.
- Returns:
- Indicates whether the data is sent successfully or not.
Definition at line 284 of file m2mconnectionsecuritypimpl.cpp.
void set_entropy_callback | ( | entropy_cb | callback ) |
Sets the function callback that will be called by mbed-client for providing entropy source from application for ensuring strong entropy.
- Parameters:
-
entropy_callback A function pointer that will be called by mbed-client while performing secure handshake. Function signature , if using mbed-client-mbedtls should be int (*mbedtls_entropy_f_source_ptr)(void *data, unsigned char *output, size_t len, size_t *olen);
NOTE: This function is only used if MBED_CLOUD_CLIENT_CUSTOM_MBEDTLS_ENTROPY is defined and mbed TLS is used.
Definition at line 347 of file m2mconnectionsecuritypimpl.cpp.
void set_random_number_callback | ( | random_number_cb | callback ) |
This function is no longer used.
Definition at line 342 of file m2mconnectionsecuritypimpl.cpp.
void set_socket | ( | palSocket_t | socket, |
palSocketAddress_t * | address | ||
) |
Set socket information for this secure connection.
- Parameters:
-
socket Socket used with this TLS session. address Pointer to the address of the server.
- Returns:
- Indicates whether the data is read successfully or not.
Definition at line 354 of file m2mconnectionsecuritypimpl.cpp.
Generated on Mon Aug 29 2022 19:53:43 by
