Commit 47469248e09f6bf9abb00b9fafbb9bfd209a14f6

Con Kolivas 2014-04-22T20:22:41

Use usb serial strings as unique id if devices have them

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/cgminer.c b/cgminer.c
index 615efdd..fff7482 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -8928,6 +8928,10 @@ bool add_cgpu(struct cgpu_info *cgpu)
 		devices[total_devices++] = cgpu;
 
 	adjust_mostdevs();
+#ifdef USE_USBUTILS
+	if (cgpu->usbdev && !cgpu->unique_id && cgpu->usbdev->serial_string)
+		cgpu->unique_id = str_text(cgpu->usbdev->serial_string);
+#endif
 	return true;
 }