Simple interface for Mbed Cloud Client
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 41 of file m2mconnectionsecuritypimpl.cpp.
~M2MConnectionSecurityPimpl | ( | ) | [virtual] |
Destructor.
Definition at line 51 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 212 of file m2mconnectionsecuritypimpl.cpp.
int init | ( | const M2MSecurity * | security, |
uint16_t | security_instance_id | ||
) |
Initiatlizes the socket connection states.
Definition at line 72 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 256 of file m2mconnectionsecuritypimpl.cpp.
void reset | ( | ) |
Resets the socket connection states.
Definition at line 61 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 227 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 287 of file m2mconnectionsecuritypimpl.cpp.
void set_random_number_callback | ( | random_number_cb | callback ) |
This function is no longer used.
Definition at line 282 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 294 of file m2mconnectionsecuritypimpl.cpp.
Generated on Tue Jul 12 2022 19:01:39 by 1.7.2