diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-08-10 21:27:18 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-08-10 21:27:18 +0200 |
commit | 0e0844b78b529d4afc1c33fc4e088d543b30b5bd (patch) | |
tree | 163a60922109baffa194fca46cb8ddf2c4fa215e | |
parent | a1d95afbf7ef368d0d9cd9a9e93eb795a4aae07e (diff) | |
download | 0xFFFF-0e0844b78b529d4afc1c33fc4e088d543b30b5bd.tar.bz2 |
main: Fail if device is not in NOLO mode, show NOLO version
-rw-r--r-- | src/main2.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main2.c b/src/main2.c index 926f3b1..670e1ef 100644 --- a/src/main2.c +++ b/src/main2.c @@ -742,6 +742,13 @@ int main(int argc, char **argv) { } + if ( usb_dev->flash_device->protocol != FLASH_NOLO ) { + printf("Only NOLO protocol is supported now\n"); + usb_close_device(usb_dev); + usb_dev = NULL; + break; + } + /* device identify */ if ( nolo_init(usb_dev) < 0 ) { printf("Cannot initialize NOLO\n"); @@ -770,6 +777,10 @@ int main(int argc, char **argv) { printf("HW revision: %s\n", hwrev); buf[0] = 0; + nolo_get_nolo_ver(usb_dev, buf, sizeof(buf)); + printf("NOLO version: %s\n", buf[0] ? buf : "(not detected)"); + + buf[0] = 0; nolo_get_sw_ver(usb_dev, buf, sizeof(buf)); printf("Software release version: %s\n", buf[0] ? buf : "(not detected)"); |