mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 22:43:50 +01:00
examples/rdcli: rename to cord_ep
This commit is contained in:
parent
cfe4370a95
commit
34fa61d7db
@ -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
|
||||
25
examples/cord_ep/README.md
Normal file
25
examples/cord_ep/README.md
Normal file
@ -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\""
|
||||
```
|
||||
@ -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);
|
||||
@ -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\""
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user