Simple interface for Mbed Cloud Client
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. | |
void | address_resolver (void) |
Does DNS resolving, called by dns_thread. | |
void | event_handler (arm_event_s *event) |
handler for eventloop events. |
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 158 of file m2mconnectionhandlerpimpl.cpp.
Destructor.
Definition at line 205 of file m2mconnectionhandlerpimpl.cpp.
Member Function Documentation
void address_resolver | ( | void | ) |
Does DNS resolving, called by dns_thread.
Definition at line 261 of file m2mconnectionhandlerpimpl.cpp.
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 230 of file m2mconnectionhandlerpimpl.cpp.
void claim_mutex | ( | ) |
Claims mutex to prevent thread clashes in multithreaded environment.
Definition at line 805 of file m2mconnectionhandlerpimpl.cpp.
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 64 of file m2mconnectionhandlerpimpl.cpp.
void handle_connection_error | ( | int | error ) |
Error handling for DTLS connectivity.
- Parameters:
-
error,Error code from TLS library
Definition at line 663 of file m2mconnectionhandlerpimpl.cpp.
bool is_handshake_ongoing | ( | ) | const |
Returns true if DTLS handshake is still ongoing.
Definition at line 723 of file m2mconnectionhandlerpimpl.cpp.
void receive_handler | ( | ) |
Callback handler for receiving data over socket.
Definition at line 728 of file m2mconnectionhandlerpimpl.cpp.
void release_mutex | ( | ) |
Releases mutex to prevent thread clashes in multithreaded environment.
Definition at line 810 of file m2mconnectionhandlerpimpl.cpp.
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.
Definition at line 299 of file m2mconnectionhandlerpimpl.cpp.
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.
Definition at line 496 of file m2mconnectionhandlerpimpl.cpp.
void send_socket_data | ( | ) |
Sends data to socket through event loop.
Definition at line 563 of file m2mconnectionhandlerpimpl.cpp.
void send_socket_event | ( | SocketEvent | event_type ) |
This function is used for generating socket events.
Definition at line 137 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.
Definition at line 669 of file m2mconnectionhandlerpimpl.cpp.
bool start_listening_for_data | ( | ) |
Listens for incoming data from remote server.
- Returns:
- true if successful else false.
Definition at line 651 of file m2mconnectionhandlerpimpl.cpp.
void stop_listening | ( | ) |
Stops listening for incoming data.
Definition at line 656 of file m2mconnectionhandlerpimpl.cpp.
Generated on Tue Jul 12 2022 19:01:39 by 1.7.2