mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-21 17:16:44 +00:00
Takes a first shot at INQUIRY.
This commit is contained in:
@@ -24,3 +24,26 @@ bool DirectAccessDevice::read(const Target::CommandState &state, Target::Respond
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DirectAccessDevice::inquiry(const Target::CommandState &state, Target::Responder &responder) {
|
||||
if(!device_) return false;
|
||||
|
||||
std::vector<uint8_t> response = {
|
||||
0x00, /* Peripheral device type: directly addressible. */
|
||||
0x00, /* Non-removeable (0x80 = removeable). */
|
||||
0x00, /* Version: does not claim conformance to any standard. */
|
||||
0x00, /* Response data format: 0 for SCSI-1? */
|
||||
0x00, /* Additional length. */
|
||||
};
|
||||
|
||||
const auto allocated_bytes = state.allocated_inquiry_bytes();
|
||||
if(allocated_bytes < response.size()) {
|
||||
response.resize(allocated_bytes);
|
||||
}
|
||||
|
||||
responder.send_data(std::move(response), [] (const Target::CommandState &state, Target::Responder &responder) {
|
||||
responder.terminate_command(Target::Responder::Status::Good);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user