Tizen RT Public API
v1.1 D4
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 <tinyara/config.h>
35
36
#ifdef CONFIG_LWM2M_WAKAAMA
37
#include <protocols/liblwm2m.h>
38
#include "er-coap-13/er-coap-13.h"
39
#else
40
#include <stdbool.h>
41
#endif
42
43
#define IPADDRLEN_MAX 32
44
#define PORTLEN 6
45
53
typedef
enum
{
54
DM_LWM2M_CLIENT_STARTED, DM_LWM2M_CLIENT_STOPPED,
55
}
dm_lwm2m_client_state_e
;
56
60
struct
server_info_s
{
61
char
ipAddress[IPADDRLEN_MAX];
62
char
port[PORTLEN];
63
bool
isBootstrap;
64
};
65
69
struct
client_info_s
{
70
int
lifetime;
71
};
72
76
struct
dm_lwm2m_context_s
{
77
struct
server_info_s
server_info;
78
struct
client_info_s
client_info;
79
};
80
91
int
dm_lwm2m_start_client
(
struct
dm_lwm2m_context_s
*dm_context);
92
102
int
dm_lwm2m_stop_client
(
void
);
103
113
int
dm_lwm2m_get_server_address
(
char
*server_ipAddr);
114
124
int
dm_lwm2m_get_server_port
(
char
*server_port);
125
135
int
dm_lwm2m_get_client_lifetime
(
int
*lifetime);
136
146
int
dm_lwm2m_get_client_state
(
dm_lwm2m_client_state_e
*state);
147
158
int
dm_lwm2m_display_client_resource
(
char
*buffer);
159
160
#endif
161
// end of LWM2M group
dm_lwm2m_get_server_port
int dm_lwm2m_get_server_port(char *server_port)
Get server port number.
dm_lwm2m_start_client
int dm_lwm2m_start_client(struct dm_lwm2m_context_s *dm_context)
Start a DM client.
dm_lwm2m_client_state_e
dm_lwm2m_client_state_e
Enumeration of dm client state.
Definition:
dm_lwm2m.h:53
dm_lwm2m_get_server_address
int dm_lwm2m_get_server_address(char *server_ipAddr)
Get server IP address.
dm_lwm2m_context_s
Specify DM context structure for a LWM2M session.
Definition:
dm_lwm2m.h:76
client_info_s
Specify LWM2M client information such as session lifetime.
Definition:
dm_lwm2m.h:69
dm_lwm2m_get_client_lifetime
int dm_lwm2m_get_client_lifetime(int *lifetime)
Get lifetime for a client.
dm_lwm2m_display_client_resource
int dm_lwm2m_display_client_resource(char *buffer)
Get client resource value.
server_info_s
Specify LWM2M server information such as ipaddress and port.
Definition:
dm_lwm2m.h:60
dm_lwm2m_stop_client
int dm_lwm2m_stop_client(void)
Close a DM client.
dm_lwm2m_get_client_state
int dm_lwm2m_get_client_state(dm_lwm2m_client_state_e *state)
Get state of client.
include
dm
dm_lwm2m.h
Generated by
1.8.14