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

sys/shell/rdcli: rename to sc_cord_ep.c

parent 18cc7ee3
No related branches found
No related tags found
No related merge requests found
...@@ -66,8 +66,8 @@ endif ...@@ -66,8 +66,8 @@ endif
ifneq (,$(filter conn_can,$(USEMODULE))) ifneq (,$(filter conn_can,$(USEMODULE)))
SRC += sc_can.c SRC += sc_can.c
endif endif
ifneq (,$(filter rdcli,$(USEMODULE))) ifneq (,$(filter cord_ep,$(USEMODULE)))
SRC += sc_rdcli.c SRC += sc_cord_ep.c
endif endif
ifneq (,$(filter periph_rtc,$(FEATURES_PROVIDED))) ifneq (,$(filter periph_rtc,$(FEATURES_PROVIDED)))
......
/* /*
* Copyright (C) 2017 Freie Universität Berlin * Copyright (C) 2017-2018 Freie Universität Berlin
* *
* This file is subject to the terms and conditions of the GNU Lesser * This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level * General Public License v2.1. See the file LICENSE in the top level
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* @{ * @{
* *
* @file * @file
* @brief Shell commands for the rdcli module * @brief Shell commands for the cord_ep module
* *
* @author Hauke Petersen <hauke.petersen@fu-berlin.de> * @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* *
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "net/rdcli.h" #include "net/cord/ep.h"
#include "net/nanocoap.h" #include "net/nanocoap.h"
#include "net/sock/util.h" #include "net/sock/util.h"
#include "net/cord/config.h" #include "net/cord/config.h"
...@@ -40,7 +40,7 @@ static int make_sock_ep(sock_udp_ep_t *ep, const char *addr) ...@@ -40,7 +40,7 @@ static int make_sock_ep(sock_udp_ep_t *ep, const char *addr)
return 0; return 0;
} }
int _rdcli_handler(int argc, char **argv) int _cord_ep_handler(int argc, char **argv)
{ {
int res; int res;
...@@ -60,12 +60,12 @@ int _rdcli_handler(int argc, char **argv) ...@@ -60,12 +60,12 @@ int _rdcli_handler(int argc, char **argv)
regif = argv[3]; regif = argv[3];
} }
puts("Registering with RD now, this may take a short while..."); puts("Registering with RD now, this may take a short while...");
if (rdcli_register(&remote, regif) != RDCLI_OK) { if (cord_ep_register(&remote, regif) != CORD_EP_OK) {
puts("error: registration failed"); puts("error: registration failed");
} }
else { else {
puts("registration successful\n"); puts("registration successful\n");
rdcli_dump_status(); cord_ep_dump_status();
} }
} }
else if ((argc > 1) && (strcmp(argv[1], "discover") == 0)) { else if ((argc > 1) && (strcmp(argv[1], "discover") == 0)) {
...@@ -79,7 +79,7 @@ int _rdcli_handler(int argc, char **argv) ...@@ -79,7 +79,7 @@ int _rdcli_handler(int argc, char **argv)
printf("error: unable to parse address\n"); printf("error: unable to parse address\n");
return 1; return 1;
} }
if (rdcli_discover_regif(&remote, regif, sizeof(regif)) == RDCLI_OK) { if (cord_ep_discover_regif(&remote, regif, sizeof(regif)) == CORD_EP_OK) {
printf("the registration interface is '%s'\n", regif); printf("the registration interface is '%s'\n", regif);
} }
else { else {
...@@ -87,14 +87,14 @@ int _rdcli_handler(int argc, char **argv) ...@@ -87,14 +87,14 @@ int _rdcli_handler(int argc, char **argv)
} }
} }
else if ((argc > 1) && (strcmp(argv[1], "update") == 0)) { else if ((argc > 1) && (strcmp(argv[1], "update") == 0)) {
res = rdcli_update(); res = cord_ep_update();
if (res == RDCLI_OK) { if (res == CORD_EP_OK) {
puts("RD update successful"); puts("RD update successful");
} }
else if (res == RDCLI_NORD) { else if (res == CORD_EP_NORD) {
puts("error: not associated with any RD"); puts("error: not associated with any RD");
} }
else if (res == RDCLI_TIMEOUT) { else if (res == CORD_EP_TIMEOUT) {
puts("error: unable to reach RD - dropped association"); puts("error: unable to reach RD - dropped association");
} }
else { else {
...@@ -102,14 +102,14 @@ int _rdcli_handler(int argc, char **argv) ...@@ -102,14 +102,14 @@ int _rdcli_handler(int argc, char **argv)
} }
} }
else if ((argc > 1) && (strcmp(argv[1], "remove") == 0)) { else if ((argc > 1) && (strcmp(argv[1], "remove") == 0)) {
res = rdcli_remove(); res = cord_ep_remove();
if (res == RDCLI_OK) { if (res == CORD_EP_OK) {
puts("node successfully removed from RD"); puts("node successfully removed from RD");
} }
else if (res == RDCLI_NORD) { else if (res == CORD_EP_NORD) {
puts("error: not associated with any RD"); puts("error: not associated with any RD");
} }
else if (res == RDCLI_TIMEOUT) { else if (res == CORD_EP_TIMEOUT) {
puts("error: unable to reach RD - remove association only locally"); puts("error: unable to reach RD - remove association only locally");
} }
else { else {
...@@ -117,7 +117,7 @@ int _rdcli_handler(int argc, char **argv) ...@@ -117,7 +117,7 @@ int _rdcli_handler(int argc, char **argv)
} }
} }
else if ((argc > 1) && (strcmp(argv[1], "info") == 0)) { else if ((argc > 1) && (strcmp(argv[1], "info") == 0)) {
rdcli_dump_status(); cord_ep_dump_status();
} }
else { else {
printf("usage: %s <register|discover|update|remove|info>\n", printf("usage: %s <register|discover|update|remove|info>\n",
......
...@@ -142,8 +142,8 @@ extern int _ls_handler(int argc, char **argv); ...@@ -142,8 +142,8 @@ extern int _ls_handler(int argc, char **argv);
extern int _can_handler(int argc, char **argv); extern int _can_handler(int argc, char **argv);
#endif #endif
#ifdef MODULE_RDCLI #ifdef MODULE_CORD_EP
extern int _rdcli_handler(int argc, char **argv); extern int _cord_ep_handler(int argc, char **argv);
#endif #endif
const shell_command_t _shell_command_list[] = { const shell_command_t _shell_command_list[] = {
...@@ -237,8 +237,8 @@ const shell_command_t _shell_command_list[] = { ...@@ -237,8 +237,8 @@ const shell_command_t _shell_command_list[] = {
#ifdef MODULE_CONN_CAN #ifdef MODULE_CONN_CAN
{"can", "CAN commands", _can_handler}, {"can", "CAN commands", _can_handler},
#endif #endif
#ifdef MODULE_RDCLI #ifdef MODULE_CORD_EP
{"rdcli", "CoAP RD client commands", _rdcli_handler }, {"cord_ep", "Resource directory endpoint commands", _cord_ep_handler },
#endif #endif
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment