Mistake on this page? Email us
dmc_connect_api.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // Copyright 2019-2020 ARM Ltd.
3 //
4 // SPDX-License-Identifier: Apache-2.0
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
11 //
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
17 // ----------------------------------------------------------------------------
18 
19 #ifndef __DMC_CONNECT_API_H__
20 #define __DMC_CONNECT_API_H__
21 
26 #ifndef MBED_CONF_MBED_CLIENT_ENABLE_CPP_API
27 
28 #include "lwm2m_interface.h"
29 #include "lwm2m_registry.h"
30 
31 #ifdef MBED_CLOUD_CLIENT_SUPPORT_UPDATE
32 #include "dmc_update_api.h"
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
43 typedef enum {
47 
51 typedef struct pdmc_endpoint_info_ {
52  char endpoint_name[MAX_ALLOWED_STRING_LENGTH];
53  char device_id[MAX_ALLOWED_STRING_LENGTH];
55 
56 /***
57  * The normal sequence of use:
58  * -# pdmc_connect_init
59  * -# lwm2m_interface_t* if = pdmc_connect_get_interface
60  * -# registry_t* reg = &if.endpoint.registry
61  * -# pdmc_connect_add_cloud_resource(reg, ...)
62  * -# pdmc_connect_register
63  * See also `lwm2m_registry.h` for relevant value modification functions.
64 **/
65 
70 void pdmc_connect_init(uint8_t event_handler_id);
71 
75 void pdmc_connect_deinit(void);
76 
81 void pdmc_connect_register(void* iface);
82 
87 
91 void pdmc_connect_close(void);
92 
98 lwm2m_interface_t *pdmc_connect_get_interface(void);
99 
112 int pdmc_connect_add_cloud_resource(registry_t *registry, registry_path_t *path,
113  const uint16_t object, const uint16_t object_instance, const uint16_t resource,
114  bool auto_observable, registry_callback_t callback);
115 
122 
131 void pdmc_connect_pause(void);
132 
140 void pdmc_connect_resume(void *iface);
141 
142 #endif // MBED_CONF_MBED_CLIENT_ENABLE_CPP_API
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif // __DMC_CONNECT_API_H__
149 
void pdmc_connect_init(uint8_t event_handler_id)
Device Management Client connection initialization. This must be called before using other operations...
lwm2m_interface_t * pdmc_connect_get_interface(void)
Get lwm2m_interface. This interface has an endpoint containing a registry that is a necessary paramet...
Internal client setup completed.
Definition: dmc_connect_api.h:44
Describes the path of an item in the LwM2M Object registry.
Definition: lwm2m_types.h:159
struct pdmc_endpoint_info_ pdmc_endpoint_info_s
m2m_client_event_t
Definition: dmc_connect_api.h:43
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_l...
void pdmc_connect_close(void)
Deregister from Device Management.
void pdmc_connect_resume(void *iface)
Resume Device Management Client's timed functionality and network connection to Device Management...
void pdmc_connect_pause(void)
Pause Device Management Client's timed functionality and close network connection to Device Managemen...
bool pdmc_connect_endpoint_info(pdmc_endpoint_info_s *endpoint_info)
Get information on a connected endpoint.
void pdmc_connect_register(void *iface)
Device Management Client registration. If necessary, initiates the internal update component and perf...
Network setup completed.
Definition: dmc_connect_api.h:45
Definition: dmc_connect_api.h:51
Update-related Device Management Client API functions.
void pdmc_connect_register_update(void)
Device Management Client updates register information to Device Management.
void pdmc_connect_deinit(void)
Deinitialize Device Management Client.