]> sigrok.org Git - libsigrok.git/blobdiff - hardware/uni-t-dmm/api.c
Voltcraft VC-830: Fix diode mode handling.
[libsigrok.git] / hardware / uni-t-dmm / api.c
index dbab6da95e6ef6261c96cc26eb1764613b63ecc8..b23fc02cb3e5791fd22babafc83f67db2d5702c5 100644 (file)
@@ -76,7 +76,16 @@ SR_PRIV struct dmm_info udmms[] = {
                &uni_t_ut61d_driver_info, receive_data_UNI_T_UT61D,
        },
        {
-               "UNI-T", "UT61E", 19230,
+               /*
+                * Important: The actual baudrate of the Cyrustek ES51922 chip
+                * used in this DMM is 19230. However, the WCH CH9325 chip
+                * (UART to USB/HID) used in (some versions of) the UNI-T
+                * UT-D04 cable doesn't support 19230 baud. It only supports
+                * 19200, and setting an unsupported baudrate will result in
+                * the default of 2400 being used (which will not work with
+                * this DMM, of course).
+                */
+               "UNI-T", "UT61E", 19200,
                ES51922_PACKET_SIZE, NULL,
                sr_es51922_packet_valid, sr_es51922_parse,
                NULL,
@@ -90,10 +99,15 @@ SR_PRIV struct dmm_info udmms[] = {
                &voltcraft_vc820_driver_info, receive_data_VOLTCRAFT_VC820,
        },
        {
+               /*
+                * Note: The VC830 doesn't set the 'volt' and 'diode' bits of
+                * the FS9922 protocol. Instead, it only sets the user-defined
+                * bit "z1" to indicate "diode mode" and "voltage".
+                */
                "Voltcraft", "VC-830", 2400,
                FS9922_PACKET_SIZE, NULL,
                sr_fs9922_packet_valid, sr_fs9922_parse,
-               NULL,
+               &sr_fs9922_z1_diode,
                &voltcraft_vc830_driver_info, receive_data_VOLTCRAFT_VC830,
        },
        {
@@ -140,7 +154,7 @@ static GSList *scan(GSList *options, int dmm)
                }
        }
        if (!conn)
-               conn = UNI_T_UT_D04_NEW;
+               return NULL;
 
        devices = NULL;
        if (!(usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, conn))) {