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... | |
API for connecting Device Management Client to the backend service.
| typedef struct pdmc_endpoint_info_ pdmc_endpoint_info_s |
Structure holding endpoint information.
| enum m2m_client_event_t |
| 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)
| registry | A pointer to the registry (use pdmc_connect_get_interface after pdmc_connect_init to get the registry from the interface's endpoint. |
| path | The path to the Resource. This will be populated with parameters object, object_instance and resource given to this function call. |
| object | Refers to the Object level in an OMA Object like "object/x/x", for example 300/0/0. |
| object_instance | Refers to the Object Instance level in an OMA Object like "x/object_instance/x", for example 300/1/0. |
| resource | Refers to the Resource level in OMA Object like "x/x/resource", for example 300/1/3. |
| auto_observable | Auto observable Resources are updated to the service side automatically. |
| callback | A registry_callback_t type of a callback that will be notified on changes in a Resource. |
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)
| registry | A pointer to the registry (use pdmc_connect_get_interface after pdmc_connect_init to get the registry from the interface's endpoint. |
| path | The path to the Resource. This will be populated with parameters object, object_instance and resource given to this function call. |
| object | Refers to the Object level in an OMA Object like "object/x/x", for example 300/0/0. |
| object_instance | Refers to the Object Instance level in an OMA Object like "x/object_instance/x", for example 300/1/0. |
| resource | Refers to the Resource level in OMA Object like "x/x/resource", for example 300/1/3. |
| resource_instance | Refers to the Resource instance level in OMA Object like "x/x/x/resource_instance", for example 300/1/3/4. |
| auto_observable | Auto observable Resources are updated to the service side automatically. |
| callback | A registry_callback_t type of a callback that will be notified on changes in a Resource instances. |
1 in success. | bool pdmc_connect_endpoint_info | ( | pdmc_endpoint_info_s * | endpoint_info | ) |
Get information on a connected endpoint.
| endpoint_info | After a successfull call, points to pdmc_endpoint_info_s. |
| bool pdmc_connect_get_device_id | ( | char * | device_id, |
| size_t | size | ||
| ) |
Get device id of a connected device.
| device_id | Output buffer that on a succesful call will contain the device id as a C string. |
| size | The size of the device_id buffer. Any data that doesn't fit will be discarded. |
| 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().
| endpoint_name | Output buffer that on a succesful call will contain the endpoint name as a C string. |
| size | The size of the endpoint_name buffer. Any data that doesn't fit will be discarded. |
| 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.
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.
| event_handler_id | An 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().
| void pdmc_connect_register | ( | void * | iface | ) |
Device Management Client registration. If necessary, initiates the internal update component and performs the bootstrap procedure automatically.
| iface | Pointer 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().
| iface | A handler to the network interface. |