sys/net/cord : Move 'CORD_LT' to 'CONFIG_'
This commit is contained in:
parent
b584a2dadf
commit
de2d33f65b
@ -25,7 +25,7 @@ USEMODULE += fmt
|
|||||||
DEVELHELP ?= 1
|
DEVELHELP ?= 1
|
||||||
|
|
||||||
# For debugging and demonstration purposes, we limit the lifetime to 60s
|
# For debugging and demonstration purposes, we limit the lifetime to 60s
|
||||||
CFLAGS += -DCORD_LT=60
|
CFLAGS += -DCONFIG_CORD_LT=60
|
||||||
|
|
||||||
# Change this to 0 show compiler invocation lines by default:
|
# Change this to 0 show compiler invocation lines by default:
|
||||||
QUIET ?= 1
|
QUIET ?= 1
|
||||||
|
|||||||
@ -13,7 +13,7 @@ RD, called `cord_ep`. Simply use that shell command without parameters for
|
|||||||
more information on its usage.
|
more information on its usage.
|
||||||
|
|
||||||
Some connection parameters are configured statically during compile time,
|
Some connection parameters are configured statically during compile time,
|
||||||
namely the lifetime (`CORD_LT`) and the node's endpoint name (`CORD_EP`). You
|
namely the lifetime (`CONFIG_CORD_LT`) and the node's endpoint name (`CORD_EP`). You
|
||||||
can change these values at compile time by overriding their defines using
|
can change these values at compile time by overriding their defines using
|
||||||
command line arguments:
|
command line arguments:
|
||||||
```
|
```
|
||||||
|
|||||||
@ -103,7 +103,7 @@ int main(void)
|
|||||||
|
|
||||||
puts("Client information:");
|
puts("Client information:");
|
||||||
printf(" ep: %s\n", cord_common_get_ep());
|
printf(" ep: %s\n", cord_common_get_ep());
|
||||||
printf(" lt: %is\n", (int)CORD_LT);
|
printf(" lt: %is\n", (int)CONFIG_CORD_LT);
|
||||||
|
|
||||||
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
||||||
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
||||||
|
|||||||
@ -26,7 +26,7 @@ DEVELHELP ?= 1
|
|||||||
# For debugging and demonstration purposes, we limit the lifetime to the minimal
|
# For debugging and demonstration purposes, we limit the lifetime to the minimal
|
||||||
# allowed value of 60s (see draft-ietf-core-resource-directory-11, Table 2)
|
# allowed value of 60s (see draft-ietf-core-resource-directory-11, Table 2)
|
||||||
RD_LT ?= 60
|
RD_LT ?= 60
|
||||||
CFLAGS += -DCORD_LT=$(RD_LT)
|
CFLAGS += -DCONFIG_CORD_LT=$(RD_LT)
|
||||||
|
|
||||||
# The RD server's address must be defined by the build environment by setting
|
# The RD server's address must be defined by the build environment by setting
|
||||||
# the RD_ADDR environment variable. Per default, this value is set to the
|
# the RD_ADDR environment variable. Per default, this value is set to the
|
||||||
|
|||||||
@ -76,7 +76,7 @@ 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(), CORD_LT);
|
cord_common_get_ep(), CONFIG_CORD_LT);
|
||||||
|
|
||||||
/* parse RD address information */
|
/* parse RD address information */
|
||||||
sock_udp_ep_t rd_ep;
|
sock_udp_ep_t rd_ep;
|
||||||
@ -112,7 +112,7 @@ int main(void)
|
|||||||
/* print RD client information */
|
/* print RD client information */
|
||||||
puts("epsim configuration:");
|
puts("epsim configuration:");
|
||||||
printf(" ep: %s\n", cord_common_get_ep());
|
printf(" ep: %s\n", cord_common_get_ep());
|
||||||
printf(" lt: %is\n", (int)CORD_LT);
|
printf(" lt: %is\n", (int)CONFIG_CORD_LT);
|
||||||
printf(" RD address: [%s]:%u\n\n", ep_str, ep_port);
|
printf(" RD address: [%s]:%u\n\n", ep_str, ep_port);
|
||||||
|
|
||||||
xtimer_sleep(STARTUP_DELAY);
|
xtimer_sleep(STARTUP_DELAY);
|
||||||
|
|||||||
@ -52,7 +52,7 @@ static inline const char *cord_common_get_ep(void)
|
|||||||
*
|
*
|
||||||
* This function adds:
|
* This function adds:
|
||||||
* - `ep` -> as extracted by cord_common_get_ep()
|
* - `ep` -> as extracted by cord_common_get_ep()
|
||||||
* - [optional] `lt` -> if defined by CORD_LT
|
* - [optional] `lt` -> if defined by CONFIG_CORD_LT
|
||||||
* - [optional] 'd' -> if defined by CORD_D
|
* - [optional] 'd' -> if defined by CORD_D
|
||||||
*
|
*
|
||||||
* @return 0 on success
|
* @return 0 on success
|
||||||
|
|||||||
@ -29,8 +29,8 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* @brief Default lifetime in seconds (the default is 1 day)
|
* @brief Default lifetime in seconds (the default is 1 day)
|
||||||
*/
|
*/
|
||||||
#ifndef CORD_LT
|
#ifndef CONFIG_CORD_LT
|
||||||
#define CORD_LT (86400UL)
|
#define CONFIG_CORD_LT (86400UL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,7 +44,7 @@ extern "C" {
|
|||||||
* @brief Default client update interval (default is 3/4 the lifetime)
|
* @brief Default client update interval (default is 3/4 the lifetime)
|
||||||
*/
|
*/
|
||||||
#ifndef CORD_UPDATE_INTERVAL
|
#ifndef CORD_UPDATE_INTERVAL
|
||||||
#define CORD_UPDATE_INTERVAL ((CORD_LT / 4) * 3)
|
#define CORD_UPDATE_INTERVAL ((CONFIG_CORD_LT / 4) * 3)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
* This module is designed to provide nodes with the possibility to register
|
* This module is designed to provide nodes with the possibility to register
|
||||||
* with resource directories without having to allocate a lot of resources. All
|
* with resource directories without having to allocate a lot of resources. All
|
||||||
* the user has to do, is to call the cord_epsim_register() function in periodic
|
* the user has to do, is to call the cord_epsim_register() function in periodic
|
||||||
* intervals, depending on the value of the `CORD_LT` variable.
|
* intervals, depending on the value of the `CONFIG_CORD_LT` variable.
|
||||||
*
|
*
|
||||||
* @{
|
* @{
|
||||||
*
|
*
|
||||||
|
|||||||
@ -63,9 +63,9 @@ int cord_common_add_qstring(coap_pkt_t *pkt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* [optional] set the lifetime parameter */
|
/* [optional] set the lifetime parameter */
|
||||||
#if CORD_LT
|
#if CONFIG_CORD_LT
|
||||||
char lt[11];
|
char lt[11];
|
||||||
lt[fmt_u32_dec(lt, CORD_LT)] = '\0';
|
lt[fmt_u32_dec(lt, CONFIG_CORD_LT)] = '\0';
|
||||||
res = coap_opt_add_uri_query(pkt, "lt", lt);
|
res = coap_opt_add_uri_query(pkt, "lt", lt);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@ -359,7 +359,7 @@ void cord_ep_dump_status(void)
|
|||||||
|
|
||||||
printf("RD address: coap://[%s]:%i\n", addr, (int)_rd_remote.port);
|
printf("RD address: coap://[%s]:%i\n", addr, (int)_rd_remote.port);
|
||||||
printf(" ep name: %s\n", cord_common_get_ep());
|
printf(" ep name: %s\n", cord_common_get_ep());
|
||||||
printf(" lifetime: %is\n", (int)CORD_LT);
|
printf(" lifetime: %is\n", (int)CONFIG_CORD_LT);
|
||||||
printf(" reg if: %s\n", _rd_regif);
|
printf(" reg if: %s\n", _rd_regif);
|
||||||
printf(" location: %s\n", _rd_loc);
|
printf(" location: %s\n", _rd_loc);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user