X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fserial-dmm%2Fapi.c;h=019bf2096695bda5c8f94021d4dabb5ef434775d;hb=c06785841cd217ad01e32be9201dca69b1f8818d;hp=af70fc302a0a7c811a0b7a7f4958e0dcaa403f46;hpb=15a5bfe4815f9991a9bb532c05d6244a1818a0e4;p=libsigrok.git diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index af70fc30..019bf209 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -185,7 +185,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) devc = sdi->priv; sr_sw_limits_acquisition_start(&devc->limits); - std_session_send_df_header(sdi, LOG_PREFIX); + std_session_send_df_header(sdi); /* Poll every 50ms, or whenever some data comes in. */ serial = sdi->conn; @@ -195,12 +195,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close, - sdi->conn, LOG_PREFIX); -} - #define DMM(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, \ DELAY, REQUEST, VALID, PARSE, DETAILS) \ &((struct dmm_info) { \ @@ -218,7 +212,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) .dev_open = std_serial_dev_open, \ .dev_close = std_serial_dev_close, \ .dev_acquisition_start = dev_acquisition_start, \ - .dev_acquisition_stop = dev_acquisition_stop, \ + .dev_acquisition_stop = std_serial_dev_acquisition_stop, \ .context = NULL, \ }, \ VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, DELAY, \ @@ -226,6 +220,28 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) }).di SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers, + /* + * The items are sorted by chipset first and then model name. + * + * This reflects the developer's perspective and is preferrable + * during maintenance, as a vendor/product based sort order does + * not work well for rebranded models, and from a support point + * of view it's more important to identify similarities between + * models and compatible devices. + * + * Fold marks {{{ }}} with matching braces were added, to further + * speed up navigation in the long list. + */ + /* bm25x based meters {{{ */ + DMM( + "brymen-bm25x", bm25x, + "Brymen", "BM25x", "9600/8n1/rts=1/dtr=1", + 9600, BRYMEN_BM25X_PACKET_SIZE, 0, 0, NULL, + sr_brymen_bm25x_packet_valid, sr_brymen_bm25x_parse, + NULL + ), + /* }}} */ + /* meters based on other chips (to get sorted) */ DMM( "bbcgm-2010", metex14, "BBC Goertz Metrawatt", "M2110", "1200/7n2", 1200, @@ -541,13 +557,6 @@ SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers, sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse, NULL ), - DMM( - "brymen-bm25x", bm25x, - "Brymen", "BM25x", "9600/8n1/rts=1/dtr=1", - 9600, BRYMEN_BM25X_PACKET_SIZE, 0, 0, NULL, - sr_brymen_bm25x_packet_valid, sr_brymen_bm25x_parse, - NULL - ), DMM( "velleman-dvm4100", dtm0660, "Velleman", "DVM4100", "2400/8n1/rts=0/dtr=1", @@ -560,4 +569,11 @@ SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers, 2400, DTM0660_PACKET_SIZE, 0, 0, NULL, sr_dtm0660_packet_valid, sr_dtm0660_parse, NULL ), + DMM( + "peaktech-3330", fs9721, + "Peaktech", "3330", "2400/8n1/dtr=1", 2400, + FS9721_PACKET_SIZE, 0, 0, NULL, + sr_fs9721_packet_valid, sr_fs9721_parse, + sr_fs9721_01_10_temp_f_c + ), );