Timothy Beight / Mbed 2 deprecated 6_songs-from-the-cloud

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of 6_songs-from-the-cloud by MakingMusicWorkshop

Embed: (wiki syntax)

« Back to documentation index

M2MConnectionHandlerPimpl Class Reference

M2MConnectionHandlerPimpl Class Reference

M2MConnectionHandlerPimpl. More...

#include <m2mconnectionhandlerpimpl.h>

Public Member Functions

 M2MConnectionHandlerPimpl (M2MConnectionHandler *base, M2MConnectionObserver &observer, M2MConnectionSecurity *sec, M2MInterface::BindingMode mode, M2MInterface::NetworkStack stack)
 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.
int send_to_socket (const unsigned char *buf, size_t len)
 send_to_socket Sends directly to socket.
int receive_from_socket (unsigned char *buf, size_t len)
 receive_from_socket Receives directly from a socket.
void handle_connection_error (int error)
 Error handling for DTLS connectivity.

Detailed Description

M2MConnectionHandlerPimpl.

This class handles the socket connection for LWM2M Client

Definition at line 44 of file m2mconnectionhandlerpimpl.h.


Constructor & Destructor Documentation

Destructor.

Definition at line 70 of file m2mconnectionhandlerpimpl.cpp.


Member Function Documentation

bool bind_connection ( const uint16_t  listen_port )

This binds the socket connection.

Parameters:
listen_portPort to listen for incoming connection.
Returns:
true if successful else false.

Definition at line 93 of file m2mconnectionhandlerpimpl.cpp.

void handle_connection_error ( int  error )

Error handling for DTLS connectivity.

Parameters:
error,Errorcode from TLS library

Definition at line 250 of file m2mconnectionhandlerpimpl.cpp.

int receive_from_socket ( unsigned char *  buf,
size_t  len 
)

receive_from_socket Receives directly from a socket.

This is used by security classes to receive raw data to be decrypted.

Parameters:
bufBuffer to send
lenLength of a buffer
Returns:
Number of bytes read or -1 if failed.

Definition at line 233 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:
Stringserver address.
uint16_tServer port.
ServerType,ServerType to be resolved.
Returns:
true if address is valid else false.

Definition at line 98 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,Datato be sent.

Definition at line 165 of file m2mconnectionhandlerpimpl.cpp.

int send_to_socket ( const unsigned char *  buf,
size_t  len 
)

send_to_socket Sends directly to socket.

This is used by security classes to send after data has been encrypted.

Parameters:
bufBuffer to send
lenLength of a buffer
Returns:
Number of bytes sent or -1 if failed

Definition at line 224 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 187 of file m2mconnectionhandlerpimpl.cpp.

void stop_listening (  )

Stops listening for incoming data.

Definition at line 193 of file m2mconnectionhandlerpimpl.cpp.