package com.ifpdos.factorytest.mic.hid;

/* JADX INFO: loaded from: classes.dex */
public class HardwareStatus {
    public static int LINEIN_CHS = 2;
    public static int MAX_INPUT_CHS = 16;
    public static int MIC_CHS = 16;
    public static int MIC_HW_CMD_REQ_TEST = 1;
    public static int MIC_HW_RET_TESTING_MASK = Integer.MIN_VALUE;
    public static int REF_CHS = 2;
    public float[] adcAmpAbsAvg;
    public float[] adcAmpAbsSum;
    public float[] adcAmpAvg;
    public float[] adcAmpSum;
    public int calAmpCnt;
    public int frameCnt;
    public int keyStat;
    public int ledStat;
    public int maxChs;
    public int micHwTestStat;
    public int numChs;

    public HardwareStatus() {
        int i = MAX_INPUT_CHS;
        this.adcAmpAbsSum = new float[i];
        this.adcAmpSum = new float[i];
        this.adcAmpAbsAvg = new float[i];
        this.adcAmpAvg = new float[i];
    }

    public boolean parserFromBuffer(byte[] bArr) {
        if (bArr.length != 512) {
            return false;
        }
        this.maxChs = NumberHelper.getIntFromBuf(bArr, 12);
        this.numChs = NumberHelper.getIntFromBuf(bArr, 16);
        this.calAmpCnt = NumberHelper.getIntFromBuf(bArr, 20);
        int i = 24;
        this.frameCnt = NumberHelper.getIntFromBuf(bArr, 24);
        for (int i2 = 0; i2 < MAX_INPUT_CHS; i2++) {
            i += 4;
            this.adcAmpAbsSum[i2] = NumberHelper.getFloatFromBuf(bArr, i);
        }
        for (int i3 = 0; i3 < MAX_INPUT_CHS; i3++) {
            i += 4;
            this.adcAmpSum[i3] = NumberHelper.getFloatFromBuf(bArr, i);
        }
        for (int i4 = 0; i4 < MAX_INPUT_CHS; i4++) {
            i += 4;
            this.adcAmpAbsAvg[i4] = NumberHelper.getFloatFromBuf(bArr, i);
        }
        for (int i5 = 0; i5 < MAX_INPUT_CHS; i5++) {
            i += 4;
            this.adcAmpAvg[i5] = NumberHelper.getFloatFromBuf(bArr, i);
        }
        this.ledStat = NumberHelper.getIntFromBuf(bArr, i + 4);
        this.keyStat = NumberHelper.getIntFromBuf(bArr, i + 8);
        this.micHwTestStat = NumberHelper.getIntFromBuf(bArr, i + 12);
        return true;
    }
}
