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
|
|
|
|
2018-11-26 11:06:55 +01:00
|
|
|
When running this example, you **must** define the RD server's IPv6 address
|
|
|
|
statically, using the `RD_ADDR` environment variable:
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|
2018-11-26 11:06:55 +01:00
|
|
|
RD_ADDR=\\\"abc:0815::123\\\" make all
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|
2018-11-26 11:06:55 +01:00
|
|
|
Per default, this is set to some random global address (`affe::1`) for compile
|
|
|
|
test reasons. So change it!
|
2017-07-25 11:38:16 +02:00
|
|
|
|
2018-11-26 11:06:55 +01:00
|
|
|
Additionally, you can change the RD server's port by overriding the `RD_PORT`
|
|
|
|
variable:
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|
2018-11-26 11:06:55 +01:00
|
|
|
RD_ADDR=\\\"affe::bee\\\" RD_PORT=12345 make all
|
2018-04-12 11:29:15 +02:00
|
|
|
```
|
2018-11-26 11:06:55 +01:00
|
|
|
|
|
|
|
The registration lifetime is set for demonstration purposes to a rather short
|
|
|
|
time of 60s in this example. You can easily override that value using the
|
|
|
|
`RD_LT` variable:
|
2018-04-12 11:29:15 +02:00
|
|
|
```
|
2018-11-26 11:06:55 +01:00
|
|
|
RD_ADDR=\\\"abc::def\\\" RD_LT=3600 make all ...
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|