- /* Does the packet "measure" more than one type of value ?*/
- if(data->indicatrix1 & RS_22_812_IND1_HZ)
- n_type++;
- if(data->indicatrix1 & RS_22_812_IND1_OHM)
- n_type++;
- if(data->indicatrix1 & RS_22_812_IND1_FARAD)
- n_type++;
- if(data->indicatrix1 & RS_22_812_IND1_AMP)
- n_type++;
- if(data->indicatrix1 & RS_22_812_IND1_VOLT)
- n_type++;
- if(data->indicatrix2 & RS_22_812_IND2_DBM)
- n_type++;
- if(data->indicatrix2 & RS_22_812_IND2_SEC)
- n_type++;
- if(data->indicatrix2 & RS_22_812_IND2_DUTY)
- n_type++;
- if(data->indicatrix2 & RS_22_812_IND2_HFE)
- n_type++;
- if(n_type > 1)
+ /* Does the packet "measure" more than one type of value? */
+ count = 0;
+ count += (rs_packet->indicatrix1 & RS_22_812_IND1_HZ) ? 1 : 0;
+ count += (rs_packet->indicatrix1 & RS_22_812_IND1_OHM) ? 1 : 0;
+ count += (rs_packet->indicatrix1 & RS_22_812_IND1_FARAD) ? 1 : 0;
+ count += (rs_packet->indicatrix1 & RS_22_812_IND1_AMP) ? 1 : 0;
+ count += (rs_packet->indicatrix1 & RS_22_812_IND1_VOLT) ? 1 : 0;
+ count += (rs_packet->indicatrix2 & RS_22_812_IND2_DBM) ? 1 : 0;
+ count += (rs_packet->indicatrix2 & RS_22_812_IND2_SEC) ? 1 : 0;
+ count += (rs_packet->indicatrix2 & RS_22_812_IND2_DUTY) ? 1 : 0;
+ count += (rs_packet->indicatrix2 & RS_22_812_IND2_HFE) ? 1 : 0;
+ if (count > 1) {
+ sr_err("More than one measurement type detected in packet.");