X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/blobdiff_plain/84daa92b023571e959f177094a5ac6b632503514..7ba4ea19644711d8f86c2df3a244da797e23cc96:/hmsniff.c diff --git a/hmsniff.c b/hmsniff.c index f341044..051c95c 100644 --- a/hmsniff.c +++ b/hmsniff.c @@ -1,6 +1,6 @@ /* HM-sniffer for HM-CFG-USB * - * Copyright (c) 2013-15 Michael Gernoth + * Copyright (c) 2013-16 Michael Gernoth * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -214,6 +214,7 @@ void hmsniff_syntax(char *prog) fprintf(stderr, "Syntax: %s options\n\n", prog); fprintf(stderr, "Possible options:\n"); fprintf(stderr, "\t-f\t\tfast (100k/firmware update) mode\n"); + fprintf(stderr, "\t-S serial\tuse HM-CFG-USB with given serial\n"); fprintf(stderr, "\t-v\t\tverbose mode\n"); fprintf(stderr, "\t-V\t\tshow version (" VERSION ")\n"); @@ -223,22 +224,26 @@ int main(int argc, char **argv) { struct hmcfgusb_dev *dev; struct recv_data rdata; + char *serial = NULL; int quit = 0; int speed = 10; uint8_t speed_buf[2]; int opt; - while((opt = getopt(argc, argv, "fvV")) != -1) { + while((opt = getopt(argc, argv, "fS:vV")) != -1) { switch (opt) { case 'f': speed = 100; break; + case 'S': + serial = optarg; + break; case 'v': verbose = 1; break; case 'V': printf("hmsniff " VERSION "\n"); - printf("Copyright (c) 2013-15 Michael Gernoth\n\n"); + printf("Copyright (c) 2013-16 Michael Gernoth\n\n"); exit(EXIT_SUCCESS); case 'h': case ':': @@ -256,7 +261,7 @@ int main(int argc, char **argv) memset(&rdata, 0, sizeof(rdata)); rdata.wrong_hmid = 0; - dev = hmcfgusb_init(parse_hmcfgusb, &rdata); + dev = hmcfgusb_init(parse_hmcfgusb, &rdata, serial); if (!dev) { fprintf(stderr, "Can't initialize HM-CFG-USB, retrying in 1s...\n"); sleep(1);