Update examples to include using coap_string_tls_version() in usage()

examples/client.c
examples/coap-rd.c
examples/coap-server.c

Add in call to coap_string_tls_version() in usage().
This commit is contained in:
Jon Shallow committed 2018-11-27 11:42:21 +00:00
1 parent 72740cb687
commit cbfa1790d3
3 files changed
+13 -4

No files matched your search

+5 -2
View File
@@ -523,13 +523,15 @@ message_handler(struct coap_context_t *ctx,
static void
usage( const char *program, const char *version) {
const char *p;
char buffer[64];
p = strrchr( program, '/' );
if ( p )
program = ++p;
fprintf( stderr, "%s v%s -- a small CoAP implementation\n"
"(c) 2010-2015 Olaf Bergmann <bergmann@tzi.org>\n\n"
"(c) 2010-2018 Olaf Bergmann <bergmann@tzi.org>\n\n"
"%s\n\n"
"Usage: %s [-a addr] [-b [num,]size] [-c certfile] [-C cafile] [-e text]\n"
"\t\t[-f file] [-k key] [-l loss] [-m method] [-o file]\n"
"\t\t[-p port] [-r] [-s duration] [-t type] [-u user]\n"
@@ -591,7 +593,8 @@ usage( const char *program, const char *version) {
"\tcoap-client -m get coap://[::1]/.well-known/core\n"
"\tcoap-client -m get -T cafe coap://[::1]/time\n"
"\techo -n 1000 | coap-client -m put -T cafe coap://[::1]/time -f -\n"
,program, version, program, wait_seconds);
,program, version, coap_string_tls_version(buffer, sizeof(buffer))
,program, wait_seconds);
}
typedef struct {
+4 -1
View File
@@ -552,6 +552,7 @@ init_resources(coap_context_t *ctx) {
static void
usage( const char *program, const char *version) {
const char *p;
char buffer[64];
p = strrchr( program, '/' );
if ( p )
@@ -559,11 +560,13 @@ usage( const char *program, const char *version) {
fprintf( stderr, "%s v%s -- CoRE Resource Directory implementation\n"
"(c) 2011-2012 Olaf Bergmann <bergmann@tzi.org>\n\n"
"%s\n\n"
"usage: %s [-A address] [-p port]\n\n"
"\t-A address\tinterface address to bind to\n"
"\t-p port\t\tlisten on specified port\n"
"\t-v num\t\tverbosity level (default: 3)\n",
program, version, program );
program, version, coap_string_tls_version(buffer, sizeof(buffer)),
program);
}
static coap_context_t *
+4 -1
View File
@@ -709,6 +709,7 @@ fill_keystore(coap_context_t *ctx) {
static void
usage( const char *program, const char *version) {
const char *p;
char buffer[64];
p = strrchr( program, '/' );
if ( p )
@@ -716,6 +717,7 @@ usage( const char *program, const char *version) {
fprintf( stderr, "%s v%s -- a small CoAP implementation\n"
"(c) 2010,2011,2015-2018 Olaf Bergmann <bergmann@tzi.org>\n\n"
"%s\n\n"
"Usage: %s [-A address] [-g group] [-p port] [-l loss] [-c certfile]\n"
"\t\t[-C cafile] [-R root_cafile] [-k key] [-h hint] [-N]\n"
"\t\t[-v num] [-d max]\n\n"
@@ -756,7 +758,8 @@ usage( const char *program, const char *version) {
"\t-d max \t\tAllow dynamic creation of up to a total of max resources.\n"
"\t \t\tIf max is reached, a 4.06 code is returned until one of the\n"
"\t \t\tdynamic resources has been deleted\n",
program, version, program );
program, version, coap_string_tls_version(buffer, sizeof(buffer)),
program);
}
static coap_context_t *