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

M2MInterfaceImpl Class Reference

M2MInterfaceImpl. More...

#include <m2minterfaceimpl.h>

Inherits M2MInterface, M2MNsdlObserver, M2MConnectionObserver, and M2MTimerObserver.

Public Types

enum  Error
 

Enum defining different kinds of errors that can occur during various client operations.

More...
enum  BindingMode
 

Enum defining different kinds of binding modes handled for client operations.

More...
enum  NetworkStack
 

Enum defining different kinds of network stacks that can be used by the mbed Client.

More...
enum  ServerType
 

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

More...

Public Member Functions

virtual ~M2MInterfaceImpl ()
 Destructor.
virtual void bootstrap (M2MSecurity *security)
 Initiates bootstrapping of the client with the provided Bootstrap server information.
virtual void cancel_bootstrap ()
 Cancels on going bootstrapping operation of the client.
virtual void register_object (M2MSecurity *security_object, const M2MObjectList &object_list)
 Initiates registration of the provided Security object to the corresponding LWM2M server.
virtual void update_registration (M2MSecurity *security_object, const uint32_t lifetime=0)
 Updates or refreshes the client's registration on the LWM2M server.
virtual void unregister_object (M2MSecurity *security=NULL)
 Unregisters the registered object from the LWM2M server.
virtual void set_queue_sleep_handler (callback_handler handler)
 Sets the function which will be called indicating client is going to sleep when the Binding mode is selected with Queue mode.

Protected Member Functions

virtual void coap_message_ready (uint8_t *data_ptr, uint16_t data_len, sn_nsdl_addr_s *address_ptr)
 Informs that coap message is ready.
virtual void client_registered (M2MServer *server_object)
 Informs that client is registered successfully.
virtual void registration_updated (const M2MServer &server_object)
 Informs that client registration is updated successfully.
virtual void registration_error (uint8_t error_code)
 Informs that some error occured during registration.
virtual void client_unregistered ()
 Informs that client is unregistered successfully.
virtual void bootstrap_done (M2MSecurity *security_object)
 Informs that client bootstrapping is done.
virtual void bootstrap_error ()
 Informs that some error occured during bootstrapping.
virtual void coap_data_processed ()
 Informs that received data has been processed.
virtual void value_updated (M2MBase *base)
 Callback informing that the value of the resource object is updated by server.
virtual void data_available (uint8_t *data, uint16_t data_size, const M2MConnectionObserver::SocketAddress &address)
 Indicates that data is available from socket.
virtual void socket_error (uint8_t error_code)
 Indicates an error occured in socket.
virtual void address_ready (const M2MConnectionObserver::SocketAddress &address, M2MConnectionObserver::ServerType server_type, const uint16_t server_port)
 Indicates that the server address resolving is ready.
virtual void data_sent ()
 Indicates that data has been sent successfully.
virtual void timer_expired (M2MTimerObserver::Type type)
 Indicates that the time has expired.

Friends

class M2MInterfaceFactory

Detailed Description

M2MInterfaceImpl.

This class implements handling of all mbed Client Interface operations defined in OMA LWM2M specifications. This includes Bootstrapping, Client Registration, Device Management & Service Enablement and Information Reporting.

Definition at line 39 of file m2minterfaceimpl.h.


Member Enumeration Documentation

enum BindingMode [inherited]

Enum defining different kinds of binding modes handled for client operations.

Definition at line 66 of file m2minterface.h.

enum Error [inherited]

Enum defining different kinds of errors that can occur during various client operations.

Definition at line 48 of file m2minterface.h.

enum NetworkStack [inherited]

Enum defining different kinds of network stacks that can be used by the mbed Client.

Definition at line 81 of file m2minterface.h.

enum ServerType [inherited]

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

Definition at line 35 of file m2mconnectionobserver.h.


Constructor & Destructor Documentation

~M2MInterfaceImpl (  ) [virtual]

Destructor.

Definition at line 82 of file m2minterfaceimpl.cpp.


Member Function Documentation

void address_ready ( const M2MConnectionObserver::SocketAddress address,
M2MConnectionObserver::ServerType  server_type,
const uint16_t  server_port 
) [protected, virtual]

Indicates that the server address resolving is ready.

Parameters:
address,Resolvedsocket address.
server_type,Typeof server.
server_port,Portof the resolved server address.

Implements M2MConnectionObserver.

Definition at line 349 of file m2minterfaceimpl.cpp.

void bootstrap ( M2MSecurity security ) [virtual]

Initiates bootstrapping of the client with the provided Bootstrap server information.

Parameters:
security_object,Securityobject which contains information required for successful bootstrapping of the client.

Implements M2MInterface.

Definition at line 92 of file m2minterfaceimpl.cpp.

void bootstrap_done ( M2MSecurity security_object ) [protected, virtual]

Informs that client bootstrapping is done.

Parameters:
security_object,M2MSecurityObject which contains information about LWM2M server fetched from bootstrap server.

Implements M2MNsdlObserver.

Definition at line 300 of file m2minterfaceimpl.cpp.

void bootstrap_error (  ) [protected, virtual]

Informs that some error occured during bootstrapping.

Implements M2MNsdlObserver.

Definition at line 307 of file m2minterfaceimpl.cpp.

void cancel_bootstrap (  ) [virtual]

Cancels on going bootstrapping operation of the client.

If the client has already successfully bootstrapped then this function deletes existing bootstrap information from the client.

Implements M2MInterface.

Definition at line 126 of file m2minterfaceimpl.cpp.

void client_registered ( M2MServer server_object ) [protected, virtual]

Informs that client is registered successfully.

Parameters:
server_object,Serverobject associated with registered server.

Implements M2MNsdlObserver.

Definition at line 268 of file m2minterfaceimpl.cpp.

void client_unregistered (  ) [protected, virtual]

Informs that client is unregistered successfully.

Implements M2MNsdlObserver.

Definition at line 292 of file m2minterfaceimpl.cpp.

void coap_data_processed (  ) [protected, virtual]

Informs that received data has been processed.

Implements M2MNsdlObserver.

Definition at line 314 of file m2minterfaceimpl.cpp.

void coap_message_ready ( uint8_t *  data_ptr,
uint16_t  data_len,
sn_nsdl_addr_s address_ptr 
) [protected, virtual]

Informs that coap message is ready.

Parameters:
data_ptr,Dataobject of coap message.
data_len,Lengthof the data object.
address_ptr,Addressstructure of the server.

Implements M2MNsdlObserver.

Definition at line 255 of file m2minterfaceimpl.cpp.

void data_available ( uint8_t *  data,
uint16_t  data_size,
const M2MConnectionObserver::SocketAddress address 
) [protected, virtual]

Indicates that data is available from socket.

Parameters:
data,Thedata read from the socket.
data_size,Thelength of the data read from the socket.
address,Addressof the server where the data is coming from.

Implements M2MConnectionObserver.

Definition at line 329 of file m2minterfaceimpl.cpp.

void data_sent (  ) [protected, virtual]

Indicates that data has been sent successfully.

Implements M2MConnectionObserver.

Definition at line 366 of file m2minterfaceimpl.cpp.

void register_object ( M2MSecurity security_object,
const M2MObjectList &  object_list 
) [virtual]

Initiates registration of the provided Security object to the corresponding LWM2M server.

Parameters:
security_object,Securityobject which contains information required for registering to the LWM2M server. If client wants to register to multiple LWM2M servers then it has call this function once for each of LWM2M server object separately.
object_list,Objectswhich contains information which the client want to register to the LWM2M server.

Implements M2MInterface.

Definition at line 131 of file m2minterfaceimpl.cpp.

void registration_error ( uint8_t  error_code ) [protected, virtual]

Informs that some error occured during registration.

Parameters:
error_code,Errorcode for registration error

Implements M2MNsdlObserver.

Definition at line 285 of file m2minterfaceimpl.cpp.

void registration_updated ( const M2MServer server_object ) [protected, virtual]

Informs that client registration is updated successfully.

Parameters:
server_object,Serverobject associated with registered server.

Implements M2MNsdlObserver.

Definition at line 277 of file m2minterfaceimpl.cpp.

void set_queue_sleep_handler ( callback_handler  handler ) [virtual]

Sets the function which will be called indicating client is going to sleep when the Binding mode is selected with Queue mode.

Parameters:
callback,Functionpointer which will be called when client goes to seleep.

Implements M2MInterface.

Definition at line 249 of file m2minterfaceimpl.cpp.

void socket_error ( uint8_t  error_code ) [protected, virtual]

Indicates an error occured in socket.

Parameters:
error_code,Errorcode from socket, it cannot be used any further.

Implements M2MConnectionObserver.

Definition at line 341 of file m2minterfaceimpl.cpp.

void timer_expired ( M2MTimerObserver::Type  type ) [protected, virtual]

Indicates that the time has expired.

Parameters:
type,Typeof timer that has expired.

Implements M2MTimerObserver.

Definition at line 381 of file m2minterfaceimpl.cpp.

void unregister_object ( M2MSecurity security = NULL ) [virtual]

Unregisters the registered object from the LWM2M server.

Parameters:
security_object,Securityobject from which the device object needs to be unregistered, if there is only one LWM2M server registered then this parameter can be NULL.

Implements M2MInterface.

Definition at line 217 of file m2minterfaceimpl.cpp.

void update_registration ( M2MSecurity security_object,
const uint32_t  lifetime = 0 
) [virtual]

Updates or refreshes the client's registration on the LWM2M server.

Parameters:
security_object,Securityobject from which the device object needs to update registration, if there is only one LWM2M server registered then this parameter can be NULL.
lifetime,Lifetimefor the endpoint client in seconds.

Implements M2MInterface.

Definition at line 174 of file m2minterfaceimpl.cpp.

void value_updated ( M2MBase base ) [protected, virtual]

Callback informing that the value of the resource object is updated by server.

Parameters:
baseObject whose value is updated.

Implements M2MNsdlObserver.

Definition at line 320 of file m2minterfaceimpl.cpp.