Mistake on this page? Email us
dmc_connect_api.h File Reference

API for connecting Device Management Client to the backend service. More...

Go to the source code of this file.

Data Structures

struct  pdmc_endpoint_info_
 

Typedefs

typedef struct pdmc_endpoint_info_ pdmc_endpoint_info_s
 

Enumerations

enum  m2m_client_event_t { M2M_CLIENT_EVENT_SETUP_COMPLETED = 100, M2M_CLIENT_EVENT_NETWORK_SETUP_COMPLETED }
 

Functions

void pdmc_connect_init (uint8_t event_handler_id)
 Device Management Client connection initialization. This must be called before using other operations. More...
 
void pdmc_connect_deinit (void)
 Deinitialize Device Management Client.
 
void pdmc_connect_register (void *iface)
 Device Management Client registration. If necessary, initiates the internal update component and performs the bootstrap procedure automatically. More...
 
void pdmc_connect_register_update (void)
 Device Management Client updates register information to Device Management.
 
void pdmc_connect_close (void)
 Deregister from Device Management.
 
lwm2m_interface_t * pdmc_connect_get_interface (void)
 Get lwm2m_interface. This interface has an endpoint containing a registry that is a necessary parameter for most lwm2m_* calls. More...
 
int pdmc_connect_add_cloud_resource (registry_t *registry, registry_path_t *path, const uint16_t object, const uint16_t object_instance, const uint16_t resource, bool auto_observable, registry_callback_t callback)
 A helper function for adding Resources to Device Management (the Resources should be defined in oma_lwm2m_object_defs.c) More...
 
int pdmc_connect_add_cloud_resource_instance (registry_t *registry, registry_path_t *path, const uint16_t object, const uint16_t object_instance, const uint16_t resource, const uint16_t resource_instance, bool auto_observable, registry_callback_t callback)
 A helper function for adding Resource instances to Device Management (the Resources should be defined in oma_lwm2m_object_defs.c) More...
 
bool pdmc_connect_endpoint_info (pdmc_endpoint_info_s *endpoint_info)
 Get information on a connected endpoint. More...
 
bool pdmc_connect_get_endpoint_name (char *endpoint_name, size_t size)
 Get endpoint name. Can be called before connecting, but must only be called after pdmc_connect_init(). More...
 
bool pdmc_connect_get_device_id (char *device_id, size_t size)
 Get device id of a connected device. More...
 
void pdmc_connect_pause (void)
 Pause Device Management Client's timed functionality and close network connection to Device Management. After a successful call, you can continue the operation by calling resume(). More...
 
void pdmc_connect_resume (void *iface)
 Resume Device Management Client's timed functionality and network connection to Device Management. Updates registration. Can be only called after a successful call to pause(). More...
 

Detailed Description

API for connecting Device Management Client to the backend service.

Typedef Documentation

Structure holding endpoint information.

Enumeration Type Documentation

Interface event codes reported to the observer through the event_id field of the event.

Enumerator
M2M_CLIENT_EVENT_SETUP_COMPLETED 

Internal client setup completed.

M2M_CLIENT_EVENT_NETWORK_SETUP_COMPLETED 

Network setup completed.

Function Documentation

int pdmc_connect_add_cloud_resource ( registry_t *  registry,
registry_path_t path,
const uint16_t  object,
const uint16_t  object_instance,
const uint16_t  resource,
bool  auto_observable,
registry_callback_t  callback 
)

A helper function for adding Resources to Device Management (the Resources should be defined in oma_lwm2m_object_defs.c)

Parameters
registryA pointer to the registry (use pdmc_connect_get_interface after pdmc_connect_init to get the registry from the interface's endpoint.
pathThe path to the Resource. This will be populated with parameters object, object_instance and resource given to this function call.
objectRefers to the Object level in an OMA Object like "object/x/x", for example 300/0/0.
object_instanceRefers to the Object Instance level in an OMA Object like "x/object_instance/x", for example 300/1/0.
resourceRefers to the Resource level in OMA Object like "x/x/resource", for example 300/1/3.
auto_observableAuto observable Resources are updated to the service side automatically.
callbackA registry_callback_t type of a callback that will be notified on changes in a Resource.
Returns
1 in success.
int pdmc_connect_add_cloud_resource_instance ( registry_t *  registry,
registry_path_t path,
const uint16_t  object,
const uint16_t  object_instance,
const uint16_t  resource,
const uint16_t  resource_instance,
bool  auto_observable,
registry_callback_t  callback 
)

A helper function for adding Resource instances to Device Management (the Resources should be defined in oma_lwm2m_object_defs.c)

Parameters
registryA pointer to the registry (use pdmc_connect_get_interface after pdmc_connect_init to get the registry from the interface's endpoint.
pathThe path to the Resource. This will be populated with parameters object, object_instance and resource given to this function call.
objectRefers to the Object level in an OMA Object like "object/x/x", for example 300/0/0.
object_instanceRefers to the Object Instance level in an OMA Object like "x/object_instance/x", for example 300/1/0.
resourceRefers to the Resource level in OMA Object like "x/x/resource", for example 300/1/3.
resource_instanceRefers to the Resource instance level in OMA Object like "x/x/x/resource_instance", for example 300/1/3/4.
auto_observableAuto observable Resources are updated to the service side automatically.
callbackA registry_callback_t type of a callback that will be notified on changes in a Resource instances.
Returns
1 in success.
bool pdmc_connect_endpoint_info ( pdmc_endpoint_info_s endpoint_info)

Get information on a connected endpoint.

Parameters
endpoint_infoAfter a successfull call, points to pdmc_endpoint_info_s.
Returns
True in success, false in failure.
bool pdmc_connect_get_device_id ( char *  device_id,
size_t  size 
)

Get device id of a connected device.

Parameters
device_idOutput buffer that on a succesful call will contain the device id as a C string.
sizeThe size of the device_id buffer. Any data that doesn't fit will be discarded.
Returns
True in success, false in failure.
bool pdmc_connect_get_endpoint_name ( char *  endpoint_name,
size_t  size 
)

Get endpoint name. Can be called before connecting, but must only be called after pdmc_connect_init().

Parameters
endpoint_nameOutput buffer that on a succesful call will contain the endpoint name as a C string.
sizeThe size of the endpoint_name buffer. Any data that doesn't fit will be discarded.
Returns
True in success, false in failure.
lwm2m_interface_t* pdmc_connect_get_interface ( void  )

Get lwm2m_interface. This interface has an endpoint containing a registry that is a necessary parameter for most lwm2m_* calls.

Returns
pointer lwm2m_interface_t
void pdmc_connect_init ( uint8_t  event_handler_id)

Device Management Client connection initialization. This must be called before using other operations.

Parameters
event_handler_idAn ID for the event handler receiving event notifications from client status changes.
void pdmc_connect_pause ( void  )

Pause Device Management Client's timed functionality and close network connection to Device Management. After a successful call, you can continue the operation by calling resume().

Note
This operation does not deregister Device Management Client from Device Management. It closes the socket and removes the interface from the interface list.
void pdmc_connect_register ( void *  iface)

Device Management Client registration. If necessary, initiates the internal update component and performs the bootstrap procedure automatically.

Parameters
ifacePointer to the network interface.
void pdmc_connect_resume ( void *  iface)

Resume Device Management Client's timed functionality and network connection to Device Management. Updates registration. Can be only called after a successful call to pause().

Parameters
ifaceA handler to the network interface.