package com.cvte.vman.impl;

import android.os.Parcel;
import com.cvte.vman.SensorBoxCtrl;
import com.cvte.vman.VmanMiddleWare;
import com.cvte.vman.entity.EntityFwSensorBox;
import com.cvte.vman.instance.InvokeCmd;
import com.cvte.vman.utils.CLog;
import java.util.ArrayList;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public class SensorBoxCtrlManager extends SensorBoxCtrl {
    public static final String TAG = "Cvte@SensorBoxCtrlManager";
    private static SensorBoxCtrlManager mSensorBoxCtrlManager;

    private SensorBoxCtrlManager() {
    }

    public static synchronized SensorBoxCtrlManager getInstance() {
        if (mSensorBoxCtrlManager == null) {
            synchronized (SensorBoxCtrlManager.class) {
                if (mSensorBoxCtrlManager == null) {
                    mSensorBoxCtrlManager = new SensorBoxCtrlManager();
                }
            }
        }
        return mSensorBoxCtrlManager;
    }

    @Override // com.cvte.vman.SensorBoxCtrl
    public List<EntityFwSensorBox> getFwSensorBoxList() {
        ArrayList arrayList = new ArrayList();
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_SENSORBOX_GET_DEVICELIST);
        parcelExcuteCommandSet_Parcel.readInt();
        int i = parcelExcuteCommandSet_Parcel.readInt();
        CLog.e("getFwSensorBoxList  sensorbox_num =" + i);
        for (int i2 = 0; i2 < i; i2++) {
            EntityFwSensorBox entityFwSensorBox = new EntityFwSensorBox();
            entityFwSensorBox.fwSensorBoxType = parcelExcuteCommandSet_Parcel.readInt();
            entityFwSensorBox.sensorBoxCurrentVersion = parcelExcuteCommandSet_Parcel.readString();
            if (entityFwSensorBox.sensorBoxCurrentVersion.equals("")) {
                entityFwSensorBox.sensorBoxCurrentVersion = null;
            }
            boolean z = true;
            entityFwSensorBox.isSupportUsbUpgrade = parcelExcuteCommandSet_Parcel.readByte() == 1;
            entityFwSensorBox.usbUpgradeSensorBoxBinName = parcelExcuteCommandSet_Parcel.readString();
            entityFwSensorBox.isSupportOtaUpgrade = parcelExcuteCommandSet_Parcel.readByte() == 1;
            entityFwSensorBox.otaUpgradeSensorBoxBinPath = parcelExcuteCommandSet_Parcel.readString();
            entityFwSensorBox.otaSensorBoxBoxBasicBinVersion = parcelExcuteCommandSet_Parcel.readString();
            entityFwSensorBox.otaSensorBoxKey = parcelExcuteCommandSet_Parcel.readString();
            if (parcelExcuteCommandSet_Parcel.readByte() != 1) {
                z = false;
            }
            entityFwSensorBox.needRebootWhenUpgraded = z;
            arrayList.add(entityFwSensorBox);
        }
        parcelExcuteCommandSet_Parcel.recycle();
        return arrayList;
    }
}
