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
|
2024-10-18 14:56:20 +02:00
|
|
|
RFC 9176, section 5.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
|
|
|
```
|
2020-07-17 11:50:34 +02:00
|
|
|
RD_ADDR=\\\"[abc:0815::123]\\\" make all
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|
2020-07-17 11:50:34 +02:00
|
|
|
Per default, this is set to some random global address (`[affe::1]`) for compile
|
2018-11-26 11:06:55 +01:00
|
|
|
test reasons. So change it!
|
2017-07-25 11:38:16 +02:00
|
|
|
|
2020-07-17 11:50:34 +02:00
|
|
|
Additionally, you can change the RD server's port by specifying it like so:
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|
2020-07-17 11:50:34 +02:00
|
|
|
RD_ADDR=\\\"[affe::bee]: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
|
|
|
```
|
2020-07-17 11:50:34 +02:00
|
|
|
RD_ADDR=\\\"[abc::def]\\\" RD_LT=3600 make all ...
|
2017-07-25 11:38:16 +02:00
|
|
|
```
|