Skip to content
Snippets Groups Projects
Commit 5668100d authored by Hauke Petersen's avatar Hauke Petersen
Browse files

examples/rdcli_simple: rename to cord_epsim

parent 226b9fa3
Branches
No related tags found
No related merge requests found
# name of your application # name of your application
APPLICATION = rdcli_simple APPLICATION = cord_epsim
# If no BOARD is found in the environment, use this default: # If no BOARD is found in the environment, use this default:
BOARD ?= native BOARD ?= native
...@@ -40,8 +40,8 @@ RD_LT ?= 60 ...@@ -40,8 +40,8 @@ RD_LT ?= 60
RD_ADDR ?= \"ff02::1\" RD_ADDR ?= \"ff02::1\"
RD_PORT ?= 5683 RD_PORT ?= 5683
CFLAGS += -DRDCLI_LT=$(RD_LT) CFLAGS += -DCORD_LT=$(RD_LT)
CFLAGS += -DRDCLI_SERVER_ADDR=$(RD_ADDR) CFLAGS += -DCORD_SERVER_ADDR=$(RD_ADDR)
CFLAGS += -DRDCLI_SERVER_PORT=$(RD_PORT) CFLAGS += -DCORD_SERVER_PORT=$(RD_PORT)
include $(RIOTBASE)/Makefile.include include $(RIOTBASE)/Makefile.include
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 This example shows how a node can register with a CoRE resource directory using
the simple registration process as described in the simple registration procedure as described in
draft-ietf-core-resource-directory-11, section 5.3.2. draft-ietf-core-resource-directory-15, section 5.3.1.
The registration process needs an endpoint name as well as a lifetime for the 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 registry entry. These are statically defined during compile time and you can
`RDCLI_LT`: 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 Per default, the node is looking for the CoRE RD at the all nodes link-local
......
...@@ -68,17 +68,17 @@ int main(void) ...@@ -68,17 +68,17 @@ int main(void)
/* fill riot info */ /* fill riot info */
sprintf(riot_info, "{\"ep\":\"%s\",\"lt\":%u}", sprintf(riot_info, "{\"ep\":\"%s\",\"lt\":%u}",
cord_common_get_ep(), RDCLI_LT); cord_common_get_ep(), CORD_LT);
/* register resource handlers with gcoap */ /* register resource handlers with gcoap */
gcoap_register_listener(&listener); gcoap_register_listener(&listener);
/* print RD client information */ /* print RD client information */
puts("RD client information:"); puts("RD client information:");
printf(" RD addr: %s\n", RDCLI_SERVER_ADDR); printf(" RD addr: %s\n", CORD_SERVER_ADDR);
printf(" RD port: %u\n", (unsigned)RDCLI_SERVER_PORT); printf(" RD port: %u\n", (unsigned)CORD_SERVER_PORT);
printf(" ep: %s\n", cord_common_get_ep()); 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 */ /* run the shell */
char line_buf[SHELL_DEFAULT_BUFSIZE]; char line_buf[SHELL_DEFAULT_BUFSIZE];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment