Mistake on this page? Email us
M2MInterface Class Referenceabstract

Public Types

enum  Error {
  ErrorNone = 0, AlreadyExists, BootstrapFailed, InvalidParameters,
  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)=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 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 resume(). More...
 
virtual void resume (void *iface, const M2MBaseList &object_list)=0
 Resumes client's timed functionality and network connection to the Cloud. Updates registration. Can be only called after a successful call to pause(). More...
 

Member Function Documentation

virtual void M2MInterface::bootstrap ( M2MSecurity security_object)
pure virtual

Initiates bootstrapping of the client with the provided Bootstrap Server information. NOTE: This API is not supported for developers!!

Parameters
security_objectA security object that contains information required for successful bootstrapping of the client.
virtual const char* M2MInterface::error_description ( ) const
pure virtual

Return error description for the latest error code.

Returns
Error description string
virtual const String M2MInterface::internal_endpoint_name ( ) const
pure virtual

Return internal endpoint name.

Returns
internal endpoint name
virtual void M2MInterface::pause ( )
pure virtual

Pauses client's timed functionality and closes network connection to the Cloud. After successful call the operation is continued by calling resume().

Note
This operation does not unregister client from the Cloud. Closes the socket and removes interface from the interface list.
virtual void M2MInterface::register_object ( M2MSecurity security_object,
const M2MBaseList list 
)
pure virtual

Initiates the registration of a provided security object to the corresponding LWM2M server.

Parameters
security_objectThe 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_listObjects that contain information about the client attempting to register to the LWM2M server.
virtual void M2MInterface::register_object ( M2MSecurity security_object,
const M2MObjectList object_list 
)
pure virtual

Initiates the registration of a provided security object to the corresponding LWM2M server.

Parameters
security_objectThe 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_listObjects that contain information about the client attempting to register to the LWM2M server.
virtual bool M2MInterface::remove_object ( M2MBase base)
pure virtual

Removes an object from M2MInterface. Does not call delete on the object though.

Returns
true if the object was found and false if the object was not found.
virtual void M2MInterface::resume ( void *  iface,
const M2MBaseList object_list 
)
pure virtual

Resumes client's timed functionality and network connection to the Cloud. Updates registration. Can be only called after a successful call to pause().

Parameters
ifaceA handler to the network interface.
object_listObjects that contain information about the resources to register to the LWM2M server.
virtual void M2MInterface::set_entropy_callback ( entropy_cb  callback)
pure virtual

Sets the function callback that is called by mbed Client to provide an entropy source from an application to ensure strong entropy.

Parameters
entropy_callbackA 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);
virtual void M2MInterface::set_platform_network_handler ( void *  handler = NULL)
pure virtual

Sets the network interface handler that is used by mbed Client to connect to a network over IP.

Parameters
handlerA 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.
virtual void M2MInterface::set_queue_sleep_handler ( callback_handler  handler)
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.

Parameters
callbackA function pointer that is called when the client goes to sleep.
virtual void M2MInterface::set_random_number_callback ( random_number_cb  callback)
pure virtual

Sets the function callback that is called by mbed Client to fetch a random number from an application to ensure strong entropy.

Parameters
random_callbackA function pointer that is called by mbed Client while performing a secure handshake. The function signature should be uint32_t (*random_number_callback)(void);
virtual bool M2MInterface::set_uri_query_parameters ( const char *  uri_query_params)
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.

Returns
False if maximum length exceeded otherwise True.
virtual void M2MInterface::unregister_object ( M2MSecurity security_object = NULL)
pure virtual

Unregisters the registered object from the LWM2M server.

Parameters
security_objectThe security object from which the device object needs to be unregistered. If there is only one LWM2M server registered, this parameter can be NULL.
virtual void M2MInterface::update_domain ( const String domain)
pure virtual

Updates the domain name.

Parameters
domainNew domain name
virtual void M2MInterface::update_endpoint ( const String name)
pure virtual

Updates the endpoint name.

Parameters
nameNew endpoint name
virtual void M2MInterface::update_registration ( M2MSecurity security_object,
const uint32_t  lifetime = 0 
)
pure virtual

Updates or refreshes the client's registration on the LWM2M server.

Parameters
security_objectA 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.
lifetimeThe lifetime of the endpoint client in seconds. If the same value has to be passed, set the default value to 0.
virtual void M2MInterface::update_registration ( M2MSecurity security_object,
const M2MBaseList list,
const uint32_t  lifetime = 0 
)
pure virtual

Updates or refreshes the client's registration on the LWM2M server. Use this function to publish new objects to LWM2M server.

Parameters
security_objectThe 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_listObjects that contain information about the client attempting to register to the LWM2M server.
lifetimeThe lifetime of the endpoint client in seconds. If the same value has to be passed, set the default value to 0.
virtual void M2MInterface::update_registration ( M2MSecurity security_object,
const M2MObjectList object_list,
const uint32_t  lifetime = 0 
)
pure virtual

Updates or refreshes the client's registration on the LWM2M server. Use this function to publish new objects to LWM2M server.

Parameters
security_objectThe 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_listObjects that contain information about the client attempting to register to the LWM2M server.
lifetimeThe lifetime of the endpoint client in seconds. If the same value has to be passed, set the default value to 0.

The documentation for this class was generated from the following file: