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.
M2MInterfaceImpl Class Reference
#include <m2minterfaceimpl.h>
Inherits M2MInterface, M2MNsdlObserver, M2MConnectionObserver, and M2MTimerObserver.
Public Types | |
enum | Error |
An enum defining different kinds of errors that can occur during various client operations. More... | |
enum | BindingMode |
An enum defining different kinds of binding modes handled for client operations. More... | |
enum | NetworkStack |
An 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 | update_registration (M2MSecurity *security_object, const M2MObjectList &object_list, 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_wait (M2MSecurity *security_object) |
Informs that client bootstrapping is waiting for message to be sent. | |
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. |
Detailed Description
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] |
An enum defining different kinds of binding modes handled for client operations.
Definition at line 68 of file m2minterface.h.
enum Error [inherited] |
An enum defining different kinds of errors that can occur during various client operations.
Definition at line 48 of file m2minterface.h.
enum NetworkStack [inherited] |
An enum defining different kinds of network stacks that can be used by mbed Client.
Definition at line 85 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 90 of file m2minterfaceimpl.cpp.
Member Function Documentation
void bootstrap | ( | M2MSecurity * | security ) | [virtual] |
Initiates bootstrapping of the client with the provided Bootstrap server information.
- Parameters:
-
security_object Security object which contains information required for successful bootstrapping of the client.
Definition at line 99 of file m2minterfaceimpl.cpp.
void bootstrap_done | ( | M2MSecurity * | security_object ) | [protected, virtual] |
Informs that client bootstrapping is done.
- Parameters:
-
security_object,M2MSecurity Object which contains information about LWM2M server fetched from bootstrap server.
Implements M2MNsdlObserver.
Definition at line 323 of file m2minterfaceimpl.cpp.
void bootstrap_error | ( | ) | [protected, virtual] |
Informs that some error occured during bootstrapping.
Implements M2MNsdlObserver.
Definition at line 345 of file m2minterfaceimpl.cpp.
void bootstrap_wait | ( | M2MSecurity * | security_object ) | [protected, virtual] |
Informs that client bootstrapping is waiting for message to be sent.
- Parameters:
-
security_object,M2MSecurity Object which contains information about LWM2M server fetched from bootstrap server.
Implements M2MNsdlObserver.
Definition at line 336 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.
Definition at line 141 of file m2minterfaceimpl.cpp.
void client_registered | ( | M2MServer * | server_object ) | [protected, virtual] |
Informs that client is registered successfully.
- Parameters:
-
server_object,Server object associated with registered server.
Implements M2MNsdlObserver.
Definition at line 286 of file m2minterfaceimpl.cpp.
void client_unregistered | ( | ) | [protected, virtual] |
Informs that client is unregistered successfully.
Implements M2MNsdlObserver.
Definition at line 315 of file m2minterfaceimpl.cpp.
void coap_data_processed | ( | ) | [protected, virtual] |
Informs that received data has been processed.
Implements M2MNsdlObserver.
Definition at line 356 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,Data object of coap message. data_len,Length of the data object. address_ptr,Address structure of the server.
Implements M2MNsdlObserver.
Definition at line 269 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 Security object 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 Objects which contains information which the client want to register to the LWM2M server.
Definition at line 148 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,Error code for registration error retry,Indicates state machine to re-establish connection
Implements M2MNsdlObserver.
Definition at line 303 of file m2minterfaceimpl.cpp.
void registration_updated | ( | const M2MServer & | server_object ) | [protected, virtual] |
Informs that client registration is updated successfully.
- Parameters:
-
server_object,Server object associated with registered server.
Implements M2MNsdlObserver.
Definition at line 296 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_callback A 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);
Definition at line 256 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:
-
handler A 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.
Definition at line 263 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 A function pointer that will be called when client goes to sleep.
Definition at line 243 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_callback A function pointer that will be called by mbed-client while performing secure handshake. Function signature should be uint32_t (*random_number_callback)(void);
Definition at line 249 of file m2minterfaceimpl.cpp.
void unregister_object | ( | M2MSecurity * | security = NULL ) |
[virtual] |
Unregisters the registered object from the LWM2M server.
- Parameters:
-
security_object Security object from which the device object needs to be unregistered. If there is only one LWM2M server registered this parameter can be NULL.
Definition at line 210 of file m2minterfaceimpl.cpp.
void update_registration | ( | M2MSecurity * | security_object, |
const M2MObjectList & | object_list, | ||
const uint32_t | lifetime = 0 |
||
) | [virtual] |
Updates or refreshes the client's registration on the LWM2M server.
Use this function to publish new objects to LWM2M server.
- Parameters:
-
security_object The security object from which the device object needs to update the registration. If there is only one LWM2M server registered, this parameter can be NULL. object_list Objects that contain information about the client attempting to register to the LWM2M server. lifetime The lifetime of the endpoint client in seconds. If the same value has to be passed, set the default value to 0.
Definition at line 198 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 Security object from which the device object needs to update registration, if there is only one LWM2M server registered then this parameter can be NULL. lifetime Lifetime for the endpoint client in seconds.
Definition at line 189 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:
-
base Object whose value is updated.
Implements M2MNsdlObserver.
Definition at line 362 of file m2minterfaceimpl.cpp.
Generated on Tue Jul 12 2022 21:20:34 by
