examples/lwm2m_test: fixes lwm2m_test usage.
authorJunyeon LEE <junyeon2.lee@samsung.com>
Fri, 23 Jun 2017 14:54:38 +0000 (23:54 +0900)
committerEunBong Song <eunb.song@samsung.com>
Tue, 11 Jul 2017 11:13:40 +0000 (20:13 +0900)
This commit fixes wrong usage about psk and addes guide for
all input combination.

Change-Id: I79168f07f628c8b54908ed2cffc4721a096a358e
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
apps/examples/lwm2m_test/lwm2m_client_main.c
apps/examples/lwm2m_test/lwm2m_server_main.c

index f9092a2..07b173f 100644 (file)
@@ -798,12 +798,14 @@ void print_usage(void)
        fprintf(stdout, "  -h HOST\tSet the hostname of the LWM2M Server to connect to. Default: localhost\r\n");
        fprintf(stdout, "  -t TIME\tSet the lifetime of the Client. Default: 300\r\n");
 #ifdef WITH_MBEDTLS
-       fprintf(stdout, "  -i STRING\t Set PSK identity. If not set use none secure mode\r\n");
-       fprintf(stdout, "  -s HEXSTRING\t Set Pre-Shared-Key. If not set use none secure mode\r\n");
+       fprintf(stdout, "  -i STRING\t Set PSK identity.\r\n");
+       fprintf(stdout, "  -s HEXSTRING\t Set Pre-Shared-Key. The input length should be even, such as 11, 1111.\r\n");
 #endif
        fprintf(stdout, "Examples:\r\n");
        fprintf(stdout, "  lwm2mclient -h coap://127.0.0.1\r\n");
-       fprintf(stdout, "  lwm2mclient -h coaps+tcp://127.0.0.1 -i PSK_identity -s 4938271\r\n");
+       fprintf(stdout, "  lwm2mclient -h coaps://127.0.0.1 -i PSK_identity -s 11111111\r\n");
+       fprintf(stdout, "  lwm2mclient -h coap+tcp://127.0.0.1\r\n");
+       fprintf(stdout, "  lwm2mclient -h coaps+tcp://127.0.0.1 -i PSK_identity -s 11111111\r\n");
        fprintf(stdout, "\r\n");
 }
 
index 168dd0b..91d36d5 100644 (file)
@@ -957,11 +957,14 @@ void print_usage(void)
        fprintf(stdout, "Options:\r\n");
        fprintf(stdout, "  -p protocol \tSet protocol type, (0: UDP, 1: UDP+DTLS, 2: TCP, 3: TCP+TLS)\r\n");
 #ifdef WITH_MBEDTLS
-       fprintf(stdout, "  -i STRING\t Set PSK identity. If not set use none secure mode\r\n");
-       fprintf(stdout, "  -s HEXSTRING\t Set Pre-Shared-Key. If not set use none secure mode\r\n");
+       fprintf(stdout, "  -i STRING\t Set PSK identity.\r\n");
+       fprintf(stdout, "  -s HEXSTRING\t Set Pre-Shared-Key. The input length should be even, such as 11, 1111.\r\n");
 #endif
        fprintf(stdout, "Examples:\r\n");
-       fprintf(stdout, "  lwm2mserver -p 3\r\n");
+       fprintf(stdout, "  lwm2mserver -p 0\r\n");
+       fprintf(stdout, "  lwm2mserver -p 1 -i PSK_identity -s 11111111\r\n");
+       fprintf(stdout, "  lwm2mserver -p 2\r\n");
+       fprintf(stdout, "  lwm2mserver -p 3 -i PSK_identity -s 11111111\r\n");
        fprintf(stdout, "\r\n");
 }