This undoes the essence of commit
bf700f679af2, which introduced the
default conn= spec. Which improved usability: Users just select the
device and need not specify the connection. But also resulted in the
UT32x thermometer driver's probe to "succeed" as soon as the WCH CH9325
chip was found, no data check was involved in the scan. Unfortunately
this chip is also used in the popular UT-D04 cable, and thus there were
many false positives.
struct dev_context *devc;
size_t i;
- conn = "hid/ch9325";
+ /*
+ * Implementor's note: Do _not_ add a default conn value here,
+ * always expect users to specify the connection. Otherwise the
+ * UT32x driver's scan routine results in false positives, will
+ * match _any_ UT-D04 cable which uses the same USB HID chip.
+ */
+ conn = NULL;
serialcomm = "2400/8n1";
for (l = options; l; l = l->next) {
src = l->data;
break;
}
}
+ if (!conn)
+ return NULL;
devices = NULL;
serial = sr_serial_dev_inst_new(conn, serialcomm);