Simulated product dispenser
Fork of mbed-cloud-workshop-connect-HTS221 by
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 (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. | |
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 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
ConnectorClient | ( | ConnectorClientCallback * | callback ) |
Constructor.
- Parameters:
-
callback,A callback for the status from ConnectorClient.
Definition at line 213 of file ConnectorClient.cpp.
~ConnectorClient | ( | ) |
Destructor.
Definition at line 246 of file ConnectorClient.cpp.
Member Function Documentation
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 832 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 896 of file ConnectorClient.cpp.
void * certificate_chain_handle | ( | ) | const |
Returns KCM Certificate chain handle pointer.
- Returns:
- KCM Certificate chain handle pointer.
Definition at line 1342 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 953 of file ConnectorClient.cpp.
const ConnectorClientEndpointInfo * endpoint_info | ( | ) | const |
Returns pointer to the ConnectorClientEndpointInfo object.
- Returns:
- ConnectorClientEndpointInfo pointer.
Definition at line 1189 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 917 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 985 of file ConnectorClient.cpp.
M2MInterface * m2m_interface | ( | ) |
Returns the M2MInterface handler.
- Returns:
- M2MInterface, Handled for M2MInterface.
Definition at line 292 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 902 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 907 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 912 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 1347 of file ConnectorClient.cpp.
void start_bootstrap | ( | ) |
Starts the bootstrap sequence from the Service Client.
Definition at line 254 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 272 of file ConnectorClient.cpp.
void update_registration | ( | ) |
Sends an update registration message to the LWM2M server.
Definition at line 297 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 967 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 947 of file ConnectorClient.cpp.
Generated on Tue Jul 12 2022 19:12:19 by 1.7.2