X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Funi-t-dmm%2Fapi.c;h=e6239a1a3edb3b9ee86c770b8688e1e1f80b18e4;hb=c36923b03b343bcdbda55e5167a36e1c63b527a7;hp=05c1c47e4e0204c2b53ec9f4d771a3eaaacb37fa;hpb=4d7ddff75b8c23fc8d5355c480df029b130cec0c;p=libsigrok.git diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index 05c1c47e..e6239a1a 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -45,32 +45,33 @@ SR_PRIV struct sr_dev_driver uni_t_ut61e_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc830_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc840_driver_info; +SR_PRIV struct sr_dev_driver tenma_72_7745_driver_info; SR_PRIV struct dmm_info udmms[] = { { "Tecpel", "DMM-8061", 2400, - FS9721_PACKET_SIZE, NULL, + FS9721_PACKET_SIZE, sr_fs9721_packet_valid, sr_fs9721_parse, sr_fs9721_00_temp_c, &tecpel_dmm_8061_driver_info, receive_data_TECPEL_DMM_8061, }, { "UNI-T", "UT60A", 2400, - FS9721_PACKET_SIZE, NULL, + FS9721_PACKET_SIZE, sr_fs9721_packet_valid, sr_fs9721_parse, NULL, &uni_t_ut60a_driver_info, receive_data_UNI_T_UT60A, }, { "UNI-T", "UT60E", 2400, - FS9721_PACKET_SIZE, NULL, + FS9721_PACKET_SIZE, sr_fs9721_packet_valid, sr_fs9721_parse, sr_fs9721_00_temp_c, &uni_t_ut60e_driver_info, receive_data_UNI_T_UT60E, }, { "UNI-T", "UT61D", 2400, - FS9922_PACKET_SIZE, NULL, + FS9922_PACKET_SIZE, sr_fs9922_packet_valid, sr_fs9922_parse, NULL, &uni_t_ut61d_driver_info, receive_data_UNI_T_UT61D, @@ -86,32 +87,46 @@ SR_PRIV struct dmm_info udmms[] = { * this DMM, of course). */ "UNI-T", "UT61E", 19200, - ES51922_PACKET_SIZE, NULL, + ES51922_PACKET_SIZE, sr_es51922_packet_valid, sr_es51922_parse, NULL, &uni_t_ut61e_driver_info, receive_data_UNI_T_UT61E, }, { "Voltcraft", "VC-820", 2400, - FS9721_PACKET_SIZE, NULL, + FS9721_PACKET_SIZE, sr_fs9721_packet_valid, sr_fs9721_parse, NULL, &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, + FS9922_PACKET_SIZE, sr_fs9922_packet_valid, sr_fs9922_parse, - NULL, + &sr_fs9922_z1_diode, &voltcraft_vc830_driver_info, receive_data_VOLTCRAFT_VC830, }, { "Voltcraft", "VC-840", 2400, - FS9721_PACKET_SIZE, NULL, + FS9721_PACKET_SIZE, sr_fs9721_packet_valid, sr_fs9721_parse, sr_fs9721_00_temp_c, &voltcraft_vc840_driver_info, receive_data_VOLTCRAFT_VC840, }, + { + "Tenma", "72-7745", 2400, + FS9721_PACKET_SIZE, + sr_fs9721_packet_valid, sr_fs9721_parse, + sr_fs9721_00_temp_c, + &tenma_72_7745_driver_info, + /* This is a basic rebadge of the UT60E. */ + receive_data_UNI_T_UT60E, + }, }; static int dev_clear(int dmm) @@ -149,7 +164,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))) { @@ -224,10 +239,13 @@ static int cleanup(int dmm) return dev_clear(dmm); } -static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) +static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, + const struct sr_probe_group *probe_group) { struct dev_context *devc; + (void)probe_group; + devc = sdi->priv; switch (id) { @@ -256,9 +274,11 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) return SR_OK; } -static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi) +static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, + const struct sr_probe_group *probe_group) { (void)sdi; + (void)probe_group; switch (key) { case SR_CONF_SCAN_OPTIONS: @@ -368,3 +388,4 @@ DRV(uni_t_ut61e, UNI_T_UT61E, "uni-t-ut61e", "UNI-T UT61E") DRV(voltcraft_vc820, VOLTCRAFT_VC820, "voltcraft-vc820", "Voltcraft VC-820") DRV(voltcraft_vc830, VOLTCRAFT_VC830, "voltcraft-vc830", "Voltcraft VC-830") DRV(voltcraft_vc840, VOLTCRAFT_VC840, "voltcraft-vc840", "Voltcraft VC-840") +DRV(tenma_72_7745, TENMA_72_7745, "tenma-72-7745", "Tenma 72-7745")