This is the Doxygen-generated API documentation for Device Management Client. Use it together with Device Management documentation.
Device Management Client allows developers to create client side applications that connect to Device Management, with features as described in the Lightweight Machine to Machine Technical Specification (LwM2M).
These APIs enable you to:
- Manage devices.
- Securely communicate with internet services over the industry standard TLS/DTLS.
- Use factory-flashed or developer credentials to create a unique device identity.
- Fully control the endpoint and application logic from the service side.
- Update devices over-the-air remotely from the service side.
- Have a unified porting layer for porting to different platforms.
The C++ API allows quick application development.
Device Management Client C++ API
Device Management Client C++ API is essentially constructed around following classes, their base classes and derivatives:
Device Management Client follows the architecture specified by LwM2M.
M2MResourceInstance are C++ classes that represent what LwM2M specifies as Object, Object Instance, Resouce and Resource Instance.
M2MInterface is the core LwM2M client, as it handles communication of all four interfaces specified by LwM2M.
MbedCloudClient is the main application interface that encapsulates
M2MInterface and provides easier API for a developer.
The public API contains these header files:
This process shows how you can create a client-based application.
- Create a
MbedCloudClient object and register certain callbacks with it:
- Define your own resources:
M2MObject *object = M2MInterfaceFactory::create_object(name);
M2MObjectInstance* object_instance = object->create_object_instance(instance_id);
M2MResource* resource = object_instance->create_dynamic_resource(name, resource_type, data_type, observable);
resource->set_value((const unsigned char*)value, strlen(value));
MbedCloudClient::add_objects() to add LwM2M objects to the client:
- Give a platform-specific pointer to the client (it uses this as its network interface):
This initiates the client and starts its state machine.
The rest of the application logic works through various callbacks. A real life example would be more complex than this simplified view. Please refer to any of the provided Device Management Client examples.
For API usage, refer to the class descriptions.