16 #ifndef M2M_CONNECTION_HANDLER_H__ 17 #define M2M_CONNECTION_HANDLER_H__ 22 #include "nsdl-c/sn_nsdl.h" 25 class M2MConnectionHandlerPimpl;
43 CONNECTION_ERROR_WANTS_READ = -2,
44 CONNECTION_ERROR_WANTS_WRITE = -3,
45 SSL_PEER_CLOSE_NOTIFY = -4,
46 MEMORY_ALLOCATION_FAILED = -5,
47 SSL_CONNECTION_ERROR = -6,
48 SOCKET_READ_ERROR = -7,
49 SOCKET_SEND_ERROR = -8,
51 DNS_RESOLVING_ERROR = -10,
52 SSL_HANDSHAKE_ERROR = -11,
53 FAILED_TO_READ_CREDENTIALS = -12,
89 const uint16_t server_port,
102 sn_nsdl_addr_s *address_ptr);
156 M2MConnectionHandlerPimpl *_private_impl;
158 friend class Test_M2MConnectionHandler;
159 friend class Test_M2MConnectionHandler_mbed;
160 friend class Test_M2MConnectionHandler_linux;
161 friend class M2MConnection_TestObserver;
164 #endif //M2M_CONNECTION_HANDLER_H__ ServerType
Definition: m2mconnectionobserver.h:35
Definition: m2mconnectionhandler.h:32
~M2MConnectionHandler()
Destructor.
void unregister_network_handler()
Unregisters the network interface handler that is set in 'set_platform_network_handler'.
bool start_listening_for_data()
Listens to the incoming data from a remote server.
void release_mutex()
Releases mutex to prevent thread clashes in multithreaded environment.
BindingMode
An enum defining different kinds of binding modes handled for client operations.
Definition: m2minterface.h:114
Definition: m2msecurity.h:31
M2MInterface. This class provides an interface for handling all mbed Client interface operations defi...
Definition: m2mstring.h:33
NetworkStack
An enum defining different kinds of network stacks that can be used by mbed Client.
Definition: m2minterface.h:131
ConnectionError
Definition: m2mconnectionhandler.h:40
Definition: m2mconnectionsecurity.h:36
void force_close()
Closes the open connection.
void stop_listening()
Stops listening to the incoming data.
bool bind_connection(const uint16_t listen_port)
This binds the socket connection.
void claim_mutex()
Claims mutex to prevent thread clashes in multithreaded environment.
File defining all system build time configuration used by mbed-client.
bool send_data(uint8_t *data_ptr, uint16_t data_len, sn_nsdl_addr_s *address_ptr)
Sends data to the connected server.
void handle_connection_error(int error)
Error handling for DTLS connectivity.
Definition: m2mconnectionobserver.h:26
void set_platform_network_handler(void *handler=NULL)
Sets the network interface handler that is used by the client to connect to a network over IP...
M2MConnectionHandler(M2MConnectionObserver &observer, M2MConnectionSecurity *sec, M2MInterface::BindingMode mode, M2MInterface::NetworkStack stack)
Constructor.
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. The output is returned through a callback.
M2MConnectionObserver. The observer class for passing the socket activity to the state machine...