Mistake on this page? Email us
M2MConnectionObserver Class Referenceabstract

Data Structures

struct  SocketAddress
 The M2MSocketAddress struct. A unified container for holding socket address data across different platforms. More...
 

Public Types

enum  ServerType { Bootstrap, LWM2MServer }
 
enum  NetworkInterfaceStatus { NetworkInterfaceConnected, NetworkInterfaceDisconnected }
 

Public Member Functions

virtual void data_available (uint8_t *data, uint16_t data_size, const M2MConnectionObserver::SocketAddress &address)=0
 Indicates that data is available from socket. More...
 
virtual void socket_error (int error_code, bool retry=true)=0
 Indicates an error occured in socket. More...
 
virtual void address_ready (const M2MConnectionObserver::SocketAddress &address, M2MConnectionObserver::ServerType server_type, const uint16_t server_port)=0
 Indicates that the server address resolving is ready. More...
 
virtual void data_sent ()=0
 Indicates that data has been sent successfully.
 
virtual void network_interface_status_change (NetworkInterfaceStatus status)=0
 

Member Enumeration Documentation

, Defines the type of the server that the client wants to use.

Member Function Documentation

virtual void M2MConnectionObserver::address_ready ( const M2MConnectionObserver::SocketAddress address,
M2MConnectionObserver::ServerType  server_type,
const uint16_t  server_port 
)
pure virtual

Indicates that the server address resolving is ready.

Parameters
addressThe resolved socket address.
server_typeThe type of the server.
server_portThe port of the resolved server address.
virtual void M2MConnectionObserver::data_available ( uint8_t *  data,
uint16_t  data_size,
const M2MConnectionObserver::SocketAddress address 
)
pure virtual

Indicates that data is available from socket.

Parameters
dataThe data read from the socket.
data_sizeThe length of the data read from the socket.
addressThe address of the server where the data is coming from.
virtual void M2MConnectionObserver::socket_error ( int  error_code,
bool  retry = true 
)
pure virtual

Indicates an error occured in socket.

Parameters
error_codeThe error code from socket, it cannot be used any further.
retryIndicates whether to re-establish the connection.

The documentation for this class was generated from the following file: