Toyomasa Watarai / simple-mbed-cloud-client

Dependents:  

Embed: (wiki syntax)

« Back to documentation index

ConnectorClient Class Reference

ConnectorClient Class Reference

ConnectorClient This class is an interface towards the M2MInterface client to handle all data flow towards Connector through this client. More...

#include <ConnectorClient.h>

Inherits M2MInterfaceObserver, and M2MTimerObserver.

Public Types

enum  StartupSubStateRegistration
 

An enum defining the different states of ConnectorClient during the client flow.

More...

Public Member Functions

 ConnectorClient (ConnectorClientCallback *callback)
 Constructor.
 ~ConnectorClient ()
 Destructor.
void start_bootstrap ()
 Starts the bootstrap sequence from the Service Client.
void start_registration (M2MObjectList *client_objs)
 Starts the registration sequence from the Service Client.
void update_registration ()
 Sends an update registration message to the LWM2M server.
M2MInterface * m2m_interface ()
 Returns the M2MInterface handler.
bool use_bootstrap ()
 Checks whether to use Bootstrap or direct Connector mode.
bool connector_credentials_available ()
 Checks whether to go connector registration flow.
bool get_key (const char *key, const char *endpoint, char *&key_name)
 A utility function to generate the key name.
const ConnectorClientEndpointInfoendpoint_info () const
 Returns pointer to the ConnectorClientEndpointInfo object.
virtual void bootstrap_done (M2MSecurity *server_object)
 A callback indicating that the bootstap has been performed successfully.
virtual void object_registered (M2MSecurity *security_object, const M2MServer &server_object)
 A callback indicating that the device object has been registered successfully with the LWM2M server.
virtual void object_unregistered (M2MSecurity *server_object)
 A callback indicating that the device object has been successfully unregistered from the LWM2M server.
virtual void registration_updated (M2MSecurity *security_object, const M2MServer &server_object)
 A callback indicating that the device object registration has been successfully updated on the LWM2M server.
virtual void error (M2MInterface::Error error)
 A callback indicating that there was an error during the operation.
virtual void value_updated (M2MBase *base, M2MBase::BaseType type)
 A callback indicating that the value of the resource object is updated by the server.

Detailed Description

ConnectorClient This class is an interface towards the M2MInterface client to handle all data flow towards Connector through this client.

This class is intended to be used via ServiceClient, not directly. This class contains also the bootstrap functionality.

Definition at line 64 of file ConnectorClient.h.


Member Enumeration Documentation

An enum defining the different states of ConnectorClient during the client flow.

Definition at line 71 of file ConnectorClient.h.


Constructor & Destructor Documentation

Constructor.

Parameters:
callback,Acallback for the status from ConnectorClient.

Definition at line 45 of file ConnectorClient.cpp.

Destructor.

Definition at line 70 of file ConnectorClient.cpp.


Member Function Documentation

void bootstrap_done ( M2MSecurity *  server_object ) [virtual]

A callback indicating that the bootstap has been performed successfully.

Parameters:
server_object,Theserver object that contains the information fetched about the LWM2M server from the bootstrap server. This object can be used to register with the LWM2M server. The object ownership is passed.

Definition at line 535 of file ConnectorClient.cpp.

bool connector_credentials_available (  )

Checks whether to go connector registration flow.

Returns:
True if connector credentials available otherwise false.

Definition at line 645 of file ConnectorClient.cpp.

const ConnectorClientEndpointInfo * endpoint_info (  ) const

Returns pointer to the ConnectorClientEndpointInfo object.

Returns:
ConnectorClientEndpointInfo pointer.

Definition at line 856 of file ConnectorClient.cpp.

void error ( M2MInterface::Error  error ) [virtual]

A callback indicating that there was an error during the operation.

Parameters:
error,Anerror code for the occurred error.

Definition at line 604 of file ConnectorClient.cpp.

bool get_key ( const char *  key,
const char *  endpoint,
char *&  key_name 
)

A utility function to generate the key name.

Parameters:
key,Thekey to get the value for.
endpoint,Thename of the endpoint to be appended to the key.
key_name,The[OUT] final key name.
Returns:
True if available, else false.

Definition at line 678 of file ConnectorClient.cpp.

M2MInterface * m2m_interface (  )

Returns the M2MInterface handler.

Returns:
M2MInterface, Handled for M2MInterface.

Definition at line 118 of file ConnectorClient.cpp.

void object_registered ( M2MSecurity *  security_object,
const M2MServer &  server_object 
) [virtual]

A callback indicating that the device object has been registered successfully with the LWM2M server.

Parameters:
security_object,Theserver object on which the device object is registered. The object ownership is passed.
server_object,Anobject containing information about the LWM2M server. The client maintains the object.

Definition at line 589 of file ConnectorClient.cpp.

void object_unregistered ( M2MSecurity *  server_object ) [virtual]

A callback indicating that the device object has been successfully unregistered from the LWM2M server.

Parameters:
server_object,Theserver object from which the device object is unregistered. The object ownership is passed.

Definition at line 594 of file ConnectorClient.cpp.

void registration_updated ( M2MSecurity *  security_object,
const M2MServer &  server_object 
) [virtual]

A callback indicating that the device object registration has been successfully updated on the LWM2M server.

Parameters:
security_object,Theserver object on which the device object registration is updated. The object ownership is passed.
server_object,Anobject containing information about the LWM2M server. The client maintains the object.

Definition at line 599 of file ConnectorClient.cpp.

void start_bootstrap (  )

Starts the bootstrap sequence from the Service Client.

Definition at line 77 of file ConnectorClient.cpp.

void start_registration ( M2MObjectList *  client_objs )

Starts the registration sequence from the Service Client.

Parameters:
client_objs,Alist of objects to be registered with Cloud.

Definition at line 93 of file ConnectorClient.cpp.

void update_registration (  )

Sends an update registration message to the LWM2M server.

Definition at line 123 of file ConnectorClient.cpp.

bool use_bootstrap (  )

Checks whether to use Bootstrap or direct Connector mode.

Returns:
True if bootstrap mode, False if direct Connector flow

Definition at line 659 of file ConnectorClient.cpp.

void value_updated ( M2MBase *  base,
M2MBase::BaseType  type 
) [virtual]

A callback indicating that the value of the resource object is updated by the server.

Parameters:
base,Theobject whose value is updated.
type,Thetype of the object.

Definition at line 639 of file ConnectorClient.cpp.