protected void execute() throws InterruptedException, SenseException
{
CDB cdb = getCommand().getCommandDescriptorBlock();
assert cdb instanceof Inquiry;
Inquiry inquiryCDB = (Inquiry) cdb;
if (inquiryCDB.isEVPD())
{
VPDPage vpdPage = getInquiryDataRegistry().getVPDPage(inquiryCDB.getPageCode());
if (vpdPage != null)
{
try
{
this.writeData(vpdPage.encode());
}
catch (IOException e)
{
_logger.debug("cound not encode vpd page in task: " + this);
throw new RuntimeException("Could not encode VPD page", e);
}
}
else
{
// Invalid page code
_logger.debug("invalid page code in task: " + this);
throw new InvalidFieldInCDBException(true, 2);
}
}
else
{
if (inquiryCDB.getPageCode() == 0x00)
{
this.writeData(getInquiryDataRegistry().getStandardInquiryData().encode());
}
else
{