X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdmm%2Fmetex14.c;h=65a3f1fe78a481c47509ab33c1a701dac216cd26;hb=e71062d99b0dd565258abb5a3d975379bf9febdb;hp=2677484a743608e87451fc0db7d2da266f726d50;hpb=e677490e58a5ce8f2e735c7d5a53fb1f62e778e6;p=libsigrok.git diff --git a/src/dmm/metex14.c b/src/dmm/metex14.c index 2677484a..65a3f1fe 100644 --- a/src/dmm/metex14.c +++ b/src/dmm/metex14.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ /** @@ -153,17 +152,17 @@ static void parse_flags(const char *buf, struct metex14_info *info) info->is_unitless = TRUE; /* Bytes 0-1: Measurement mode, except AC/DC */ - info->is_resistance = !strncmp(buf, "OH", 2) || + info->is_resistance = !strncmp(buf, "OH", 2) || (!strncmp(buf, " ", 2) && info->is_ohm); - info->is_capacity = !strncmp(buf, "CA", 2) || + info->is_capacity = !strncmp(buf, "CA", 2) || (!strncmp(buf, " ", 2) && info->is_farad); info->is_temperature = !strncmp(buf, "TE", 2); - info->is_diode = !strncmp(buf, "DI", 2) || + info->is_diode = !strncmp(buf, "DI", 2) || (!strncmp(buf, " ", 2) && info->is_volt && info->is_milli); - info->is_frequency = !strncmp(buf, "FR", 2) || + info->is_frequency = !strncmp(buf, "FR", 2) || (!strncmp(buf, " ", 2) && info->is_hertz); - info->is_gain = !strncmp(buf, "DB", 2); - info->is_hfe = !strncmp(buf, "HF", 2) || + info->is_gain = !strncmp(buf, "DB", 2); + info->is_hfe = !strncmp(buf, "HF", 2) || (!strncmp(buf, " ", 2) && !info->is_volt && !info->is_ohm && !info->is_logic && !info->is_farad && !info->is_hertz); /* @@ -294,7 +293,7 @@ SR_PRIV int sr_metex14_packet_request(struct sr_serial_dev_inst *serial) sr_spew("Requesting DMM packet."); - return (serial_write_nonblocking(serial, &wbuf, 1) == 1) ? SR_OK : SR_ERR; + return serial_write_blocking(serial, &wbuf, 1, 0); } #endif @@ -350,7 +349,7 @@ SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval, parse_flags((const char *)buf, info_local); handle_flags(analog, floatval, &exponent, info_local); - analog->encoding->digits = -exponent; + analog->encoding->digits = -exponent; analog->spec->spec_digits = -exponent; return SR_OK;