16 #ifndef M2M_CONNECTION_HANDLER_H__ 17 #define M2M_CONNECTION_HANDLER_H__ 22 #include "nsdl-c/sn_nsdl.h" 25 class M2MConnectionHandlerPimpl;
41 CONNECTION_ERROR_WANTS_READ = -2,
42 CONNECTION_ERROR_WANTS_WRITE = -3,
43 SSL_PEER_CLOSE_NOTIFY = -4,
44 MEMORY_ALLOCATION_FAILED = -5,
45 SSL_CONNECTION_ERROR = -6,
46 SOCKET_READ_ERROR = -7,
47 SOCKET_SEND_ERROR = -8,
49 DNS_RESOLVING_ERROR = -10,
50 SSL_HANDSHAKE_ERROR = -11,
51 FAILED_TO_READ_CREDENTIALS = -12,
100 const uint16_t server_port,
103 bool is_server_ping =
false);
114 sn_nsdl_addr_s *address_ptr);
192 void set_cid_value(
const uint8_t *data_ptr,
const size_t data_len);
197 M2MConnectionHandlerPimpl *_private_impl;
199 friend class Test_M2MConnectionHandler;
200 friend class Test_M2MConnectionHandler_mbed;
201 friend class Test_M2MConnectionHandler_linux;
202 friend class M2MConnection_TestObserver;
205 #endif //M2M_CONNECTION_HANDLER_H__ ServerType
Definition: m2mconnectionobserver.h:33
Definition: m2mconnectionhandler.h:30
~M2MConnectionHandler()
Destructor.
void unregister_network_handler()
Unregisters the network interface handler that is set in 'set_platform_network_handler'.
void store_cid()
Stores CID persistently for DTLS connections.
bool resolve_server_address(const String &server_address, const uint16_t server_port, M2MConnectionObserver::ServerType server_type, const M2MSecurity *security, bool is_server_ping=false)
This resolves the server address. The output is returned through a callback.
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.
void set_cid_value(const uint8_t *data_ptr, const size_t data_len)
Internal test function. Set CID for current tls session.
BindingMode
An enum defining different kinds of binding modes handled for client operations.
Definition: m2minterface.h:121
Definition: m2msecurity.h:31
NetworkStack
An enum defining different kinds of network stacks that can be used by mbed Client.
Definition: m2minterface.h:138
ConnectionError
Definition: m2mconnectionhandler.h:38
Definition: m2mconnectionsecurity.h:36
void remove_cid()
Removes CID for DTLS connections.
SocketPriority
Definition: m2mconnectionhandler.h:60
void force_close()
Closes the open connection.
void stop_listening()
Stops listening to the incoming data.
bool is_cid_available()
Status of CID availability in client.
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.
bool set_socket_priority(M2MConnectionHandler::SocketPriority priority)
Set socket priority.
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:24
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.
header for M2MConnectionObserver.