2018-10-15 10:53:41 +02:00
|
|
|
CoRE Resource Directory: Simple Endpoint Example
|
|
|
|
================================================
|
2017-07-25 11:38:16 +02:00
|
|
|
|
|
|
|
This example shows how a node can register with a CoRE resource directory using
|
2018-10-15 10:53:41 +02:00
|
|
|
the simple registration procedure as described in
|
|
|
|
draft-ietf-core-resource-directory-15, section 5.3.1.
|
2017-07-25 11:38:16 +02:00
|
|
|
|
|
|
|
The registration process needs an endpoint name as well as a lifetime for the
|
2018-10-15 10:53:41 +02:00
|
|
|
registry entry. These are statically defined during compile time and you can
|
|
|
|
edit these values by overriding `CORD_EP` and `CORD_LT`:
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|
2018-10-15 10:53:41 +02:00
|
|
|
CFLAGS="-DCORD_LT=\"7200\" -DCORD_EP=\"MyNode\"" make all
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Per default, the node is looking for the CoRE RD at the all nodes link-local
|
|
|
|
multicast address [FF02::1]:5683. To change the target address or port, simply
|
2018-04-12 11:29:15 +02:00
|
|
|
override the `RD_ADDR` and `RD_PORT` variables, e.g.:
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|
2018-04-12 11:29:15 +02:00
|
|
|
RD_ADDR=\\\"::1\\\" RD_PORT=12345 make all
|
|
|
|
```
|
|
|
|
or
|
|
|
|
```
|
|
|
|
RD_ADDR=\\\"abc:0815::123\\\" make all
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|