diff --git a/examples/riot/examples_libcoap_client/README.md b/examples/riot/examples_libcoap_client/README.md index 6d4f5301..eaa7456e 100644 --- a/examples/riot/examples_libcoap_client/README.md +++ b/examples/riot/examples_libcoap_client/README.md @@ -12,7 +12,7 @@ Preparing the logical interfaces: For the client: PORT=tap0 make term - coapc + coapc coap://[ip6-address]/some/path The IP address to connect to needs to be that as returned by libcoap_server, or that of the tap0 interface, etc. diff --git a/examples/riot/examples_libcoap_client/client-coap.c b/examples/riot/examples_libcoap_client/client-coap.c index 5e47049c..4efbe3d9 100644 --- a/examples/riot/examples_libcoap_client/client-coap.c +++ b/examples/riot/examples_libcoap_client/client-coap.c @@ -129,9 +129,11 @@ client_coap_init(int argc, char **argv) { #define BUFSIZE 100 unsigned char buf[BUFSIZE]; int res; + const char *coap_uri = COAP_CLIENT_URI; - (void)argc; - (void)argv; + if (argc > 1) { + coap_uri = argv[1]; + } /* Initialize libcoap library */ coap_startup(); @@ -139,9 +141,9 @@ client_coap_init(int argc, char **argv) { coap_set_log_level(COAP_MAX_LOGGING_LEVEL); /* Parse the URI */ - len = coap_split_uri((const unsigned char *)COAP_CLIENT_URI, strlen(COAP_CLIENT_URI), &uri); + len = coap_split_uri((const unsigned char *)coap_uri, strlen(coap_uri), &uri); if (len != 0) { - coap_log_warn("Failed to parse uri %s\n", COAP_CLIENT_URI); + coap_log_warn("Failed to parse uri %s\n", coap_uri); goto fail; } diff --git a/examples/riot/pkg_libcoap/Makefile b/examples/riot/pkg_libcoap/Makefile index 6ae574e8..0ef74542 100644 --- a/examples/riot/pkg_libcoap/Makefile +++ b/examples/riot/pkg_libcoap/Makefile @@ -1,6 +1,6 @@ PKG_NAME=libcoap -PKG_URL=https://github.com/mrdeep1/libcoap -PKG_VERSION=6769f9f893e9143d33782ce3602f947a8f2cf521 +PKG_URL=https://github.com/obgm/libcoap +PKG_VERSION=f176bf3c534bc0478a62cb744de11068073ed67f PKG_LICENSE=BSD-2-Clause LIBCOAP_BUILD_DIR=$(BINDIR)/pkg/$(PKG_NAME)