Tizen RT Public API  v1.0 D5
dm_lwm2m.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific
15  * language governing permissions and limitations under the License.
16  *
17  ****************************************************************************/
18 
31 #ifndef _DMAPI_H
32 #define _DMAPI_H
33 
34 #include "liblwm2m.h"
35 #include "er-coap-13/er-coap-13.h"
36 
37 #define IPADDRLEN_MAX 32
38 #define PORTLEN 6
39 
47 typedef enum {
48  DM_LWM2M_CLIENT_STARTED, DM_LWM2M_CLIENT_STOPPED,
50 
56  struct server_info_s {
57  char ipAddress[IPADDRLEN_MAX];
58  char port[PORTLEN];
59  bool isBootstrap;
60  } server_info;
61  struct client_info_s {
62  int lifetime;
63  } client_info;
64 };
65 
75 int dm_lwm2m_start_client(struct dm_lwm2m_context_s *dm_context);
76 
86 int dm_lwm2m_stop_client(void);
87 
96 int dm_lwm2m_get_server_address(char *server_ipAddr);
97 
106 int dm_lwm2m_get_server_port(char *server_port);
107 
116 int dm_lwm2m_get_client_lifetime(int *lifetime);
117 
127 
137 int dm_lwm2m_display_client_resource(char *buffer);
138 
139 #endif
140  // end of LWM2M group
int dm_lwm2m_get_server_port(char *server_port)
Get server port number.
int dm_lwm2m_start_client(struct dm_lwm2m_context_s *dm_context)
Start a DM client.
dm_lwm2m_client_state_e
Enumeration of dm client state.
Definition: dm_lwm2m.h:47
int dm_lwm2m_get_server_address(char *server_ipAddr)
Get server IP address.
Struct definition of DM context for a LWM2M session.
Definition: dm_lwm2m.h:55
int dm_lwm2m_get_client_lifetime(int *lifetime)
Get lifetime for a client.
int dm_lwm2m_display_client_resource(char *buffer)
Get client resource value.
int dm_lwm2m_stop_client(void)
Close a DM client.
int dm_lwm2m_get_client_state(dm_lwm2m_client_state_e *state)
Get state of client.