diff options
author | Keith Packard <keithp@keithp.com> | 2010-08-21 17:09:41 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-08-21 17:09:41 -0700 |
commit | 09252ec22d58e946494e4ca2cf367bf3bbe1cc50 (patch) | |
tree | 2e1ea5c5039cf48915f1bbd5a0ef00fcd76870cf /src/ao-make-product.5c | |
parent | 22800dc094797e1e0ad99124198809d0360f7556 (diff) |
altos: Define USB product ID in per-product Makefile.defs file
This allows Win7 to tell which kind of device is connected purely by
USB id as it doesn't expose the USB product ID string to user space.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao-make-product.5c')
-rw-r--r-- | src/ao-make-product.5c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ao-make-product.5c b/src/ao-make-product.5c index 933032dd..5f2eb8e8 100644 --- a/src/ao-make-product.5c +++ b/src/ao-make-product.5c @@ -37,11 +37,19 @@ write_int(int a, string description) printf ("#define AO_%s_NUMBER %d\n\n", description, a); } +void +write_hex(int a, string description) +{ + printf ("/* %s */\n", description); + printf ("#define AO_%s_NUMBER 0x%04x\n\n", description, a); +} + string manufacturer = "altusmetrum.org"; string product = "TeleMetrum"; string version = "0.0"; int serial = 1; int user_argind = 0; +int id_product = 0x000a; argdesc argd = { .args = { @@ -58,6 +66,12 @@ argdesc argd = { .expr_name = "prod", .desc = "Product name." }, { + .var = { .arg_int = &id_product }, + .abbr = 'i', + .name = "id_product", + .expr_name = "id_p", + .desc = "Product ID." }, + { .var = { .arg_int = &serial }, .abbr = 's', .name = "serial", @@ -82,6 +96,7 @@ main() write_ucs2(product, "iProduct"); write_ucs2(sprintf("%06d", serial), "iSerial"); write_int(serial, "iSerial"); + write_hex(id_product, "idProduct"); write_string(version, "iVersion"); } |