#include <m2minterface.h>
Public Types | |
enum | Error { ErrorNone = 0, AlreadyExists, BootstrapFailed, InvalidParameters, InvalidCertificates, NotRegistered, Timeout, NetworkError, ResponseParseFailed, UnknownError, MemoryFail, NotAllowed, SecureConnectionFailed, DnsResolvingFailed, UnregistrationFailed, ESTEnrollmentFailed, FailedToStoreCredentials, FailedToReadCredentials } |
An enum defining different kinds of errors that can occur during various client operations. | |
enum | BindingMode { NOT_SET = 0, UDP = 0x01, UDP_QUEUE = 0x03, SMS = 0x04, SMS_QUEUE = 0x06, UDP_SMS_QUEUE = 0x07, TCP = 0x09, TCP_QUEUE = 0x0b } |
An enum defining different kinds of binding modes handled for client operations. | |
enum | NetworkStack { Uninitialized = 0, LwIP_IPv4, LwIP_IPv6, Reserved, Nanostack_IPv6, ATWINC_IPv4, Unknown } |
An enum defining different kinds of network stacks that can be used by mbed Client. | |
Public Member Functions | |
virtual void | bootstrap (M2MSecurity *security_object)=0 |
Initiates bootstrapping of the client with the provided Bootstrap Server information. NOTE: This API is not supported for developers!! More... | |
virtual void | cancel_bootstrap ()=0 |
Cancels an ongoing bootstrapping operation of the client. If the client has already successfully bootstrapped, this function deletes the existing bootstrap information from the client. NOTE: This API is not supported for developers!! | |
virtual void | finish_bootstrap ()=0 |
Finishes bootstrap in cases where client will be the one to finish it. | |
virtual void | register_object (M2MSecurity *security_object, const M2MBaseList &list, bool full_registration=false)=0 |
Initiates the registration of a provided security object to the corresponding LWM2M server. More... | |
virtual void | register_object (M2MSecurity *security_object, const M2MObjectList &object_list)=0 |
Initiates the registration of a provided security object to the corresponding LWM2M server. More... | |
virtual bool | remove_object (M2MBase *base)=0 |
Removes an object from M2MInterface. Does not call delete on the object though. More... | |
virtual void | update_registration (M2MSecurity *security_object, const uint32_t lifetime=0)=0 |
Updates or refreshes the client's registration on the LWM2M server. More... | |
virtual void | update_registration (M2MSecurity *security_object, const M2MBaseList &list, const uint32_t lifetime=0)=0 |
Updates or refreshes the client's registration on the LWM2M server. Use this function to publish new objects to LWM2M server. More... | |
virtual void | update_registration (M2MSecurity *security_object, const M2MObjectList &object_list, const uint32_t lifetime=0)=0 |
Updates or refreshes the client's registration on the LWM2M server. Use this function to publish new objects to LWM2M server. More... | |
virtual void | unregister_object (M2MSecurity *security_object=NULL)=0 |
Unregisters the registered object from the LWM2M server. More... | |
virtual void | set_queue_sleep_handler (callback_handler handler)=0 |
Sets the function that is called for indicating that the client is going to sleep when the binding mode is selected with queue mode. More... | |
virtual void | set_random_number_callback (random_number_cb callback)=0 |
Sets the function callback that is called by mbed Client to fetch a random number from an application to ensure strong entropy. More... | |
virtual void | set_entropy_callback (entropy_cb callback)=0 |
Sets the function callback that is called by mbed Client to provide an entropy source from an application to ensure strong entropy. More... | |
virtual void | set_platform_network_handler (void *handler=NULL)=0 |
Sets the network interface handler that is used by mbed Client to connect to a network over IP. More... | |
virtual void | set_platform_network_handler (void *handler=NULL, bool credentials_available=0)=0 |
Sets the network interface handler that is used by client to connect to a network over IP. More... | |
virtual void | update_endpoint (const String &name)=0 |
Updates the endpoint name. More... | |
virtual void | update_domain (const String &domain)=0 |
Updates the domain name. More... | |
virtual const String | internal_endpoint_name () const =0 |
Return internal endpoint name. More... | |
virtual const char * | error_description () const =0 |
Return error description for the latest error code. More... | |
virtual void | get_data_request (DownloadType type, const char *uri, const size_t offset, const bool async, get_data_cb, get_data_error_cb, void *context)=0 |
Sends the CoAP GET request to the server. Download type. Uri path to the data. Data offset. In async mode application must call this API again with the updated offset. If set to false then client will automatically download the whole package. Callback which is triggered once there is data available. Callback which is trigged in case of any error. | |
virtual void | post_data_request (const char *uri, const bool async, const uint16_t payload_len, uint8_t *payload_ptr, get_data_cb data_cb, get_data_error_cb error_cb, void *context)=0 |
Sends the CoAP POST request to the server. Uri path to the data. In async mode application must call this API again with the updated offset. If set to false then client will automatically download the whole package. Length of payload. , Pointer to payload buffer. Callback which is triggered once there is data available. Callback which is trigged in case of any error. | |
virtual bool | set_uri_query_parameters (const char *uri_query_params)=0 |
Set custom uri query paramaters used in LWM2M registration. Uri query params. Parameters must be in key-value format: "a=100&b=200". Maximum length can be up to 64 bytes. More... | |
virtual void | pause ()=0 |
Pauses client's timed functionality and closes network connection to the Cloud. After successful call the operation is continued by calling register_object(). More... | |
virtual void | alert ()=0 |
Sets client into an alert mode. More... | |
virtual nsdl_s * | get_nsdl_handle () const =0 |
Get ndsl handle. More... | |
virtual M2MServer * | get_m2mserver () const =0 |
Returns M2MServer handle. More... | |
virtual uint16_t | stagger_wait_time (bool boostrap) const =0 |
virtual void | set_cid_value (const uint8_t *data_ptr, const size_t data_len)=0 |
Internal test function. Set CID for current tls session. More... | |
This class handles LwM2M Client logic related to communicating with all four interfaces defined in LwM2M.
LwM2M defines four interfaces:
|
pure virtual |
Sets client into an alert mode.
|
pure virtual |
Initiates bootstrapping of the client with the provided Bootstrap Server information. NOTE: This API is not supported for developers!!
security_object | A security object that contains information required for successful bootstrapping of the client. |
|
pure virtual |
Return error description for the latest error code.
|
pure virtual |
|
pure virtual |
Get ndsl handle.
|
pure virtual |
Return internal endpoint name.
|
pure virtual |
Pauses client's timed functionality and closes network connection to the Cloud. After successful call the operation is continued by calling register_object().
|
pure virtual |
Initiates the registration of a provided security object to the corresponding LWM2M server.
security_object | The security object that contains information required for registering to the LWM2M server. If the client wants to register to multiple LWM2M servers, it must call this function once for each of the LWM2M server objects separately. |
object_list | Objects that contain information about the client attempting to register to the LWM2M server. |
full_registration | If True client will perform full registration and not just register update. |
|
pure virtual |
Initiates the registration of a provided security object to the corresponding LWM2M server.
security_object | The security object that contains information required for registering to the LWM2M server. If the client wants to register to multiple LWM2M servers, it must call this function once for each of the LWM2M server objects separately. |
object_list | Objects that contain information about the client attempting to register to the LWM2M server. |
|
pure virtual |
Removes an object from M2MInterface. Does not call delete on the object though.
|
pure virtual |
Internal test function. Set CID for current tls session.
data_ptr | CID |
data_len | length of the CID |
|
pure virtual |
Sets the function callback that is called by mbed Client to provide an entropy source from an application to ensure strong entropy.
entropy_callback | A function pointer that is called by mbed Client while performing a 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); |
|
pure virtual |
Sets the network interface handler that is used by mbed Client to connect to a network over IP.
handler | A network interface handler that is used by mbed Client to connect. This API is optional but it provides a mechanism for different platforms to manage the usage of underlying network interface by the client. |
|
pure virtual |
Sets the network interface handler that is used by client to connect to a network over IP.
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. |
credentials_available | This extra parameter allows the client to further optimize its internal connection logic in high latency networks when dynamic handling of network staggering is supported. (Platform-dependent). |
|
pure virtual |
Sets the function that is called for indicating that the client is going to sleep when the binding mode is selected with queue mode.
callback | A function pointer that is called when the client goes to sleep. |
|
pure virtual |
Sets the function callback that is called by mbed Client to fetch a random number from an application to ensure strong entropy.
random_callback | A function pointer that is called by mbed Client while performing a secure handshake. The function signature should be uint32_t (*random_number_callback)(void); |
|
pure virtual |
Set custom uri query paramaters used in LWM2M registration. Uri query params. Parameters must be in key-value format: "a=100&b=200". Maximum length can be up to 64 bytes.
|
pure virtual |
Unregisters the registered object from the LWM2M server.
security_object | The security object from which the device object needs to be unregistered. If there is only one LWM2M server registered, this parameter can be NULL. |
|
pure virtual |
Updates the domain name.
domain | New domain name |
|
pure virtual |
Updates the endpoint name.
name | New endpoint name |
|
pure virtual |
Updates or refreshes the client's registration on the LWM2M server.
security_object | A 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. |
lifetime | The lifetime of the endpoint client in seconds. If the same value has to be passed, set the default value to 0. |
|
pure virtual |
Updates or refreshes the client's registration on the LWM2M server. Use this function to publish new objects to LWM2M server.
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. |
|
pure virtual |
Updates or refreshes the client's registration on the LWM2M server. Use this function to publish new objects to LWM2M server.
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. |