From 0e0844b78b529d4afc1c33fc4e088d543b30b5bd Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Fri, 10 Aug 2012 21:27:18 +0200 Subject: main: Fail if device is not in NOLO mode, show NOLO version --- src/main2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') 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"); @@ -769,6 +776,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)"); -- cgit v1.2.3