MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / Dispatch

Method Dispatch

cpp/devices/primary_device.cpp:43–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void PrimaryDevice::Dispatch(scsi_command cmd)
44{
45 stringstream s;
46 s << "$" << setfill('0') << setw(2) << hex << static_cast<int>(cmd);
47
48 if (const auto& it = commands.find(cmd); it != commands.end()) {
49 LogDebug("Device is executing " + command_mapping.find(cmd)->second.second + " (" + s.str() + ")");
50
51 it->second();
52 }
53 else {
54 LogTrace("Received unsupported command: " + s.str());
55
56 throw scsi_exception(sense_key::illegal_request, asc::invalid_command_operation_code);
57 }
58}
59
60void PrimaryDevice::Reset()
61{

Callers

nothing calls this directly

Calls 1

scsi_exceptionClass · 0.85

Tested by

no test coverage detected