X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-chaosread%2Fao-chaosread.c;fp=ao-tools%2Fao-chaosread%2Fao-chaosread.c;h=5c0de1257fbded71cda28e0d7dbaaf2fcffaba7c;hp=8a814a009ed7b20b405877431a334d6918c03a73;hb=ab65e9f257493da5282d8933d8f0dcb716c1f41f;hpb=bea42e45952df85d61428662caefbb100465a585 diff --git a/ao-tools/ao-chaosread/ao-chaosread.c b/ao-tools/ao-chaosread/ao-chaosread.c index 8a814a00..5c0de125 100644 --- a/ao-tools/ao-chaosread/ao-chaosread.c +++ b/ao-tools/ao-chaosread/ao-chaosread.c @@ -174,6 +174,7 @@ chaoskey_close(struct chaoskey *ck) #define COOKED_ENDPOINT 0x85 #define RAW_ENDPOINT 0x86 +#define FLASH_ENDPOINT 0x87 int chaoskey_read(struct chaoskey *ck, int endpoint, void *buffer, int len) @@ -208,12 +209,13 @@ static const struct option options[] = { { .name = "bytes", .has_arg = 0, .val = 'b' }, { .name = "cooked", .has_arg = 0, .val = 'c' }, { .name = "raw", .has_arg = 0, .val = 'r' }, + { .name = "flash", .has_arg = 0, .val = 'f' }, { 0, 0, 0, 0}, }; static void usage(char *program) { - fprintf(stderr, "usage: %s [--serial=] [--length=[kMG]] [--infinite] [--bytes] [--cooked] [--raw]\n", program); + fprintf(stderr, "usage: %s [--serial=] [--length=[kMG]] [--infinite] [--bytes] [--cooked] [--raw] [--flash]\n", program); exit(1); } @@ -233,7 +235,7 @@ main (int argc, char **argv) int bytes = 0; int endpoint = RAW_ENDPOINT; - while ((c = getopt_long(argc, argv, "s:l:ibcr", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "s:l:ibcrf", options, NULL)) != -1) { switch (c) { case 's': serial = optarg; @@ -262,6 +264,9 @@ main (int argc, char **argv) case 'r': endpoint = RAW_ENDPOINT; break; + case 'f': + endpoint = FLASH_ENDPOINT; + break; default: usage(argv[0]); break;