]> git.meshlink.io Git - meshlink/commitdiff
manynodes: implement stop command
authorSaverio Proto <zioproto@gmail.com>
Thu, 28 Aug 2014 13:17:15 +0000 (15:17 +0200)
committerSaverio Proto <zioproto@gmail.com>
Thu, 28 Aug 2014 13:35:16 +0000 (15:35 +0200)
examples/manynodes.c

index 7b23fc5197f14aa7a7e19f9d59cac1cd1ee54d36..16d25ddcce5d6cb94763394a0efd70b44205173b 100644 (file)
@@ -257,7 +257,8 @@ static void parse_command(char *buf) {
                }
                nodeindex = atoi(arg);
                printf("Index is now %d\n",nodeindex);
-       
+       } else if(!strcasecmp(buf, "stop")) {
+               meshlink_stop(mesh[nodeindex]);
        } else if(!strcasecmp(buf, "quit")) {
                printf("Bye!\n");
                fclose(stdin);
@@ -273,6 +274,7 @@ static void parse_command(char *buf) {
                        "/eg <path>            Export graph as json file.\n"
                        "/test                 Test functionality sending some data to all nodes\n"
                        "/select <number>      Select the active node running the user commands\n"
+                       "/stop                 Call meshlink_stop, use /select first to select which node to stop\n"
                        "/quit                 Exit this program.\n"
                        );
        } else {