package com.github.mjdev.libaums.driver.scsi.commands;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

/* JADX INFO: loaded from: classes.dex */
public class ScsiInquiryResponse {
    private byte peripheralDeviceType;
    private byte peripheralQualifier;
    boolean removableMedia;
    byte responseDataFormat;
    byte spcVersion;

    private ScsiInquiryResponse() {
    }

    public static ScsiInquiryResponse read(ByteBuffer byteBuffer) {
        ScsiInquiryResponse scsiInquiryResponse = new ScsiInquiryResponse();
        byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
        byte b = byteBuffer.get();
        scsiInquiryResponse.peripheralQualifier = (byte) (b & (-32));
        scsiInquiryResponse.peripheralDeviceType = (byte) (b & 31);
        scsiInquiryResponse.removableMedia = byteBuffer.get() == 128;
        scsiInquiryResponse.spcVersion = byteBuffer.get();
        scsiInquiryResponse.responseDataFormat = (byte) (byteBuffer.get() & 7);
        return scsiInquiryResponse;
    }

    public byte getPeripheralQualifier() {
        return this.peripheralQualifier;
    }

    public byte getPeripheralDeviceType() {
        return this.peripheralDeviceType;
    }

    public boolean isRemovableMedia() {
        return this.removableMedia;
    }

    public byte getSpcVersion() {
        return this.spcVersion;
    }

    public byte getResponseDataFormat() {
        return this.responseDataFormat;
    }

    public String toString() {
        return "ScsiInquiryResponse [peripheralQualifier=" + ((int) this.peripheralQualifier) + ", peripheralDeviceType=" + ((int) this.peripheralDeviceType) + ", removableMedia=" + this.removableMedia + ", spcVersion=" + ((int) this.spcVersion) + ", responseDataFormat=" + ((int) this.responseDataFormat) + "]";
    }
}
