package com.cvte.vman.impl;

import android.os.Parcel;
import com.cvte.vman.IoBoxCtrl;
import com.cvte.vman.VmanMiddleWare;
import com.cvte.vman.entity.EntityFwIoBox;
import com.cvte.vman.entity.EnumDeviceSwitchMode;
import com.cvte.vman.entity.EnumIoBoxType;
import com.cvte.vman.instance.InvokeCmd;
import com.cvte.vman.types.EnumConnectStatus;
import com.cvte.vman.utils.CLog;
import d.b.a.a.a;
import java.util.ArrayList;
import java.util.List;

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

    private IoBoxCtrlManager() {
    }

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

    @Override // com.cvte.vman.IoBoxCtrl
    public EnumConnectStatus getConnectStatus(int i2) {
        return EnumConnectStatus.valueOf(VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_IOBOX_GET_CONNECT_STATUS, i2));
    }

    @Override // com.cvte.vman.IoBoxCtrl
    public List<EntityFwIoBox> getFwIoBoxList() {
        ArrayList arrayList = new ArrayList();
        Parcel parcelD0 = a.d0(InvokeCmd.CMD_IOBOX_GET_DEVICELIST);
        int i2 = parcelD0.readInt();
        CLog.e("getFwCameraList  IoBox_num =" + i2);
        for (int i3 = 0; i3 < i2; i3++) {
            EntityFwIoBox entityFwIoBox = new EntityFwIoBox();
            entityFwIoBox.ioBoxType = EnumIoBoxType.values()[parcelD0.readInt()];
            entityFwIoBox.switchMode = EnumDeviceSwitchMode.values()[parcelD0.readInt()];
            entityFwIoBox.fwIoBoxType = parcelD0.readInt();
            entityFwIoBox.ioBoxCurrentVersion = parcelD0.readString();
            boolean z = true;
            entityFwIoBox.isSupportUsbUpgrade = parcelD0.readByte() == 1;
            entityFwIoBox.usbUpgradeIoBoxBinName = parcelD0.readString();
            entityFwIoBox.isSupportOtaUpgrade = parcelD0.readByte() == 1;
            entityFwIoBox.otaIoBoxBasicBinPath = parcelD0.readString();
            entityFwIoBox.otaIoBoxBasicBinVersion = parcelD0.readString();
            entityFwIoBox.otaIoBoxKey = parcelD0.readString();
            if (parcelD0.readByte() != 1) {
                z = false;
            }
            entityFwIoBox.needRebootWhenUpgraded = z;
            arrayList.add(entityFwIoBox);
        }
        parcelD0.recycle();
        return arrayList;
    }
}
