Lines Matching refs:argv
11 typedef int (*handler_t)(int argc, char **argv);
26 static int help(int argc, char **argv);
27 static int set_discoverable(int argc, char **argv);
28 static int set_name(int argc, char **argv);
29 static int set_pcm_loopback(int argc, char **argv);
30 static int set_sco_route(int argc, char **argv);
44 static int help(int argc, char **argv) { in help() argument
50 const command_t *command = find_command(argv[0]); in help()
52 printf("No command named '%s'.\n", argv[0]); in help()
56 printf("%s %s\n", argv[0], command->help); in help()
60 static int set_discoverable(int argc, char **argv) { in set_discoverable() argument
66 if (strcmp(argv[0], "true") && strcmp(argv[0], "false")) { in set_discoverable()
67 printf("Invalid discoverable mode '%s'.\n", argv[0]); in set_discoverable()
72 if (argv[0][0] == 't') in set_discoverable()
78 static int set_name(int argc, char **argv) { in set_name() argument
84 size_t len = strlen(argv[0]); in set_name()
91 memcpy(&packet[3], argv[0], len + 1); in set_name()
103 memcpy(&packet[6], argv[0], len); in set_name()
107 static int set_pcm_loopback(int argc, char **argv) { in set_pcm_loopback() argument
113 if (strcmp(argv[0], "true") && strcmp(argv[0], "false")) { in set_pcm_loopback()
114 printf("Invalid PCM mode '%s'.\n", argv[0]); in set_pcm_loopback()
119 if (argv[0][0] == 't') in set_pcm_loopback()
125 static int set_sco_route(int argc, char **argv) { in set_sco_route() argument
132 if (!strcmp(argv[0], "pcm")) in set_sco_route()
134 else if (!strcmp(argv[0], "i2s")) in set_sco_route()
136 else if (!strcmp(argv[0], "uart")) in set_sco_route()
140 printf("Invalid SCO route specified: %s\n", argv[0]); in set_sco_route()
150 int main(int argc, char **argv) { in main() argument
152 usage(argv[0]); in main()
156 const command_t *command = find_command(argv[1]); in main()
158 printf("Unrecognized command '%s'.\n", argv[1]); in main()
163 printf("Unhandled command '%s'.\n", argv[1]); in main()
167 return command->handler(argc - 2, &argv[2]); in main()