hardware/common/dmm: Fix debug output level.
Most messages from the DMM parsers are not hard errors, lower to sr_dbg() so that the sigrok-cli output doesn't get cluttered (by default) with debug output such as: P1: 0.001100 V DC AUTO sr: fs9721: Sync nibble in byte 0 (0x00) is invalid. P1: 0.001100 V DC AUTO (using -l 4 or -l 5 will still allow the user to see such messages)
This commit is contained in:
parent
2710cb53fd
commit
ec5186f936
|
@ -111,7 +111,7 @@ static int parse_value(const uint8_t *buf, struct es519xx_info *info,
|
|||
} else if (!isdigit(buf[1]) || !isdigit(buf[2]) ||
|
||||
!isdigit(buf[3]) || !isdigit(buf[4]) ||
|
||||
(num_digits == 5 && !isdigit(buf[5]))) {
|
||||
sr_err("Value contained invalid digits: %02x %02x %02x %02x "
|
||||
sr_dbg("Value contained invalid digits: %02x %02x %02x %02x "
|
||||
"(%c %c %c %c).", buf[1], buf[2], buf[3], buf[4],
|
||||
buf[1], buf[2], buf[3], buf[4]);
|
||||
return SR_ERR;
|
||||
|
@ -339,7 +339,7 @@ static void parse_flags(const uint8_t *buf, struct es519xx_info *info)
|
|||
info->is_adp3 = TRUE;
|
||||
break;
|
||||
default:
|
||||
sr_err("Invalid function byte: 0x%02x.", buf[function]);
|
||||
sr_dbg("Invalid function byte: 0x%02x.", buf[function]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -407,7 +407,7 @@ static void parse_flags(const uint8_t *buf, struct es519xx_info *info)
|
|||
info->is_adp3 = TRUE;
|
||||
break;
|
||||
default:
|
||||
sr_err("Invalid function byte: 0x%02x.", buf[function]);
|
||||
sr_dbg("Invalid function byte: 0x%02x.", buf[function]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ static gboolean flags_valid(const struct es519xx_info *info)
|
|||
count = (info->is_micro) ? 1 : 0;
|
||||
count += (info->is_milli) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one multiplier detected in packet.");
|
||||
sr_dbg("More than one multiplier detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -568,13 +568,13 @@ static gboolean flags_valid(const struct es519xx_info *info)
|
|||
count += (info->is_diode) ? 1 : 0;
|
||||
count += (info->is_rpm) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one measurement type detected in packet.");
|
||||
sr_dbg("More than one measurement type detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Both AC and DC set? */
|
||||
if (info->is_ac && info->is_dc) {
|
||||
sr_err("Both AC and DC flags detected in packet.");
|
||||
sr_dbg("Both AC and DC flags detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -612,7 +612,7 @@ static int sr_es519xx_parse(const uint8_t *buf, float *floatval,
|
|||
return SR_ERR;
|
||||
|
||||
if ((ret = parse_value(buf, info, floatval)) != SR_OK) {
|
||||
sr_err("Error parsing value: %d.", ret);
|
||||
sr_dbg("Error parsing value: %d.", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ static int parse_digit(uint8_t b)
|
|||
case 0x3f:
|
||||
return 9;
|
||||
default:
|
||||
sr_err("Invalid digit byte: 0x%02x.", b);
|
||||
sr_dbg("Invalid digit byte: 0x%02x.", b);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ static gboolean sync_nibbles_valid(const uint8_t *buf)
|
|||
/* Check the synchronization nibbles, and make sure they all match. */
|
||||
for (i = 0; i < FS9721_PACKET_SIZE; i++) {
|
||||
if (((buf[i] >> 4) & 0x0f) != (i + 1)) {
|
||||
sr_err("Sync nibble in byte %d (0x%02x) is invalid.",
|
||||
sr_dbg("Sync nibble in byte %d (0x%02x) is invalid.",
|
||||
i, buf[i]);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ static gboolean flags_valid(const struct fs9721_info *info)
|
|||
count += (info->is_kilo) ? 1 : 0;
|
||||
count += (info->is_mega) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one multiplier detected in packet.");
|
||||
sr_dbg("More than one multiplier detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -110,19 +110,19 @@ static gboolean flags_valid(const struct fs9721_info *info)
|
|||
count += (info->is_volt) ? 1 : 0;
|
||||
count += (info->is_percent) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one measurement type detected in packet.");
|
||||
sr_dbg("More than one measurement type detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Both AC and DC set? */
|
||||
if (info->is_ac && info->is_dc) {
|
||||
sr_err("Both AC and DC flags detected in packet.");
|
||||
sr_dbg("Both AC and DC flags detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* RS232 flag not set? */
|
||||
if (!info->is_rs232) {
|
||||
sr_err("No RS232 flag detected in packet.");
|
||||
sr_dbg("No RS232 flag detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval,
|
|||
info_local = (struct fs9721_info *)info;
|
||||
|
||||
if ((ret = parse_value(buf, floatval)) != SR_OK) {
|
||||
sr_err("Error parsing value: %d.", ret);
|
||||
sr_dbg("Error parsing value: %d.", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static gboolean flags_valid(const struct fs9922_info *info)
|
|||
count += (info->is_kilo) ? 1 : 0;
|
||||
count += (info->is_mega) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one multiplier detected in packet.");
|
||||
sr_dbg("More than one multiplier detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -66,19 +66,19 @@ static gboolean flags_valid(const struct fs9922_info *info)
|
|||
count += (info->is_celsius) ? 1 : 0;
|
||||
count += (info->is_fahrenheit) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one measurement type detected in packet.");
|
||||
sr_dbg("More than one measurement type detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Both AC and DC set? */
|
||||
if (info->is_ac && info->is_dc) {
|
||||
sr_err("Both AC and DC flags detected in packet.");
|
||||
sr_dbg("Both AC and DC flags detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Both Celsius and Fahrenheit set? */
|
||||
if (info->is_celsius && info->is_fahrenheit) {
|
||||
sr_err("Both Celsius and Fahrenheit flags detected in packet.");
|
||||
sr_dbg("Both Celsius and Fahrenheit flags detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ static int parse_value(const uint8_t *buf, float *result)
|
|||
} else if (buf[0] == '-') {
|
||||
sign = -1;
|
||||
} else {
|
||||
sr_err("Invalid sign byte: 0x%02x.", buf[0]);
|
||||
sr_dbg("Invalid sign byte: 0x%02x.", buf[0]);
|
||||
return SR_ERR;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ static int parse_value(const uint8_t *buf, float *result)
|
|||
return SR_OK;
|
||||
} else if (!isdigit(buf[1]) || !isdigit(buf[2]) ||
|
||||
!isdigit(buf[3]) || !isdigit(buf[4])) {
|
||||
sr_err("Value contained invalid digits: %02x %02x %02x %02x ("
|
||||
sr_dbg("Value contained invalid digits: %02x %02x %02x %02x ("
|
||||
"%c %c %c %c).", buf[1], buf[2], buf[3], buf[4]);
|
||||
return SR_ERR;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ static int parse_value(const uint8_t *buf, float *result)
|
|||
* used, but '0'/'1'/'2'/'4' is actually correct.
|
||||
*/
|
||||
if (buf[6] != '0' && buf[6] != '1' && buf[6] != '2' && buf[6] != '4') {
|
||||
sr_err("Invalid decimal point value: 0x%02x.", buf[6]);
|
||||
sr_dbg("Invalid decimal point value: 0x%02x.", buf[6]);
|
||||
return SR_ERR;
|
||||
}
|
||||
if (buf[6] == '0')
|
||||
|
@ -359,7 +359,7 @@ SR_PRIV int sr_fs9922_parse(const uint8_t *buf, float *floatval,
|
|||
info_local = (struct fs9922_info *)info;
|
||||
|
||||
if ((ret = parse_value(buf, floatval)) != SR_OK) {
|
||||
sr_err("Error parsing value: %d.", ret);
|
||||
sr_dbg("Error parsing value: %d.", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ static gboolean flags_valid(const struct metex14_info *info)
|
|||
count += (info->is_kilo) ? 1 : 0;
|
||||
count += (info->is_mega) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one multiplier detected in packet.");
|
||||
sr_dbg("More than one multiplier detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -234,13 +234,13 @@ static gboolean flags_valid(const struct metex14_info *info)
|
|||
count += (info->is_diode) ? 1 : 0;
|
||||
count += (info->is_frequency) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one measurement type detected in packet.");
|
||||
sr_dbg("More than one measurement type detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Both AC and DC set? */
|
||||
if (info->is_ac && info->is_dc) {
|
||||
sr_err("Both AC and DC flags detected in packet.");
|
||||
sr_dbg("Both AC and DC flags detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval,
|
|||
sr_dbg("DMM packet: \"%.13s\"", buf);
|
||||
|
||||
if ((ret = parse_value(buf, floatval)) != SR_OK) {
|
||||
sr_err("Error parsing value: %d.", ret);
|
||||
sr_dbg("Error parsing value: %d.", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ static gboolean selection_good(const struct rs9lcd_packet *rs_packet)
|
|||
count += (rs_packet->indicatrix2 & IND2_MICRO) ? 1 : 0;
|
||||
count += (rs_packet->indicatrix2 & IND2_NANO) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one multiplier detected in packet.");
|
||||
sr_dbg("More than one multiplier detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ static gboolean selection_good(const struct rs9lcd_packet *rs_packet)
|
|||
count += (rs_packet->indicatrix2 & IND2_DUTY) ? 1 : 0;
|
||||
count += (rs_packet->indicatrix2 & IND2_HFE) ? 1 : 0;
|
||||
if (count > 1) {
|
||||
sr_err("More than one measurement type detected in packet.");
|
||||
sr_dbg("More than one measurement type detected in packet.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ static uint8_t decode_digit(uint8_t raw_digit)
|
|||
case LCD_9:
|
||||
return 9;
|
||||
default:
|
||||
sr_err("Invalid digit byte: 0x%02x.", raw_digit);
|
||||
sr_dbg("Invalid digit byte: 0x%02x.", raw_digit);
|
||||
return 0xff;
|
||||
}
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval,
|
|||
analog->mqflags |= SR_MQFLAG_AC;
|
||||
break;
|
||||
default:
|
||||
sr_err("Unknown mode: %d.", rs_packet->mode);
|
||||
sr_dbg("Unknown mode: %d.", rs_packet->mode);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue