forked from eclipse-wakaama/wakaama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
137 lines (111 loc) · 5.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
Wakaama (formerly liblwm2m) is an implementation of the Open Mobile Alliance's LightWeight M2M
protocol (LWM2M).
Source Layout
-------------
-+- core (the LWM2M engine)
| |
| +- er-coap-13 (Erbium's CoAP engine from
| http://people.inf.ethz.ch/mkovatsc/erbium.php, modified
| to run on linux)
|
+- platforms (example ports on various platforms)
|
+- tests (example and test applications)
|
+- bootstrap_server (a command-line LWM2M bootstrap server)
|
+- client (a command-line LWM2M client with several test objects)
|
+- lightclient (a very simple command-line LWM2M client with several test objects)
|
+- misc (application unit-testing miscellaneous utility functions of the core)
|
+- server (a command-line LWM2M server)
|
+- TLV (application decoding two hard-coded TLV buffers)
|
+- unittests (various unit tests using the CUnit framework)
|
+- utils (utility functions for connection handling and command-
line interface)
Compiling
---------
Despite its name, liblwm2m is not a library but files to be built with an
application. liblwm2m uses CMake. Look at tests/server/CMakeLists.txt for an
example of how to include it.
Several compilation switches are used:
- LWM2M_BIG_ENDIAN if your target platform uses big-endian format.
- LWM2M_LITTLE_ENDIAN if your target platform uses little-endian format.
- LWM2M_CLIENT_MODE to enable LWM2M Client interfaces.
- LWM2M_SERVER_MODE to enable LWM2M Server interfaces.
- LWM2M_BOOTSTRAP_SERVER_MODE to enable LWM2M Bootstrap Server interfaces.
- LWM2M_BOOTSTRAP to enable LWM2M Bootstrap support in a LWM2M Client.
- LWM2M_SUPPORT_JSON to enable JSON payload support (implicit when defining LWM2M_SERVER_MODE)
Depending on your platform, you need to define LWM2M_BIG_ENDIAN or LWM2M_LITTLE_ENDIAN.
LWM2M_CLIENT_MODE and LWM2M_SERVER_MODE can be defined at the same time.
Testing
-------
To compile the test server
- - - - - - - - - - - - -
In the any directory, run the following commands:
cmake [liblwm2m directory]/tests/server
make
./lwm2mserver
The lwm2mserver listens on UDP port 5683. It features a basic command line
interface. Type 'help' for a list of supported commands.
To compile the test client
- - - - - - - - - - - - -
In the any directory, run the following commands:
cmake [liblwm2m directory]/tests/client
make
./lwm2mclient [Options]
The lwm2mclient features nine LWM2M objects:
- Security Object (id: 0)
- Server Object (id: 1)
- Access Control Object (id: 2) as a skeleton
- Device Object (id: 3) containing hard-coded values from the Example LWM2M
Client of Appendix E of the LWM2M Technical Specification.
- Connectivity Monitoring Object (id: 2) as a skeleton
- Firmware Update Object (id: 5) as a skeleton.
- Location Object (id: 6) as a skeleton.
- Connectivity Statistics Object (id: 7) as a skeleton.
- a test object (id: 1024) with the following description:
Multiple
Object | ID | Instances | Mandatoty |
Test | 1024 | Yes | No |
Ressources:
Supported Multiple
Name | ID | Operations | Instances | Mandatory | Type | Range |
test | 1 | R/W | No | Yes | Integer | 0-255 |
exec | 2 | E | No | Yes | | |
dec | 3 | R/W | No | Yes | Float | |
The lwm2mclient opens udp port 56830 and tries to register to a LWM2M Server at
127.0.0.1:5683. It features a basic command line interface. Type 'help' for a
list of supported commands.
Options are:
-n NAME Set the endpoint name of the Client. Default: testlwm2mclient
-l PORT Set the local UDP port of the Client. Default: 56830
-h HOST Set the hostname of the LWM2M Server to connect to. Default: localhost
-p HOST Set the port of the LWM2M Server to connect to. Default: 5683
-t TIME Set the lifetime of the Client. Default: 300
-b Bootstrap requested.
-c Change battery level over time.
To launch a bootstrap session:
./lwm2mclient -b
To compile a simpler test client
- - - - - - - - - - - - - - - -
In the any directory, run the following commands:
cmake [liblwm2m directory]/tests/lightclient
make
./lightclient [Options]
The lightclient is much simpler that the lwm2mclient and features only four
LWM2M objects:
- Security Object (id: 0)
- Server Object (id: 1)
- Device Object (id: 3) containing hard-coded values from the Example LWM2M
Client of Appendix E of the LWM2M Technical Specification.
- Test object (id: 1024) from the lwm2mclient as described above.
The lightclient does not feature any command-line interface.
Options are:
-n NAME Set the endpoint name of the Client. Default: testlightclient
-l PORT Set the local UDP port of the Client. Default: 56830