} 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;
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 {
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;
}
}
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;
}
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;
}
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;
}
*/
SR_PRIV gboolean sr_es519xx_2400_11b_packet_valid(const uint8_t *buf)
{
- struct es519xx_info info = { 0 };
+ struct es519xx_info info;
+ memset(&info, 0, sizeof(struct es519xx_info));
info.baudrate = 2400;
info.packet_size = 11;
*/
SR_PRIV gboolean sr_es519xx_2400_11b_altfn_packet_valid(const uint8_t *buf)
{
- struct es519xx_info info = { 0 };
+ struct es519xx_info info;
+ memset(&info, 0, sizeof(struct es519xx_info));
info.baudrate = 2400;
info.packet_size = 11;
info.alt_functions = TRUE;
*/
SR_PRIV gboolean sr_es519xx_19200_11b_5digits_packet_valid(const uint8_t *buf)
{
- struct es519xx_info info = { 0 };
+ struct es519xx_info info;
+ memset(&info, 0, sizeof(struct es519xx_info));
info.baudrate = 19200;
info.packet_size = 11;
info.fivedigits = TRUE;
*/
SR_PRIV gboolean sr_es519xx_19200_11b_clamp_packet_valid(const uint8_t *buf)
{
- struct es519xx_info info = { 0 };
+ struct es519xx_info info;
+ memset(&info, 0, sizeof(struct es519xx_info));
info.baudrate = 19200;
info.packet_size = 11;
info.clampmeter = TRUE;
*/
SR_PRIV gboolean sr_es519xx_19200_11b_packet_valid(const uint8_t *buf)
{
- struct es519xx_info info = { 0 };
+ struct es519xx_info info;
+ memset(&info, 0, sizeof(struct es519xx_info));
info.baudrate = 19200;
info.packet_size = 11;
*/
SR_PRIV gboolean sr_es519xx_19200_14b_packet_valid(const uint8_t *buf)
{
- struct es519xx_info info = { 0 };
+ struct es519xx_info info;
+ memset(&info, 0, sizeof(struct es519xx_info));
info.baudrate = 19200;
info.packet_size = 14;
*/
SR_PRIV gboolean sr_es519xx_19200_14b_sel_lpf_packet_valid(const uint8_t *buf)
{
- struct es519xx_info info = { 0 };
+ struct es519xx_info info;
+ memset(&info, 0, sizeof(struct es519xx_info));
info.baudrate = 19200;
info.packet_size = 14;
info.selectable_lpf = TRUE;