• Home
  • Raw
  • Download

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);
53 static int help(int argc, char** argv) { in help() argument
59 const command_t* command = find_command(argv[0]); in help()
61 printf("No command named '%s'.\n", argv[0]); in help()
65 printf("%s %s\n", argv[0], command->help); in help()
69 static int set_discoverable(int argc, char** argv) { in set_discoverable() argument
75 if (strcmp(argv[0], "true") && strcmp(argv[0], "false")) { in set_discoverable()
76 printf("Invalid discoverable mode '%s'.\n", argv[0]); in set_discoverable()
81 if (argv[0][0] == 't') packet[ARRAY_SIZE(packet) - 1] = 0x03; in set_discoverable()
86 static int set_name(int argc, char** argv) { in set_name() argument
92 size_t len = strlen(argv[0]); in set_name()
99 memcpy(&packet[3], argv[0], len + 1); in set_name()
110 memcpy(&packet[6], argv[0], len); in set_name()
114 static int set_pcm_loopback(int argc, char** argv) { in set_pcm_loopback() argument
120 if (strcmp(argv[0], "true") && strcmp(argv[0], "false")) { in set_pcm_loopback()
121 printf("Invalid PCM mode '%s'.\n", argv[0]); in set_pcm_loopback()
126 if (argv[0][0] == 't') packet[ARRAY_SIZE(packet) - 1] = 0x01; in set_pcm_loopback()
131 static int set_sco_route(int argc, char** argv) { in set_sco_route() argument
138 if (!strcmp(argv[0], "pcm")) in set_sco_route()
140 else if (!strcmp(argv[0], "i2s")) in set_sco_route()
142 else if (!strcmp(argv[0], "uart")) in set_sco_route()
146 printf("Invalid SCO route specified: %s\n", argv[0]); in set_sco_route()
156 int main(int argc, char** argv) { in main() argument
158 usage(argv[0]); in main()
162 const command_t* command = find_command(argv[1]); in main()
164 printf("Unrecognized command '%s'.\n", argv[1]); in main()
169 printf("Unhandled command '%s'.\n", argv[1]); in main()
173 return command->handler(argc - 2, &argv[2]); in main()