| 41 | } |
| 42 | |
| 43 | void 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 | |
| 60 | void PrimaryDevice::Reset() |
| 61 | { |
nothing calls this directly
no test coverage detected