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.
M2MConnectionSecurity Class Reference
M2MConnectionSecurity. More...
#include <m2mconnectionsecurity.h>
Public Member Functions | |
| M2MConnectionSecurity (SecurityMode mode) | |
| Default Constructor. | |
| ~M2MConnectionSecurity () | |
| Default Destructor. | |
| void | reset () |
| Resets the socket connection states. | |
| int | init (const M2MSecurity *security) |
| Initiatlizes the socket connection states. | |
| int | start_connecting_non_blocking (M2MConnectionHandler *connHandler) |
| Starts the connection in non-blocking mode. | |
| int | continue_connecting () |
| Continues connectivity logic for secure connection. | |
| 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) |
| Sets the function callback that is called by mbed-client to fetch a random number from an application to ensure strong entropy. | |
| void | set_entropy_callback (entropy_cb callback) |
| Sets the function callback that is called by mbed-client to provide an entropy source from an application to ensure strong entropy. | |
Detailed Description
This class provides a method to create a secure socket connection to handle connectivity for the mbed Client. It will handle sending, receiving and establishing a secure connection for mbed Client on top of the normal socket connection.
Definition at line 32 of file m2mconnectionsecurity.h.
Constructor & Destructor Documentation
| M2MConnectionSecurity | ( | M2MConnectionSecurity::SecurityMode | mode ) |
Default Constructor.
Definition at line 35 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.cpp.
Default Destructor.
Definition at line 40 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.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.
Definition at line 53 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.cpp.
| int continue_connecting | ( | ) |
Continues connectivity logic for secure connection.
- Returns:
- Returns an error code if any while continuing the connection sequence.
Definition at line 68 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.cpp.
| int init | ( | const M2MSecurity * | security ) |
Initiatlizes the socket connection states.
Definition at line 46 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.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 83 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.cpp.
| void reset | ( | void | ) |
Resets the socket connection states.
Definition at line 43 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.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 76 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.cpp.
| void set_entropy_callback | ( | entropy_cb | callback ) |
Sets the function callback that is called by mbed-client to provide an entropy source from an application to ensure strong entropy.
- Parameters:
-
entropy_callback A function pointer that is called by mbed-client while performing a 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);
Definition at line 95 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.cpp.
| void set_random_number_callback | ( | random_number_cb | callback ) |
Sets the function callback that is called by mbed-client to fetch a random number from an application to ensure strong entropy.
- Parameters:
-
random_callback A function pointer that is called by mbed-client while performing a secure handshake. The function signature should be uint32_t (*random_number_callback)(void);
Definition at line 90 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.cpp.
| int start_connecting_non_blocking | ( | M2MConnectionHandler * | connHandler ) |
Starts the connection in non-blocking mode.
- Parameters:
-
connHandler The ConnectionHandler object that maintains the socket.
- Returns:
- Returns the state of the connection. Successful or not.
Definition at line 60 of file test/mbedclient/utest/stub/m2mconnectionsecurity_stub.cpp.
Generated on Tue Jul 12 2022 12:58:52 by
1.7.2