mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
examples/rdcli_simple: rename to cord_epsim
This commit is contained in:
parent
226b9fa383
commit
5668100dc3
@ -1,5 +1,5 @@
|
||||
# name of your application
|
||||
APPLICATION = rdcli_simple
|
||||
APPLICATION = cord_epsim
|
||||
|
||||
# If no BOARD is found in the environment, use this default:
|
||||
BOARD ?= native
|
||||
@ -40,8 +40,8 @@ RD_LT ?= 60
|
||||
RD_ADDR ?= \"ff02::1\"
|
||||
RD_PORT ?= 5683
|
||||
|
||||
CFLAGS += -DRDCLI_LT=$(RD_LT)
|
||||
CFLAGS += -DRDCLI_SERVER_ADDR=$(RD_ADDR)
|
||||
CFLAGS += -DRDCLI_SERVER_PORT=$(RD_PORT)
|
||||
CFLAGS += -DCORD_LT=$(RD_LT)
|
||||
CFLAGS += -DCORD_SERVER_ADDR=$(RD_ADDR)
|
||||
CFLAGS += -DCORD_SERVER_PORT=$(RD_PORT)
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
@ -1,15 +1,15 @@
|
||||
CoRE Resource Directory: Simple Registration Example
|
||||
====================================================
|
||||
CoRE Resource Directory: Simple Endpoint Example
|
||||
================================================
|
||||
|
||||
This example shows how a node can register with a CoRE resource directory using
|
||||
the simple registration process as described in
|
||||
draft-ietf-core-resource-directory-11, section 5.3.2.
|
||||
the simple registration procedure as described in
|
||||
draft-ietf-core-resource-directory-15, section 5.3.1.
|
||||
|
||||
The registration process needs an endpoint name as well as a lifetime for the
|
||||
registry entry. You can edit these values by overriding `RDCLI_EP` and
|
||||
`RDCLI_LT`:
|
||||
registry entry. These are statically defined during compile time and you can
|
||||
edit these values by overriding `CORD_EP` and `CORD_LT`:
|
||||
```
|
||||
CFLAGS="-DRDCLI_LT=\"7200\" -DRDCLI_EP=\"MyNode\"" make all
|
||||
CFLAGS="-DCORD_LT=\"7200\" -DCORD_EP=\"MyNode\"" make all
|
||||
```
|
||||
|
||||
Per default, the node is looking for the CoRE RD at the all nodes link-local
|
@ -68,17 +68,17 @@ int main(void)
|
||||
|
||||
/* fill riot info */
|
||||
sprintf(riot_info, "{\"ep\":\"%s\",\"lt\":%u}",
|
||||
cord_common_get_ep(), RDCLI_LT);
|
||||
cord_common_get_ep(), CORD_LT);
|
||||
|
||||
/* register resource handlers with gcoap */
|
||||
gcoap_register_listener(&listener);
|
||||
|
||||
/* print RD client information */
|
||||
puts("RD client information:");
|
||||
printf(" RD addr: %s\n", RDCLI_SERVER_ADDR);
|
||||
printf(" RD port: %u\n", (unsigned)RDCLI_SERVER_PORT);
|
||||
printf(" RD addr: %s\n", CORD_SERVER_ADDR);
|
||||
printf(" RD port: %u\n", (unsigned)CORD_SERVER_PORT);
|
||||
printf(" ep: %s\n", cord_common_get_ep());
|
||||
printf(" lt: %is\n", (int)RDCLI_LT);
|
||||
printf(" lt: %is\n", (int)CORD_LT);
|
||||
|
||||
/* run the shell */
|
||||
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
Loading…
Reference in New Issue
Block a user