Skip to content

Commit 56b90c3

Browse files
committed
allow --list to show firmware version
1 parent 70965a7 commit 56b90c3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

blink1-tool.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
// set to 1 to enable mk3 features
3333
#define ENABLE_MK3 1
3434

35+
// normally this is obtained from git tags and filled out by the Makefile
3536
#ifndef BLINK1_VERSION
3637
#define BLINK1_VERSION "v0.0"
3738
#endif
@@ -521,11 +522,15 @@ int main(int argc, char** argv)
521522

522523
// begin command processing
523524

524-
if( cmd == CMD_LIST ) {
525+
if( cmd == CMD_LIST ) {
526+
blink1_close(dev);
525527
printf("blink(1) list: \n");
526528
for( int i=0; i< count; i++ ) {
527-
printf("id:%d - serialnum:%s %s\n", i, blink1_getCachedSerial(i),
528-
(blink1_isMk2ById(i)) ? "(mk2)":"");
529+
dev = blink1_openBySerial( blink1_getCachedSerial(i) );
530+
rc = blink1_getVersion(dev);
531+
blink1_close(dev);
532+
printf("id:%d - serialnum:%s %s fw version:%d\n", i, blink1_getCachedSerial(i),
533+
(blink1_isMk2ById(i)) ? "(mk2)":"", rc);
529534
}
530535
#ifdef USE_HIDDATA
531536
printf("(Listing not supported in HIDDATA builds)\n");

0 commit comments

Comments
 (0)