Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FXAS21002 FXOS8700Q
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... | |
enum | Type |
The types of timer that can be created for mbed Client. More... | |
Public Member Functions | |
ConnectorClient (ConnectorClientCallback *callback) | |
Constructor. | |
~ConnectorClient () | |
Destructor. | |
bool | setup () |
Perform the second phase set up which is not possible from constructor. | |
void | start_bootstrap () |
Starts the bootstrap sequence from the Service Client. | |
void | start_registration (M2MBaseList *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 ConnectorClientEndpointInfo * | endpoint_info () const |
Returns pointer to the ConnectorClientEndpointInfo object. | |
void * | certificate_chain_handle () const |
Returns KCM Certificate chain handle pointer. | |
void | set_certificate_chain_handle (void *cert_handle) |
Sets the KCM certificate chain handle pointer. | |
const EstClient & | est_client () |
Get reference to the EST client instance. | |
void | bootstrap_again () |
Starts bootstrap sequence again. | |
virtual void | bootstrap_done (M2MSecurity *server_object) |
A callback indicating that the bootstap has been performed successfully. | |
virtual void | bootstrap_data_ready (M2MSecurity *security_object) |
A callback indicating when all bootstrap data has been received. | |
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 77 of file ConnectorClient.h.
Member Enumeration Documentation
An enum defining the different states of ConnectorClient during the client flow.
Definition at line 84 of file ConnectorClient.h.
enum Type [inherited] |
The types of timer that can be created for mbed Client.
Definition at line 30 of file m2mtimerobserver.h.
Constructor & Destructor Documentation
ConnectorClient | ( | ConnectorClientCallback * | callback ) |
Constructor.
- Parameters:
-
callback,A callback for the status from ConnectorClient.
Definition at line 222 of file ConnectorClient.cpp.
~ConnectorClient | ( | ) |
Destructor.
Definition at line 242 of file ConnectorClient.cpp.
Member Function Documentation
void bootstrap_again | ( | ) |
Starts bootstrap sequence again.
This will clean the old LwM2M credentials.
Definition at line 1380 of file ConnectorClient.cpp.
void bootstrap_data_ready | ( | M2MSecurity * | security_object ) | [virtual] |
A callback indicating when all bootstrap data has been received.
- Parameters:
-
security_object,The security object that contains the security information.
Definition at line 929 of file ConnectorClient.cpp.
void bootstrap_done | ( | M2MSecurity * | server_object ) | [virtual] |
A callback indicating that the bootstap has been performed successfully.
- Parameters:
-
server_object,The server 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 984 of file ConnectorClient.cpp.
void * certificate_chain_handle | ( | ) | const |
Returns KCM Certificate chain handle pointer.
- Returns:
- KCM Certificate chain handle pointer.
Definition at line 1370 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 1035 of file ConnectorClient.cpp.
const ConnectorClientEndpointInfo * endpoint_info | ( | ) | const |
Returns pointer to the ConnectorClientEndpointInfo object.
- Returns:
- ConnectorClientEndpointInfo pointer.
Definition at line 1207 of file ConnectorClient.cpp.
void error | ( | M2MInterface::Error | error ) | [virtual] |
A callback indicating that there was an error during the operation.
- Parameters:
-
error,An error code for the occurred error.
Definition at line 1005 of file ConnectorClient.cpp.
const EstClient & est_client | ( | ) |
Get reference to the EST client instance.
Definition at line 286 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,The key to get the value for. endpoint,The name 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 1062 of file ConnectorClient.cpp.
M2MInterface * m2m_interface | ( | ) |
Returns the M2MInterface handler.
- Returns:
- M2MInterface, Handled for M2MInterface.
Definition at line 340 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,The server object on which the device object is registered. The object ownership is passed. server_object,An object containing information about the LWM2M server. The client maintains the object.
Definition at line 990 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,The server object from which the device object is unregistered. The object ownership is passed.
Definition at line 995 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,The server object on which the device object registration is updated. The object ownership is passed. server_object,An object containing information about the LWM2M server. The client maintains the object.
Definition at line 1000 of file ConnectorClient.cpp.
void set_certificate_chain_handle | ( | void * | cert_handle ) |
Sets the KCM certificate chain handle pointer.
- Parameters:
-
cert_handle KCM Certificate chain handle.
Definition at line 1375 of file ConnectorClient.cpp.
bool setup | ( | ) |
Perform the second phase set up which is not possible from constructor.
This must be called successfully after constructor and before continuing to state machine.
- Returns:
- true, if success and instance is ready to use
Definition at line 250 of file ConnectorClient.cpp.
void start_bootstrap | ( | ) |
Starts the bootstrap sequence from the Service Client.
Definition at line 292 of file ConnectorClient.cpp.
void start_registration | ( | M2MBaseList * | client_objs ) |
Starts the registration sequence from the Service Client.
- Parameters:
-
client_objs,A list of objects implementing the M2MBase interface to be registered with Cloud.
Definition at line 313 of file ConnectorClient.cpp.
void update_registration | ( | ) |
Sends an update registration message to the LWM2M server.
Definition at line 345 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 1044 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,The object whose value is updated. type,The type of the object.
Definition at line 1029 of file ConnectorClient.cpp.
Generated on Tue Jul 12 2022 20:21:05 by
