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

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 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.
virtual void set_platform_network_handler (void *handler=NULL)
 Sets the network interface handler that is used by client to connect to a network over IP.
virtual void set_random_number_callback (random_number_cb callback)
 Sets the function callback that will be called by mbed-client for fetching random number from application for ensuring strong entropy.
virtual void set_entropy_callback (entropy_cb callback)
 Sets the function callback that will be called by mbed-client for providing entropy source from application for ensuring strong entropy.

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, bool retry=false)
 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, bool retry=true)
 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 timer 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 41 of file m2minterfaceimpl.h.


Member Enumeration Documentation

enum BindingMode [inherited]

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

Definition at line 68 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 mbed Client.

Definition at line 83 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 96 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:
addressThe resolved socket address.
server_typeThe type of the server.
server_portThe port of the resolved server address.

Implements M2MConnectionObserver.

Definition at line 468 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 110 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 357 of file m2minterfaceimpl.cpp.

void bootstrap_error (  ) [protected, virtual]

Informs that some error occured during bootstrapping.

Implements M2MNsdlObserver.

Definition at line 367 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 148 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 320 of file m2minterfaceimpl.cpp.

void client_unregistered (  ) [protected, virtual]

Informs that client is unregistered successfully.

Implements M2MNsdlObserver.

Definition at line 349 of file m2minterfaceimpl.cpp.

void coap_data_processed (  ) [protected, virtual]

Informs that received data has been processed.

Implements M2MNsdlObserver.

Definition at line 377 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 305 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:
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.

Implements M2MConnectionObserver.

Definition at line 392 of file m2minterfaceimpl.cpp.

void data_sent (  ) [protected, virtual]

Indicates that data has been sent successfully.

Implements M2MConnectionObserver.

Definition at line 485 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 155 of file m2minterfaceimpl.cpp.

void registration_error ( uint8_t  error_code,
bool  retry = false 
) [protected, virtual]

Informs that some error occured during registration.

Parameters:
error_code,Errorcode for registration error
retry,Indicatesstate machine to re-establish connection

Implements M2MNsdlObserver.

Definition at line 337 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 330 of file m2minterfaceimpl.cpp.

void set_entropy_callback ( entropy_cb  callback ) [virtual]

Sets the function callback that will be called by mbed-client for providing entropy source from application for ensuring strong entropy.

Parameters:
entropy_callbackA function pointer that will be called by mbed-client while performing secure handshake. Function signature , if using mbed-client-mbedtls should be int (*mbedtls_entropy_f_source_ptr)(void *data, unsigned char *output, size_t len, size_t *olen);

Implements M2MInterface.

Definition at line 290 of file m2minterfaceimpl.cpp.

void set_platform_network_handler ( void *  handler = NULL ) [virtual]

Sets the network interface handler that is used by client to connect to a network over IP.

Parameters:
handlerA network interface handler that is used by client to connect. This API is optional but provides a mechanism for different platforms to manage usage of underlying network interface by client.

Implements M2MInterface.

Definition at line 297 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 277 of file m2minterfaceimpl.cpp.

void set_random_number_callback ( random_number_cb  callback ) [virtual]

Sets the function callback that will be called by mbed-client for fetching random number from application for ensuring strong entropy.

Parameters:
random_callbackA function pointer that will be called by mbed-client while performing secure handshake. Function signature should be uint32_t (*random_number_callback)(void);

Implements M2MInterface.

Definition at line 283 of file m2minterfaceimpl.cpp.

void socket_error ( uint8_t  error_code,
bool  retry = true 
) [protected, 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.

Implements M2MConnectionObserver.

Definition at line 404 of file m2minterfaceimpl.cpp.

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

Indicates that the timer has expired.

Parameters:
typeThe type of the timer that has expired.

Implements M2MTimerObserver.

Definition at line 501 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 245 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 198 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 383 of file m2minterfaceimpl.cpp.