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.
M2MConnectionHandlerPimpl Class Reference
M2MConnectionHandlerPimpl. More...
#include <m2mconnectionhandlerpimpl.h>
Public Member Functions | |
| M2MConnectionHandlerPimpl (M2MConnectionHandler *base, M2MConnectionObserver &observer, M2MConnectionSecurity *sec, M2MInterface::BindingMode mode, M2MInterface::NetworkStack) | |
| Constructor. | |
| ~M2MConnectionHandlerPimpl () | |
| Destructor. | |
| bool | bind_connection (const uint16_t listen_port) |
| This binds the socket connection. | |
| bool | resolve_server_address (const String &server_address, const uint16_t server_port, M2MConnectionObserver::ServerType server_type, const M2MSecurity *security) |
| This resolves the server address. | |
| bool | send_data (uint8_t *data_ptr, uint16_t data_len, sn_nsdl_addr_s *address_ptr) |
| Sends data, to the connected sent to server. | |
| bool | start_listening_for_data () |
| Listens for incoming data from remote server. | |
| void | stop_listening () |
| Stops listening for incoming data. | |
| void | handle_connection_error (int error) |
| Error handling for DTLS connectivity. | |
| void | set_platform_network_handler (void *handler=NULL) |
| Sets the network interface handler that is used by client to connect to a network over IP. | |
| void | claim_mutex () |
| Claims mutex to prevent thread clashes in multithreaded environment. | |
| void | release_mutex () |
| Releases mutex to prevent thread clashes in multithreaded environment. | |
| void | receive_handler () |
| Callback handler for receiving data over socket. | |
| bool | is_handshake_ongoing () const |
| Returns true if DTLS handshake is still ongoing. | |
| void | send_socket_data () |
| Sends data to socket through event loop. | |
| void | send_socket_event (SocketEvent event_type) |
| This function is used for generating socket events. | |
| bool | address_resolver (void) |
| Does DNS resolving. | |
| void | event_handler (arm_event_s *event) |
| handler for eventloop events. | |
| void | force_close () |
| Closes the open connection. | |
| bool | send_event (SocketEvent event_type) |
| Internal helper for sending an event. | |
Detailed Description
This class handles the socket connection for LWM2M Client
Definition at line 41 of file m2mconnectionhandlerpimpl.h.
Constructor & Destructor Documentation
| M2MConnectionHandlerPimpl | ( | M2MConnectionHandler * | base, |
| M2MConnectionObserver & | observer, | ||
| M2MConnectionSecurity * | sec, | ||
| M2MInterface::BindingMode | mode, | ||
| M2MInterface::NetworkStack | stack | ||
| ) |
Constructor.
Definition at line 160 of file m2mconnectionhandlerpimpl.cpp.
Destructor.
Definition at line 209 of file m2mconnectionhandlerpimpl.cpp.
Member Function Documentation
| bool address_resolver | ( | void | ) |
Does DNS resolving.
Return true if DNS has been resolved or triggered though DNS thread.
| bool bind_connection | ( | const uint16_t | listen_port ) |
This binds the socket connection.
- Parameters:
-
listen_port Port to listen for incoming connection.
- Returns:
- true if successful else false.
Definition at line 227 of file m2mconnectionhandlerpimpl.cpp.
| void claim_mutex | ( | ) |
Claims mutex to prevent thread clashes in multithreaded environment.
| void event_handler | ( | arm_event_s * | event ) |
handler for eventloop events.
Note, this needs to be public as it is called from C wrapper.
Definition at line 65 of file m2mconnectionhandlerpimpl.cpp.
| void force_close | ( | ) |
Closes the open connection.
- Note:
- This must be called from the same event loop context!
| void handle_connection_error | ( | int | error ) |
Error handling for DTLS connectivity.
- Parameters:
-
error,Error code from TLS library
| bool is_handshake_ongoing | ( | ) | const |
Returns true if DTLS handshake is still ongoing.
| void receive_handler | ( | ) |
Callback handler for receiving data over socket.
| void release_mutex | ( | ) |
Releases mutex to prevent thread clashes in multithreaded environment.
| bool resolve_server_address | ( | const String & | server_address, |
| const uint16_t | server_port, | ||
| M2MConnectionObserver::ServerType | server_type, | ||
| const M2MSecurity * | security | ||
| ) |
This resolves the server address.
Output is returned through callback
- Parameters:
-
String server address. uint16_t Server port. ServerType,Server Type to be resolved.
- Returns:
- true if address is valid else false.
| bool send_data | ( | uint8_t * | data_ptr, |
| uint16_t | data_len, | ||
| sn_nsdl_addr_s * | address_ptr | ||
| ) |
Sends data, to the connected sent to server.
- Parameters:
-
data,Data to be sent.
| bool send_event | ( | SocketEvent | event_type ) |
Internal helper for sending an event.
Definition at line 233 of file m2mconnectionhandlerpimpl.cpp.
| void send_socket_data | ( | ) |
Sends data to socket through event loop.
| void send_socket_event | ( | SocketEvent | event_type ) |
This function is used for generating socket events.
Definition at line 139 of file m2mconnectionhandlerpimpl.cpp.
| void set_platform_network_handler | ( | void * | handler = NULL ) |
Sets the network interface handler that is used by client to connect to a network over IP.
- Parameters:
-
handler A network interface handler that is used by client to connect. This API is optional but provides a mechanism for different platforms to manage usage of underlying network interface by client.
| bool start_listening_for_data | ( | ) |
Listens for incoming data from remote server.
- Returns:
- true if successful else false.
| void stop_listening | ( | ) |
Stops listening for incoming data.
Generated on Tue Jul 12 2022 16:24:24 by
1.7.2