X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fserial-dmm%2Fapi.c;h=eaf913f271ab1fff7ed54e6acc24bd95cad69f51;hb=695dc859c15ba4190f5c1aa2e1a6e2dc6a6e5845;hp=5a89b3d158ad7d5660ce9812899faf9f5d1b55f0;hpb=41812aca436805b0614f2a8f31cf2f8ce494aea0;p=libsigrok.git diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index 5a89b3d1..eaf913f2 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -19,13 +19,13 @@ * along with this program. If not, see . */ +#include #include #include #include #include -#include #include -#include "libsigrok.h" +#include #include "libsigrok-internal.h" #include "protocol.h" @@ -211,7 +211,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * return SR_OK; } -static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) +static int dev_acquisition_start(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_serial_dev_inst *serial; @@ -219,12 +219,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; - if (!(devc = sdi->priv)) { - sr_err("sdi->priv was NULL."); - return SR_ERR_BUG; - } - - devc->cb_data = cb_data; + devc = sdi->priv; /* * Reset the number of samples to take. If we've already collected our @@ -234,8 +229,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) devc->num_samples = 0; devc->starttime = g_get_monotonic_time(); - /* Send header packet to the session bus. */ - std_session_send_df_header(cb_data, LOG_PREFIX); + std_session_send_df_header(sdi, LOG_PREFIX); /* Poll every 50ms, or whenever some data comes in. */ serial = sdi->conn; @@ -245,9 +239,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) +static int dev_acquisition_stop(struct sr_dev_inst *sdi) { - return std_serial_dev_acquisition_stop(sdi, cb_data, std_serial_dev_close, + return std_serial_dev_acquisition_stop(sdi, sdi, std_serial_dev_close, sdi->conn, LOG_PREFIX); } @@ -559,6 +553,24 @@ SR_PRIV const struct dmm_info *serial_dmm_drivers[] = { sr_es519xx_2400_11b_packet_valid, sr_es519xx_2400_11b_parse, NULL ), + DMM( + "tenma-72-7730-ser", ut71x, + "Tenma", "72-7730 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", + 2400, UT71X_PACKET_SIZE, 0, 0, NULL, + sr_ut71x_packet_valid, sr_ut71x_parse, NULL + ), + DMM( + "tenma-72-7732-ser", ut71x, + "Tenma", "72-7732 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", + 2400, UT71X_PACKET_SIZE, 0, 0, NULL, + sr_ut71x_packet_valid, sr_ut71x_parse, NULL + ), + DMM( + "tenma-72-9380a-ser", ut71x, + "Tenma", "72-9380A (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", + 2400, UT71X_PACKET_SIZE, 0, 0, NULL, + sr_ut71x_packet_valid, sr_ut71x_parse, NULL + ), DMM( "tenma-72-7745-ser", fs9721, "Tenma", "72-7745 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", @@ -581,5 +593,17 @@ SR_PRIV const struct dmm_info *serial_dmm_drivers[] = { sr_brymen_bm25x_packet_valid, sr_brymen_bm25x_parse, NULL ), + DMM( + "velleman-dvm4100", dtm0660, + "Velleman", "DVM4100", "2400/8n1/rts=0/dtr=1", + 2400, DTM0660_PACKET_SIZE, 0, 0, NULL, + sr_dtm0660_packet_valid, sr_dtm0660_parse, NULL + ), + DMM( + "peaktech-3415", dtm0660, + "Peaktech", "3415", "2400/8n1/rts=0/dtr=1", + 2400, DTM0660_PACKET_SIZE, 0, 0, NULL, + sr_dtm0660_packet_valid, sr_dtm0660_parse, NULL + ), NULL };