joey shelton / LED_Demo

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

M2MConnectionObserver Class Reference

M2MConnectionObserver Class Reference

M2MConnectionObserver Observer class for informing socket activity to the state machine. More...

#include <m2mconnectionobserver.h>

Inherited by M2MInterfaceImpl, TestObserver, TestObserver, and TestObserver.

Data Structures

struct  SocketAddress
 The M2MSocketAddress struct. More...

Public Types

enum  ServerType
 

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

More...

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.
virtual void socket_error (uint8_t error_code, bool retry=true)=0
 Indicates an error occured in socket.
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.
virtual void data_sent ()=0
 Indicates that data has been sent successfully.

Detailed Description

M2MConnectionObserver Observer class for informing socket activity to the state machine.

Definition at line 26 of file m2mconnectionobserver.h.


Member Enumeration Documentation

enum ServerType

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

Definition at line 35 of file m2mconnectionobserver.h.


Member Function Documentation

virtual void 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.

Implemented in M2MInterfaceImpl.

virtual void 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.

Implemented in M2MInterfaceImpl.

virtual void data_sent (  ) [pure virtual]

Indicates that data has been sent successfully.

Implemented in M2MInterfaceImpl.

virtual void socket_error ( uint8_t  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 connection.

Implemented in M2MInterfaceImpl.