diff --git a/examples/rdcli/Makefile b/examples/cord_ep/Makefile similarity index 96% rename from examples/rdcli/Makefile rename to examples/cord_ep/Makefile index c5b70456d350c4410e5b01d765705ded6664af31..79a1ad5dce34a7a5cef05f251af35c0f31d36873 100644 --- a/examples/rdcli/Makefile +++ b/examples/cord_ep/Makefile @@ -1,5 +1,5 @@ # name of your application -APPLICATION = rdcli +APPLICATION = cord_ep # If no BOARD is found in the environment, use this default: BOARD ?= native @@ -32,7 +32,7 @@ USEMODULE += fmt CFLAGS += -DDEVELHELP # For debugging and demonstration purposes, we limit the lifetime to 60s -CFLAGS += -DRDCLI_LT=60 +CFLAGS += -DCORD_LT=60 # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 diff --git a/examples/cord_ep/README.md b/examples/cord_ep/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4b11baf7151767548537ac6fe41309cbf4297ac0 --- /dev/null +++ b/examples/cord_ep/README.md @@ -0,0 +1,25 @@ +CoRE Resource Directory: Endpoint Example +========================================= + +This example application demonstrates the usage of RIOT's Resource Directory +(RD) endpoint module, called `cord_ep`. This module supports the registration, +update, and removal procedures as defined in +[draft-ietf-core-resource-directory-15](https://tools.ietf.org/html/draft-ietf-core-resource-directory-15). + +Usage +===== +The examples includes a shell command that you can use to interact with a given +RD, called `cord_ep`. Simply use that shell command without parameters for +more information on its usage. + +Some connection parameters are configured statically during compile time, +namely the lifetime (`CORD_LT`) and the node's endpoint name (`CORD_EP`). You +can change these values at compile time by overriding their defines using +command line arguments: +``` +CFLAGS="-DCORD_EP=\\\"your_ep_name_here\\\"" make all +``` +or by setting their values in the application's Makefile: +``` +CFLAGS += "-DCORD_EP=\"MyNewEpName\"" +``` diff --git a/examples/rdcli/main.c b/examples/cord_ep/main.c similarity index 83% rename from examples/rdcli/main.c rename to examples/cord_ep/main.c index d34572da572b09a9b7b44d403dc1047f717b797e..b02f51de620019c60db3e0453590a872f23d5bda 100644 --- a/examples/rdcli/main.c +++ b/examples/cord_ep/main.c @@ -11,7 +11,7 @@ * @{ * * @file - * @brief CoRE Resource Directory client (rdcli) example application + * @brief CoRE Resource Directory endpoint (cord_ep) example * * @author Hauke Petersen <hauke.petersen@fu-berlin.de> * @@ -30,18 +30,18 @@ #define MAIN_QUEUE_SIZE (8) static msg_t _main_msg_queue[MAIN_QUEUE_SIZE]; -/* we will use a custom event handler for dumping rdcli_standalone events */ -static void _on_rdcli_event(cord_ep_standalone_event_t event) +/* we will use a custom event handler for dumping cord_ep events */ +static void _on_ep_event(cord_ep_standalone_event_t event) { switch (event) { case CORD_EP_REGISTERED: - puts("rdcli event: now registered with a RD"); + puts("RD endpoint event: now registered with a RD"); break; case CORD_EP_DEREGISTERED: - puts("rdcli event: dropped client registration"); + puts("RD endpoint event: dropped client registration"); break; case CORD_EP_UPDATED: - puts("rdcli event: successfully updated client registration"); + puts("RD endpoint event: successfully updated client registration"); break; } } @@ -95,11 +95,11 @@ int main(void) gcoap_register_listener(&_listener); /* register event callback with cord_ep_standalone */ - cord_ep_standalone_reg_cb(_on_rdcli_event); + cord_ep_standalone_reg_cb(_on_ep_event); puts("Client information:"); printf(" ep: %s\n", cord_common_get_ep()); - printf(" lt: %is\n", (int)RDCLI_LT); + printf(" lt: %is\n", (int)CORD_LT); char line_buf[SHELL_DEFAULT_BUFSIZE]; shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); diff --git a/examples/rdcli/README.md b/examples/rdcli/README.md deleted file mode 100644 index 315e6087e6488a836545c084e2302c282336f790..0000000000000000000000000000000000000000 --- a/examples/rdcli/README.md +++ /dev/null @@ -1,20 +0,0 @@ -CoRE Resource Directory Client Example -====================================== -This example application demonstrates the usage of RIOT's Resource Directory -(RD) client module, called `rdcli`. This module supports the registration, -update, and removal processes as defined in the -[Resource Directory Draft](https://tools.ietf.org/html/draft-ietf-core-resource-directory-14). - -Usage -===== -The examples includes a shell command that you can use to interact with a given -RD server, called `rdcli`. Simply use that shell command without parameters for -more information on its usage. - -Some connection parameters are configured statically during compile time, -namely the lifetime (`RDCLI_LT`) and the node's endpoint name (`RDCLI_EP`). You -can change these values during command line by overriding these values in the -application's Makefile, e.g. add -``` -CFLAGS += "-DRDCLI_EP=\"MyNewEpName\"" -```