From be736496fa8318198f32ae1b689edf851ae2b1a2 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 7 Sep 2017 20:30:23 +0100 Subject: [PATCH] Added manual test subapplication for device commands. --- DiscImageChef.Tests.Devices/ATA.cs | 105 ++++++++++++ DiscImageChef.Tests.Devices/ATA/Ata28.cs | 87 ++++++++++ DiscImageChef.Tests.Devices/ATA/Ata48.cs | 84 +++++++++ DiscImageChef.Tests.Devices/ATA/AtaCHS.cs | 86 ++++++++++ DiscImageChef.Tests.Devices/ATA/Atapi.cs | 161 ++++++++++++++++++ DiscImageChef.Tests.Devices/ATA/Cfa.cs | 79 +++++++++ DiscImageChef.Tests.Devices/ATA/MCPT.cs | 78 +++++++++ DiscImageChef.Tests.Devices/ATA/Smart.cs | 84 +++++++++ DiscImageChef.Tests.Devices/Command.cs | 93 ++++++++++ .../DecodeATARegisters.cs | 137 +++++++++++++++ DiscImageChef.Tests.Devices/Device.cs | 138 +++++++++++++++ .../DiscImageChef.Tests.Devices.csproj | 111 ++++++++++++ DiscImageChef.Tests.Devices/Main.cs | 107 ++++++++++++ DiscImageChef.Tests.Devices/NVMe.cs | 51 ++++++ .../Properties/AssemblyInfo.cs | 63 +++++++ DiscImageChef.Tests.Devices/SCSI.cs | 97 +++++++++++ DiscImageChef.Tests.Devices/SCSI/Adaptec.cs | 81 +++++++++ .../SCSI/ArchiveCorp.cs | 78 +++++++++ DiscImageChef.Tests.Devices/SCSI/Certance.cs | 77 +++++++++ DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs | 77 +++++++++ DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs | 77 +++++++++ DiscImageChef.Tests.Devices/SCSI/HP.cs | 77 +++++++++ DiscImageChef.Tests.Devices/SCSI/Kreon.cs | 80 +++++++++ DiscImageChef.Tests.Devices/SCSI/MMC.cs | 84 +++++++++ DiscImageChef.Tests.Devices/SCSI/NEC.cs | 77 +++++++++ DiscImageChef.Tests.Devices/SCSI/Pioneer.cs | 79 +++++++++ DiscImageChef.Tests.Devices/SCSI/Plasmon.cs | 78 +++++++++ DiscImageChef.Tests.Devices/SCSI/Plextor.cs | 88 ++++++++++ DiscImageChef.Tests.Devices/SCSI/SBC.cs | 84 +++++++++ DiscImageChef.Tests.Devices/SCSI/SMC.cs | 77 +++++++++ DiscImageChef.Tests.Devices/SCSI/SPC.cs | 88 ++++++++++ DiscImageChef.Tests.Devices/SCSI/SSC.cs | 90 ++++++++++ DiscImageChef.Tests.Devices/SCSI/SyQuest.cs | 80 +++++++++ DiscImageChef.Tests.Devices/SecureDigital.cs | 85 +++++++++ .../SecureDigital/MultiMediaCard.cs | 83 +++++++++ .../SecureDigital/SecureDigital.cs | 79 +++++++++ DiscImageChef.sln | 6 + 37 files changed, 3186 insertions(+) create mode 100644 DiscImageChef.Tests.Devices/ATA.cs create mode 100644 DiscImageChef.Tests.Devices/ATA/Ata28.cs create mode 100644 DiscImageChef.Tests.Devices/ATA/Ata48.cs create mode 100644 DiscImageChef.Tests.Devices/ATA/AtaCHS.cs create mode 100644 DiscImageChef.Tests.Devices/ATA/Atapi.cs create mode 100644 DiscImageChef.Tests.Devices/ATA/Cfa.cs create mode 100644 DiscImageChef.Tests.Devices/ATA/MCPT.cs create mode 100644 DiscImageChef.Tests.Devices/ATA/Smart.cs create mode 100644 DiscImageChef.Tests.Devices/Command.cs create mode 100644 DiscImageChef.Tests.Devices/DecodeATARegisters.cs create mode 100644 DiscImageChef.Tests.Devices/Device.cs create mode 100644 DiscImageChef.Tests.Devices/DiscImageChef.Tests.Devices.csproj create mode 100644 DiscImageChef.Tests.Devices/Main.cs create mode 100644 DiscImageChef.Tests.Devices/NVMe.cs create mode 100644 DiscImageChef.Tests.Devices/Properties/AssemblyInfo.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/Adaptec.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/ArchiveCorp.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/Certance.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/HP.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/Kreon.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/MMC.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/NEC.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/Pioneer.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/Plasmon.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/Plextor.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/SBC.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/SMC.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/SPC.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/SSC.cs create mode 100644 DiscImageChef.Tests.Devices/SCSI/SyQuest.cs create mode 100644 DiscImageChef.Tests.Devices/SecureDigital.cs create mode 100644 DiscImageChef.Tests.Devices/SecureDigital/MultiMediaCard.cs create mode 100644 DiscImageChef.Tests.Devices/SecureDigital/SecureDigital.cs diff --git a/DiscImageChef.Tests.Devices/ATA.cs b/DiscImageChef.Tests.Devices/ATA.cs new file mode 100644 index 00000000..70172263 --- /dev/null +++ b/DiscImageChef.Tests.Devices/ATA.cs @@ -0,0 +1,105 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : ATA.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; +using DiscImageChef.Tests.Devices.ATA; + +namespace DiscImageChef.Tests.Devices +{ + partial class MainClass + { + public static void ATA(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send an ATA command to the device:"); + DicConsole.WriteLine("1.- Send a CHS ATA command to the device."); + DicConsole.WriteLine("2.- Send a 28-bit ATA command to the device."); + DicConsole.WriteLine("3.- Send a 48-bit ATA command to the device."); + DicConsole.WriteLine("4.- Send an ATAPI command to the device."); + DicConsole.WriteLine("5.- Send a CompactFlash command to the device."); + DicConsole.WriteLine("6.- Send a Media Card Pass Through command to the device."); + DicConsole.WriteLine("7.- Send a S.M.A.R.T. command to the device."); + DicConsole.WriteLine("0.- Return to command class menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to command class menu..."); + return; + case 1: + AtaCHS.Menu(devPath, dev); + continue; + case 2: + Ata28.Menu(devPath, dev); + continue; + case 3: + Ata48.Menu(devPath, dev); + continue; + case 4: + Atapi.Menu(devPath, dev); + continue; + case 5: + Cfa.Menu(devPath, dev); + continue; + case 6: + MCPT.Menu(devPath, dev); + continue; + case 7: + Smart.Menu(devPath, dev); + continue; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/ATA/Ata28.cs b/DiscImageChef.Tests.Devices/ATA/Ata28.cs new file mode 100644 index 00000000..f3227326 --- /dev/null +++ b/DiscImageChef.Tests.Devices/ATA/Ata28.cs @@ -0,0 +1,87 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Ata28.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.ATA +{ + public static class Ata28 + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a 28-bit ATA command to the device:"); + DicConsole.WriteLine("1.- Send READ BUFFER command."); + DicConsole.WriteLine("2.- Send READ BUFFER DMA command."); + DicConsole.WriteLine("3.- Send READ DMA command."); + DicConsole.WriteLine("4.- Send READ DMA WITH RETRIES command."); + DicConsole.WriteLine("5.- Send READ LONG command."); + DicConsole.WriteLine("6.- Send READ LONG WITH RETRIES command."); + DicConsole.WriteLine("7.- Send READ MULTIPLE command."); + DicConsole.WriteLine("8.- Send READ NATIVE MAX ADDRESS command."); + DicConsole.WriteLine("9.- Send READ SECTORS WITH RETRIES command."); + DicConsole.WriteLine("10.- Send SEEK command."); + DicConsole.WriteLine("0.- Return to ATA commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to ATA commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} + diff --git a/DiscImageChef.Tests.Devices/ATA/Ata48.cs b/DiscImageChef.Tests.Devices/ATA/Ata48.cs new file mode 100644 index 00000000..a4a2bb03 --- /dev/null +++ b/DiscImageChef.Tests.Devices/ATA/Ata48.cs @@ -0,0 +1,84 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Ata48.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.ATA +{ + public static class Ata48 + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a 48-bit ATA command to the device:"); + DicConsole.WriteLine("1.- Send GET NATIVE MAX ADDRESS EXT command."); + DicConsole.WriteLine("2.- Send READ DMA EXT command."); + DicConsole.WriteLine("3.- Send READ LOG DMA EXT command."); + DicConsole.WriteLine("4.- Send READ LOG EXT command."); + DicConsole.WriteLine("5.- Send READ MATIVE MAX ADDRESS EXT command."); + DicConsole.WriteLine("6.- Send READ MULTIPLE EXT command."); + DicConsole.WriteLine("7.- Send READ SECTORS EXT command."); + DicConsole.WriteLine("0.- Return to ATA commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to ATA commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} + diff --git a/DiscImageChef.Tests.Devices/ATA/AtaCHS.cs b/DiscImageChef.Tests.Devices/ATA/AtaCHS.cs new file mode 100644 index 00000000..1f36e309 --- /dev/null +++ b/DiscImageChef.Tests.Devices/ATA/AtaCHS.cs @@ -0,0 +1,86 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AtaCHS.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.ATA +{ + public static class AtaCHS + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a CHS ATA command to the device:"); + DicConsole.WriteLine("1.- Send IDENTIFY DEVICE command."); + DicConsole.WriteLine("2.- Send READ DMA command."); + DicConsole.WriteLine("3.- Send READ DMA WITH RETRIES command."); + DicConsole.WriteLine("4.- Send READ LONG command."); + DicConsole.WriteLine("5.- Send READ LONG WITH RETRIES command."); + DicConsole.WriteLine("6.- Send READ MULTIPLE command."); + DicConsole.WriteLine("7.- Send READ SECTORS command."); + DicConsole.WriteLine("8.- Send READ SECTORS WITH RETRIES command."); + DicConsole.WriteLine("9.- Send SEEK command."); + DicConsole.WriteLine("0.- Return to ATA commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to ATA commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} + diff --git a/DiscImageChef.Tests.Devices/ATA/Atapi.cs b/DiscImageChef.Tests.Devices/ATA/Atapi.cs new file mode 100644 index 00000000..b5800b85 --- /dev/null +++ b/DiscImageChef.Tests.Devices/ATA/Atapi.cs @@ -0,0 +1,161 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Atapi.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; +using DiscImageChef.Decoders.ATA; +using System.Threading; + +namespace DiscImageChef.Tests.Devices.ATA +{ + public static class Atapi + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send an ATAPI command to the device:"); + DicConsole.WriteLine("1.- Send IDENTIFY PACKET DEVICE command."); + DicConsole.WriteLine("0.- Return to ATA commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to ATA commands menu..."); + return; + case 1: + Identify(devPath, dev); + continue; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + + public static void Identify(string devPath, Device dev) + { + start: + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Sending IDENTIFY PACKET DEVICE to the device:"); + bool sense = dev.AtapiIdentify(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, out double duration); + + menu: + DicConsole.WriteLine("Command took {0} ms.", duration); + DicConsole.WriteLine("Sense is {0}.", sense); + DicConsole.WriteLine("Buffer is {0} bytes.", buffer == null ? "null" : buffer.Length.ToString()); + DicConsole.WriteLine(); + DicConsole.WriteLine("Choose what to do:"); + DicConsole.WriteLine("1.- Print buffer."); + DicConsole.WriteLine("2.- Decode buffer."); + DicConsole.WriteLine("3.- Decode error registers."); + DicConsole.WriteLine("4.- Send command again."); + DicConsole.WriteLine("0.- Return to ATAPI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + System.Console.Clear(); + goto menu; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to ATAPI commands menu..."); + return; + case 1: + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("IDENTIFY PACKET DEVICE response:"); + if(buffer != null) + PrintHex.PrintHexArray(buffer, 64); + DicConsole.WriteLine("Press any key to continue..."); + System.Console.ReadKey(); + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + goto menu; + case 2: + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("IDENTIFY PACKET DEVICE decoded response:"); + if(buffer != null) + DicConsole.WriteLine("{0}", Decoders.ATA.Identify.Prettify(buffer)); + DicConsole.WriteLine("Press any key to continue..."); + System.Console.ReadKey(); + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + goto menu; + case 3: + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("IDENTIFY PACKET DEVICE status registers:"); + DicConsole.Write("{0}", MainClass.DecodeATARegisters(errorRegisters)); + DicConsole.WriteLine("Press any key to continue..."); + System.Console.ReadKey(); + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + goto menu; + case 4: + goto start; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + System.Console.Clear(); + goto menu; + } + + } + } +} + diff --git a/DiscImageChef.Tests.Devices/ATA/Cfa.cs b/DiscImageChef.Tests.Devices/ATA/Cfa.cs new file mode 100644 index 00000000..12544491 --- /dev/null +++ b/DiscImageChef.Tests.Devices/ATA/Cfa.cs @@ -0,0 +1,79 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Cfa.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.ATA +{ + public static class Cfa + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a CompactFlash command to the device:"); + DicConsole.WriteLine("1.- Send REQUEST EXTENDED ERROR CODE command."); + DicConsole.WriteLine("2.- Send TRANSLATE SECTOR command."); + DicConsole.WriteLine("0.- Return to ATA commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to ATA commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} + diff --git a/DiscImageChef.Tests.Devices/ATA/MCPT.cs b/DiscImageChef.Tests.Devices/ATA/MCPT.cs new file mode 100644 index 00000000..863e655c --- /dev/null +++ b/DiscImageChef.Tests.Devices/ATA/MCPT.cs @@ -0,0 +1,78 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : MCPT.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.ATA +{ + public static class MCPT + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a Media Card Pass Through command to the device:"); + DicConsole.WriteLine("1.- Send CHECK MEDIA CARD TYPE command."); + DicConsole.WriteLine("0.- Return to ATA commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to ATA commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} + diff --git a/DiscImageChef.Tests.Devices/ATA/Smart.cs b/DiscImageChef.Tests.Devices/ATA/Smart.cs new file mode 100644 index 00000000..d029f296 --- /dev/null +++ b/DiscImageChef.Tests.Devices/ATA/Smart.cs @@ -0,0 +1,84 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Smart.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.ATA +{ + public static class Smart + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a S.M.A.R.T. command to the device:"); + DicConsole.WriteLine("1.- Send DISABLE OPERATIONS command."); + DicConsole.WriteLine("2.- Send ENABLE ATTRIBUTE AUTOSAVE command."); + DicConsole.WriteLine("3.- Send ENABLE OPERATIONS command."); + DicConsole.WriteLine("4.- Send EXECUTE OFF-LINE IMMEDIATE command."); + DicConsole.WriteLine("5.- Send READ DATA command."); + DicConsole.WriteLine("6.- Send READ LOG command."); + DicConsole.WriteLine("7.- Send RETURN STATUS command."); + DicConsole.WriteLine("0.- Return to ATA commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to ATA commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} + diff --git a/DiscImageChef.Tests.Devices/Command.cs b/DiscImageChef.Tests.Devices/Command.cs new file mode 100644 index 00000000..0b6a672a --- /dev/null +++ b/DiscImageChef.Tests.Devices/Command.cs @@ -0,0 +1,93 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Command.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices +{ + partial class MainClass + { + public static void Command(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a command to the device:"); + DicConsole.WriteLine("1.- Send a SCSI command."); + DicConsole.WriteLine("2.- Send an ATA command."); + DicConsole.WriteLine("3.- Send a SecureDigital/MultiMediaCard command."); + DicConsole.WriteLine("4.- Send a NVMe command."); + DicConsole.WriteLine("0.- Return to device menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to device menu..."); + return; + case 1: + SCSI(devPath, dev); + continue; + case 2: + ATA(devPath, dev); + continue; + case 3: + SecureDigital(devPath, dev); + continue; + case 4: + NVMe(devPath, dev); + continue; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/DecodeATARegisters.cs b/DiscImageChef.Tests.Devices/DecodeATARegisters.cs new file mode 100644 index 00000000..30580ed0 --- /dev/null +++ b/DiscImageChef.Tests.Devices/DecodeATARegisters.cs @@ -0,0 +1,137 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : DecodeATARegisters.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; +using DiscImageChef.Decoders.ATA; +using System.Text; +namespace DiscImageChef.Tests.Devices +{ + partial class MainClass + { + public static string DecodeATAStatus(byte status) + { + string ret = ""; + + if((status & 0x80) == 0x80) + ret += "BSY "; + if((status & 0x40) == 0x40) + ret += "DRDY "; + if((status & 0x20) == 0x20) + ret += "DWF "; + if((status & 0x10) == 0x10) + ret += "DSC "; + if((status & 0x8) == 0x8) + ret += "DRQ "; + if((status & 0x4) == 0x4) + ret += "CORR "; + if((status & 0x2) == 0x2) + ret += "IDX "; + if((status & 0x1) == 0x1) + ret += "ERR "; + + return ret; + } + + public static string DecodeATAError(byte status) + { + string ret = ""; + + if((status & 0x80) == 0x80) + ret += "BBK "; + if((status & 0x40) == 0x40) + ret += "UNC "; + if((status & 0x20) == 0x20) + ret += "MC "; + if((status & 0x10) == 0x10) + ret += "IDNF "; + if((status & 0x8) == 0x8) + ret += "MCR "; + if((status & 0x4) == 0x4) + ret += "ABRT "; + if((status & 0x2) == 0x2) + ret += "TK0NF "; + if((status & 0x1) == 0x1) + ret += "AMNF "; + + return ret; + } + + public static string DecodeATARegisters(AtaErrorRegistersCHS registers) + { + StringBuilder sb = new StringBuilder(); + sb.AppendFormat("Status: {0}", DecodeATAStatus(registers.status)).AppendLine(); + sb.AppendFormat("Error: {0}", DecodeATAStatus(registers.error)).AppendLine(); + sb.AppendFormat("Device: {0}", (registers.deviceHead >> 4) & 0x01).AppendLine(); + sb.AppendFormat("Cylinder: {0}", (registers.cylinderHigh) << 8 + registers.cylinderLow).AppendLine(); + sb.AppendFormat("Head: {0}", registers.deviceHead & 0xF).AppendLine(); + sb.AppendFormat("Sector: {0}", registers.sector).AppendLine(); + sb.AppendFormat("Count: {0}", registers.sectorCount).AppendLine(); + sb.AppendFormat("LBA?: {0}", Convert.ToBoolean(registers.deviceHead & 0x40)).AppendLine(); + sb.AppendFormat("Bit 7 set?: {0}", Convert.ToBoolean(registers.deviceHead & 0x80)).AppendLine(); + sb.AppendFormat("Bit 5 set?: {0}", Convert.ToBoolean(registers.deviceHead & 0x20)).AppendLine(); + return sb.ToString(); + } + + public static string DecodeATARegisters(AtaErrorRegistersLBA28 registers) + { + StringBuilder sb = new StringBuilder(); + sb.AppendFormat("Status: {0}", DecodeATAStatus(registers.status)).AppendLine(); + sb.AppendFormat("Error: {0}", DecodeATAStatus(registers.error)).AppendLine(); + sb.AppendFormat("Device: {0}", (registers.deviceHead >> 4) & 0x01).AppendLine(); + sb.AppendFormat("LBA: {0}", ((registers.deviceHead & 0xF) << 24) + (registers.lbaHigh << 16) + (registers.lbaMid << 8) + registers.lbaLow); + sb.AppendFormat("Count: {0}", registers.sectorCount).AppendLine(); + sb.AppendFormat("LBA?: {0}", Convert.ToBoolean(registers.deviceHead & 0x40)).AppendLine(); + sb.AppendFormat("Bit 7 set?: {0}", Convert.ToBoolean(registers.deviceHead & 0x80)).AppendLine(); + sb.AppendFormat("Bit 5 set?: {0}", Convert.ToBoolean(registers.deviceHead & 0x20)).AppendLine(); + return sb.ToString(); + } + + public static string DecodeATARegisters(AtaErrorRegistersLBA48 registers) + { + StringBuilder sb = new StringBuilder(); + sb.AppendFormat("Status: {0}", DecodeATAStatus(registers.status)).AppendLine(); + sb.AppendFormat("Error: {0}", DecodeATAStatus(registers.error)).AppendLine(); + sb.AppendFormat("Device: {0}", (registers.deviceHead >> 4) & 0x01).AppendLine(); + sb.AppendFormat("LBA: {0}", ((ulong)(registers.deviceHead & 0xF) * (ulong)0x100000000000) + (registers.lbaHigh * (ulong)0x100000000L) + (ulong)(registers.lbaMid << 16) + registers.lbaLow); + sb.AppendFormat("Count: {0}", registers.sectorCount).AppendLine(); + sb.AppendFormat("LBA?: {0}", Convert.ToBoolean(registers.deviceHead & 0x40)).AppendLine(); + sb.AppendFormat("Bit 7 set?: {0}", Convert.ToBoolean(registers.deviceHead & 0x80)).AppendLine(); + sb.AppendFormat("Bit 5 set?: {0}", Convert.ToBoolean(registers.deviceHead & 0x20)).AppendLine(); + return sb.ToString(); + } + } +} diff --git a/DiscImageChef.Tests.Devices/Device.cs b/DiscImageChef.Tests.Devices/Device.cs new file mode 100644 index 00000000..21208a0c --- /dev/null +++ b/DiscImageChef.Tests.Devices/Device.cs @@ -0,0 +1,138 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Device.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; +using DiscImageChef.Console; + +namespace DiscImageChef.Tests.Devices +{ + partial class MainClass + { + public static void Device(string devPath) + { + DicConsole.WriteLine("Going to open {0}. Press any key to continue...", devPath); + System.Console.ReadKey(); + + DiscImageChef.Devices.Device dev = new DiscImageChef.Devices.Device(devPath); + + while(true) + { + DicConsole.WriteLine("dev.PlatformID = {0}", dev.PlatformID); + DicConsole.WriteLine("dev.FileHandle = {0}", dev.FileHandle); + DicConsole.WriteLine("dev.Timeout = {0}", dev.Timeout); + DicConsole.WriteLine("dev.Error = {0}", dev.Error); + DicConsole.WriteLine("dev.LastError = {0}", dev.LastError); + DicConsole.WriteLine("dev.Type = {0}", dev.Type); + DicConsole.WriteLine("dev.Manufacturer = \"{0}\"", dev.Manufacturer); + DicConsole.WriteLine("dev.Model = \"{0}\"", dev.Model); + DicConsole.WriteLine("dev.Revision = \"{0}\"", dev.Revision); + DicConsole.WriteLine("dev.Serial = \"{0}\"", dev.Serial); + DicConsole.WriteLine("dev.SCSIType = {0}", dev.SCSIType); + DicConsole.WriteLine("dev.IsRemovable = {0}", dev.IsRemovable); + DicConsole.WriteLine("dev.IsUSB = {0}", dev.IsUSB); + DicConsole.WriteLine("dev.USBVendorID = 0x{0:X4}", dev.USBVendorID); + DicConsole.WriteLine("dev.USBProductID = 0x{0:X4}", dev.USBProductID); + DicConsole.WriteLine("dev.USBDescriptors.Length = {0}", dev.USBDescriptors == null ? "null" : dev.USBDescriptors.Length.ToString()); + DicConsole.WriteLine("dev.USBManufacturerString = \"{0}\"", dev.USBManufacturerString); + DicConsole.WriteLine("dev.USBProductString = \"{0}\"", dev.USBProductString); + DicConsole.WriteLine("dev.USBSerialString = \"{0}\"", dev.USBSerialString); + DicConsole.WriteLine("dev.IsFireWire = {0}", dev.IsFireWire); + DicConsole.WriteLine("dev.FireWireGUID = {0:X16}", dev.FireWireGUID); + DicConsole.WriteLine("dev.FireWireModel = 0x{0:X8}", dev.FireWireModel); + DicConsole.WriteLine("dev.FireWireModelName = \"{0}\"", dev.FireWireModelName); + DicConsole.WriteLine("dev.FireWireVendor = 0x{0:X8}", dev.FireWireVendor); + DicConsole.WriteLine("dev.FireWireVendorName = \"{0}\"", dev.FireWireVendorName); + DicConsole.WriteLine("dev.IsCompactFlash = {0}", dev.IsCompactFlash); + DicConsole.WriteLine("dev.IsPCMCIA = {0}", dev.IsPCMCIA); + DicConsole.WriteLine("dev.CIS.Length = {0}", dev.CIS == null ? "null" : dev.CIS.Length.ToString()); + + DicConsole.WriteLine("Press any key to continue...", devPath); + System.Console.ReadKey(); + + menu: + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Options:"); + DicConsole.WriteLine("1.- Print USB descriptors."); + DicConsole.WriteLine("2.- Print PCMCIA CIS."); + DicConsole.WriteLine("3.- Send a command to the device."); + DicConsole.WriteLine("0.- Return to device selection."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + goto menu; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to device selection..."); + return; + case 1: + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("USB descriptors:"); + if(dev.USBDescriptors != null) + PrintHex.PrintHexArray(dev.USBDescriptors, 64); + DicConsole.WriteLine("Press any key to continue..."); + System.Console.ReadKey(); + goto menu; + case 2: + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("PCMCIA CIS:"); + if(dev.CIS != null) + PrintHex.PrintHexArray(dev.CIS, 64); + DicConsole.WriteLine("Press any key to continue..."); + System.Console.ReadKey(); + goto menu; + case 3: + Command(devPath, dev); + goto menu; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + goto menu; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/DiscImageChef.Tests.Devices.csproj b/DiscImageChef.Tests.Devices/DiscImageChef.Tests.Devices.csproj new file mode 100644 index 00000000..5468ca3c --- /dev/null +++ b/DiscImageChef.Tests.Devices/DiscImageChef.Tests.Devices.csproj @@ -0,0 +1,111 @@ + + + + Debug + x86 + {A40662EB-D202-46A4-AB41-9C32ADE6D6B5} + Exe + DiscImageChef.Tests.Devices + DiscImageChef.Tests.Devices + v4.6.1 + 3.5.99.0 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + true + x86 + + + true + bin\Release + prompt + 4 + true + x86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {CCAA7AFE-C094-4D82-A66D-630DE8A3F545} + DiscImageChef.Console + + + {57BB2341-AB62-48FD-91B8-46F5A2F9ED51} + DiscImageChef.Devices + + + {9183F2E0-A879-4F23-9EE3-C6908F1332B2} + DiscImageChef.Interop + + + {0BEB3088-B634-4289-AE17-CDF2D25D00D5} + DiscImageChef.Decoders + + + {F8BDF57B-1571-4CD0-84B3-B422088D359A} + DiscImageChef.Helpers + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DiscImageChef.Tests.Devices/Main.cs b/DiscImageChef.Tests.Devices/Main.cs new file mode 100644 index 00000000..93ec11c1 --- /dev/null +++ b/DiscImageChef.Tests.Devices/Main.cs @@ -0,0 +1,107 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Program.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Linq; +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices +{ + partial class MainClass + { + public static void Main(string[] args) + { + DicConsole.WriteLineEvent += System.Console.WriteLine; + DicConsole.WriteEvent += System.Console.Write; + DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine; + DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; + DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; + + DeviceInfo[] devices = DiscImageChef.Devices.Device.ListDevices(); + + if(devices == null || devices.Length == 0) + { + DicConsole.WriteLine("No known devices attached."); + return; + } + + devices = devices.OrderBy(d => d.path).ToArray(); + + int item; + string strDev; + + while(true) + { + System.Console.Clear(); + + DicConsole.WriteLine("DiscImageChef device handling tests"); + + DicConsole.WriteLine("{6,-8}|{0,-22}|{1,-16}|{2,-24}|{3,-24}|{4,-10}|{5,-10}", + "Path", "Vendor", "Model", "Serial", "Bus", "Supported?", "Number"); + DicConsole.WriteLine("{6,-8}|{0,-22}+{1,-16}+{2,-24}+{3,-24}+{4,-10}+{5,-10}", + "----------------------", "----------------", "------------------------", + "------------------------", "----------", "----------", "--------"); + for(int i = 0; i < devices.Length; i++) + DicConsole.WriteLine("{6,-8}|{0,-22}|{1,-16}|{2,-24}|{3,-24}|{4,-10}|{5,-10}", devices[i].path, devices[i].vendor, devices[i].model, devices[i].serial, devices[i].bus, devices[i].supported, i + 1); + + DicConsole.Write("Please choose which drive to test (0 to exit): "); + strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + if(item == 0) + { + DicConsole.WriteLine("Exiting..."); + return; + } + + if(item > devices.Length) + { + DicConsole.WriteLine("No such device. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + Device(devices[item - 1].path); + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/NVMe.cs b/DiscImageChef.Tests.Devices/NVMe.cs new file mode 100644 index 00000000..c3ee789b --- /dev/null +++ b/DiscImageChef.Tests.Devices/NVMe.cs @@ -0,0 +1,51 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : NVMe.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices +{ + partial class MainClass + { + public static void NVMe(string devPath, Device dev) + { + DicConsole.WriteLine("NVMe commands not yet implemented. Press any key to continue..."); + System.Console.ReadKey(); + } + } +} diff --git a/DiscImageChef.Tests.Devices/Properties/AssemblyInfo.cs b/DiscImageChef.Tests.Devices/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..8e336b2b --- /dev/null +++ b/DiscImageChef.Tests.Devices/Properties/AssemblyInfo.cs @@ -0,0 +1,63 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AssemblyInfo.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DiscImageChef.Tests.Devices")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Claunia.com")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Copyright © Claunia.com")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] diff --git a/DiscImageChef.Tests.Devices/SCSI.cs b/DiscImageChef.Tests.Devices/SCSI.cs new file mode 100644 index 00000000..11426d1c --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI.cs @@ -0,0 +1,97 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SCSI.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; +using DiscImageChef.Tests.Devices.SCSI; + +namespace DiscImageChef.Tests.Devices +{ + partial class MainClass + { + public static void SCSI(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a SCSI command to the device:"); + DicConsole.WriteLine("1.- Send an Adaptec vendor command to the device."); + DicConsole.WriteLine("2.- Send an Archive vendor command to the device."); + DicConsole.WriteLine("3.- Send a Certance vendor command to the device."); + DicConsole.WriteLine("4.- Send a Fujitsu vendor command to the device."); + DicConsole.WriteLine("5.- Send an HL-DT-ST vendor command to the device."); + DicConsole.WriteLine("6.- Send a Hewlett-Packard vendor command to the device."); + DicConsole.WriteLine("7.- Send a Kreon vendor command to the device."); + DicConsole.WriteLine("8.- Send a SCSI MultiMedia Command to the device."); + DicConsole.WriteLine("9.- Send a NEC vendor command to the device."); + DicConsole.WriteLine("10.- Send a Pioneer vendor command to the device."); + DicConsole.WriteLine("11.- Send a Plasmon vendor command to the device."); + DicConsole.WriteLine("12.- Send a Plextor vendor command to the device."); + DicConsole.WriteLine("13.- Send a SCSI Block Command to the device."); + DicConsole.WriteLine("14.- Send a SCSI Media Changer command to the device."); + DicConsole.WriteLine("15.- Send a SCSI Primary Command to the device."); + DicConsole.WriteLine("16.- Send a SCSI Streaming Command to the device."); + DicConsole.WriteLine("17.- Send a SyQuest vendor command to the device."); + DicConsole.WriteLine("0.- Return to command class menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to command class menu..."); + return; + case 1: + Adaptec.Menu(devPath, dev); + continue; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/Adaptec.cs b/DiscImageChef.Tests.Devices/SCSI/Adaptec.cs new file mode 100644 index 00000000..1027724d --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/Adaptec.cs @@ -0,0 +1,81 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Adaptec.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class Adaptec + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send an Adaptec vendor command to the device:"); + DicConsole.WriteLine("1.- Send READ/RESET USAGE COUNTER command."); + DicConsole.WriteLine("2.- Send READ DATA BUFFER command."); + DicConsole.WriteLine("3.- Send SET ERROR THRESHOLD command."); + DicConsole.WriteLine("4.- Send TRANSLATE command."); + DicConsole.WriteLine("5.- Send WRITE DATA BUFFER command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/ArchiveCorp.cs b/DiscImageChef.Tests.Devices/SCSI/ArchiveCorp.cs new file mode 100644 index 00000000..1c8cb513 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/ArchiveCorp.cs @@ -0,0 +1,78 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : ArchiveCorp.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class ArchiveCorp + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send an Archive vendor command to the device:"); + DicConsole.WriteLine("1.- Send REQUEST BLOCK ADDRESS command."); + DicConsole.WriteLine("2.- Send SEEK BLOCK command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/Certance.cs b/DiscImageChef.Tests.Devices/SCSI/Certance.cs new file mode 100644 index 00000000..5ac72032 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/Certance.cs @@ -0,0 +1,77 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Certance.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class Certance + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a Certance vendor command to the device:"); + DicConsole.WriteLine("1.- Send PARK UNPARK command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs b/DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs new file mode 100644 index 00000000..edf00384 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs @@ -0,0 +1,77 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Fujitsu.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class Fujitsu + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a Fujitsu vendor command to the device:"); + DicConsole.WriteLine("1.- Send DISPLAY command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs b/DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs new file mode 100644 index 00000000..2fac06f6 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs @@ -0,0 +1,77 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HL-DT-ST.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class HL_DT_ST + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send an HL-DT-ST vendor command to the device:"); + DicConsole.WriteLine("1.- Send READ DVD (RAW) command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/HP.cs b/DiscImageChef.Tests.Devices/SCSI/HP.cs new file mode 100644 index 00000000..38d327ab --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/HP.cs @@ -0,0 +1,77 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HP.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class HP + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a Hewlett-Packard vendor command to the device:"); + DicConsole.WriteLine("1.- Send READ LONG command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/Kreon.cs b/DiscImageChef.Tests.Devices/SCSI/Kreon.cs new file mode 100644 index 00000000..0a6a42a6 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/Kreon.cs @@ -0,0 +1,80 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Kreon.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class Kreon + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a Kreon vendor command to the device:"); + DicConsole.WriteLine("1.- Send EXTRACT SS command."); + DicConsole.WriteLine("2.- Send GET FEATURE LIST command."); + DicConsole.WriteLine("3.- Send SET LOCK STATE command."); + DicConsole.WriteLine("4.- Send UNLOCK command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/MMC.cs b/DiscImageChef.Tests.Devices/SCSI/MMC.cs new file mode 100644 index 00000000..c5f8626a --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/MMC.cs @@ -0,0 +1,84 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : MMC.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class MMC + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a MultiMedia Command to the device:"); + DicConsole.WriteLine("1.- Send GET CONFIGURATION command."); + DicConsole.WriteLine("2.- Send PREVENT ALLOW MEDIUM REMOVAL command."); + DicConsole.WriteLine("3.- Send READ CD command."); + DicConsole.WriteLine("4.- Send READ CD MSF command."); + DicConsole.WriteLine("5.- Send READ DISC INFORMATION command."); + DicConsole.WriteLine("6.- Send READ DISC STRUCTURE command."); + DicConsole.WriteLine("7.- Send READ TOC/PMA/ATIP command."); + DicConsole.WriteLine("8.- Send START STOP UNIT command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/NEC.cs b/DiscImageChef.Tests.Devices/SCSI/NEC.cs new file mode 100644 index 00000000..4d088ce3 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/NEC.cs @@ -0,0 +1,77 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : NEC.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class NEC + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a NEC vendor command to the device:"); + DicConsole.WriteLine("1.- Send READ CD-DA command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/Pioneer.cs b/DiscImageChef.Tests.Devices/SCSI/Pioneer.cs new file mode 100644 index 00000000..ae296d17 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/Pioneer.cs @@ -0,0 +1,79 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Pioneer.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class Pioneer + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a Pioneer vendor command to the device:"); + DicConsole.WriteLine("1.- Send READ CD-DA command."); + DicConsole.WriteLine("2.- Send READ CD-DA MSF command."); + DicConsole.WriteLine("3.- Send READ CD-XA command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/Plasmon.cs b/DiscImageChef.Tests.Devices/SCSI/Plasmon.cs new file mode 100644 index 00000000..3fe37576 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/Plasmon.cs @@ -0,0 +1,78 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Plasmon.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class Plasmon + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a Plasmon vendor command to the device:"); + DicConsole.WriteLine("1.- Send READ LONG command."); + DicConsole.WriteLine("2.- Send READ SECTOR LOCATION command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/Plextor.cs b/DiscImageChef.Tests.Devices/SCSI/Plextor.cs new file mode 100644 index 00000000..5bdec07a --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/Plextor.cs @@ -0,0 +1,88 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Plextor.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class Plextor + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a Plextor vendor command to the device:"); + DicConsole.WriteLine("1.- Send GET BOOK BITSETTING command."); + DicConsole.WriteLine("2.- Send GET GIGAREC command."); + DicConsole.WriteLine("3.- Send GET SECUREC command."); + DicConsole.WriteLine("4.- Send GET SILENT MODE command."); + DicConsole.WriteLine("5.- Send GET SINGLE-SESSION / HIDE CD-R command."); + DicConsole.WriteLine("6.- Send GET SPEEDREAD command."); + DicConsole.WriteLine("7.- Send GET TEST WRITE DVD+ command."); + DicConsole.WriteLine("8.- Send GET VARIREC command."); + DicConsole.WriteLine("9.- Send POWEREC GET SPEEDS command."); + DicConsole.WriteLine("10.- Send READ CD-DA command."); + DicConsole.WriteLine("11.- Send READ DVD (RAW) command."); + DicConsole.WriteLine("12.- Send READ EEPROM command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/SBC.cs b/DiscImageChef.Tests.Devices/SCSI/SBC.cs new file mode 100644 index 00000000..f6f9bef6 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/SBC.cs @@ -0,0 +1,84 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SBC.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class SBC + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a SCSI Block Command to the device:"); + DicConsole.WriteLine("1.- Send READ (6) command."); + DicConsole.WriteLine("2.- Send READ (10) command."); + DicConsole.WriteLine("3.- Send READ (12) command."); + DicConsole.WriteLine("4.- Send READ (16) command."); + DicConsole.WriteLine("5.- Send READ LONG (10) command."); + DicConsole.WriteLine("6.- Send READ LONG (16) command."); + DicConsole.WriteLine("7.- Send SEEK (6) command."); + DicConsole.WriteLine("8.- Send SEEK (10) command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/SMC.cs b/DiscImageChef.Tests.Devices/SCSI/SMC.cs new file mode 100644 index 00000000..7745e539 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/SMC.cs @@ -0,0 +1,77 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SMC.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class SMC + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a SCSI Media Changer command to the device:"); + DicConsole.WriteLine("1.- Send READ ATTRIBUTE command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/SPC.cs b/DiscImageChef.Tests.Devices/SCSI/SPC.cs new file mode 100644 index 00000000..432967e4 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/SPC.cs @@ -0,0 +1,88 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SPC.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class SPC + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a SCSI Primary Command to the device:"); + DicConsole.WriteLine("1.- Send INQUIRY command."); + DicConsole.WriteLine("2.- Send MODE SELECT (6) command."); + DicConsole.WriteLine("3.- Send MODE SELECT (10) command."); + DicConsole.WriteLine("4.- Send MODE SENSE (6) command."); + DicConsole.WriteLine("5.- Send MODE SENSE (10) command."); + DicConsole.WriteLine("6.- Send PREVENT ALLOW MEDIUM REMOVAL command."); + DicConsole.WriteLine("7.- Send READ ATTRIBUTE command."); + DicConsole.WriteLine("8.- Send READ CAPACITY (10) command."); + DicConsole.WriteLine("9.- Send READ CAPACITY (16) command."); + DicConsole.WriteLine("10.- Send READ MEDIA SERIAL NUMBER command."); + DicConsole.WriteLine("11.- Send REQUEST SENSE command."); + DicConsole.WriteLine("12.- Send TEST UNIT READY command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/SSC.cs b/DiscImageChef.Tests.Devices/SCSI/SSC.cs new file mode 100644 index 00000000..14a29841 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/SSC.cs @@ -0,0 +1,90 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SSC.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class SSC + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a SCSI Streaming Command to the device:"); + DicConsole.WriteLine("1.- Send LOAD UNLOAD command."); + DicConsole.WriteLine("2.- Send LOCATE (10) command."); + DicConsole.WriteLine("3.- Send LOCATE (16) command."); + DicConsole.WriteLine("4.- Send READ (6) command."); + DicConsole.WriteLine("5.- Send READ (16) command."); + DicConsole.WriteLine("6.- Send READ BLOCK LIMITS command."); + DicConsole.WriteLine("7.- Send READ POSITION command."); + DicConsole.WriteLine("8.- Send READ REVERSE (6) command."); + DicConsole.WriteLine("9.- Send READ REVERSE (16) command."); + DicConsole.WriteLine("10.- Send RECOVER BUFFERED DATA command."); + DicConsole.WriteLine("11.- Send REPORT DENSITY SUPPORT command."); + DicConsole.WriteLine("12.- Send REWIND command."); + DicConsole.WriteLine("13.- Send SPACE command."); + DicConsole.WriteLine("14.- Send TRACK SELECT command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SCSI/SyQuest.cs b/DiscImageChef.Tests.Devices/SCSI/SyQuest.cs new file mode 100644 index 00000000..e3329a44 --- /dev/null +++ b/DiscImageChef.Tests.Devices/SCSI/SyQuest.cs @@ -0,0 +1,80 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SyQuest.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SCSI +{ + public static class SyQuest + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a SyQuest vendor command to the device:"); + DicConsole.WriteLine("1.- Send READ (6) command."); + DicConsole.WriteLine("2.- Send READ (10) command."); + DicConsole.WriteLine("3.- Send READ LONG (6) command."); + DicConsole.WriteLine("4.- Send READ LONG (10) command."); + DicConsole.WriteLine("0.- Return to SCSI commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SCSI commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SecureDigital.cs b/DiscImageChef.Tests.Devices/SecureDigital.cs new file mode 100644 index 00000000..5062572f --- /dev/null +++ b/DiscImageChef.Tests.Devices/SecureDigital.cs @@ -0,0 +1,85 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SecureDigital.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; +using DiscImageChef.Tests.Devices.SecureDigital; + +namespace DiscImageChef.Tests.Devices +{ + partial class MainClass + { + public static void SecureDigital(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send an SecureDigital/MultiMediaCard command to the device:"); + DicConsole.WriteLine("1.- Send a SecureDigital command to the device."); + DicConsole.WriteLine("2.- Send a MultiMediaCard command to the device."); + DicConsole.WriteLine("0.- Return to command class menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to command class menu..."); + return; + case 1: + Devices.SecureDigital.SecureDigital.Menu(devPath, dev); + continue; + case 2: + MultiMediaCard.Menu(devPath, dev); + continue; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SecureDigital/MultiMediaCard.cs b/DiscImageChef.Tests.Devices/SecureDigital/MultiMediaCard.cs new file mode 100644 index 00000000..83485a8e --- /dev/null +++ b/DiscImageChef.Tests.Devices/SecureDigital/MultiMediaCard.cs @@ -0,0 +1,83 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : MultiMediaCard.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SecureDigital +{ + public static class MultiMediaCard + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a MultiMediaCard command to the device:"); + DicConsole.WriteLine("1.- Send READ_MULTIPLE_BLOCK command."); + DicConsole.WriteLine("2.- Send READ_SINGLE_BLOCK command."); + DicConsole.WriteLine("3.- Send SEND_CSD command."); + DicConsole.WriteLine("4.- Send SEND_EXT_CSD command."); + DicConsole.WriteLine("5.- Send SEND_OP_COND command."); + DicConsole.WriteLine("6.- Send SEND_STATUS command."); + DicConsole.WriteLine("7.- Send SET_BLOCKLEN command."); + DicConsole.WriteLine("0.- Return to SecureDigital/MultiMediaCard commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SecureDigital/MultiMediaCard commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.Tests.Devices/SecureDigital/SecureDigital.cs b/DiscImageChef.Tests.Devices/SecureDigital/SecureDigital.cs new file mode 100644 index 00000000..020e56ea --- /dev/null +++ b/DiscImageChef.Tests.Devices/SecureDigital/SecureDigital.cs @@ -0,0 +1,79 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SecureDigital.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using DiscImageChef.Console; +using DiscImageChef.Devices; + +namespace DiscImageChef.Tests.Devices.SecureDigital +{ + public static class SecureDigital + { + public static void Menu(string devPath, Device dev) + { + while(true) + { + System.Console.Clear(); + DicConsole.WriteLine("Device: {0}", devPath); + DicConsole.WriteLine("Send a SecureDigital command to the device:"); + DicConsole.WriteLine("1.- Send SD_SEND_OP_COND command."); + DicConsole.WriteLine("2.- Send SD_STATUS command."); + DicConsole.WriteLine("3.- Send SEND_SCR command."); + DicConsole.WriteLine("0.- Return to SecureDigital/MultiMediaCard commands menu."); + DicConsole.Write("Choose: "); + + string strDev = System.Console.ReadLine(); + if(!int.TryParse(strDev, out int item)) + { + DicConsole.WriteLine("Not a number. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + + switch(item) + { + case 0: + DicConsole.WriteLine("Returning to SecureDigital/MultiMediaCard commands menu..."); + return; + default: + DicConsole.WriteLine("Incorrect option. Press any key to continue..."); + System.Console.ReadKey(); + continue; + } + } + } + } +} diff --git a/DiscImageChef.sln b/DiscImageChef.sln index f95cc41b..e0f9628a 100644 --- a/DiscImageChef.sln +++ b/DiscImageChef.sln @@ -37,6 +37,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Server", "Dis EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Tests", "DiscImageChef.Tests\DiscImageChef.Tests.csproj", "{B2ABC1F2-C365-4515-9F23-A5725050CC48}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Tests.Devices", "DiscImageChef.Tests.Devices\DiscImageChef.Tests.Devices.csproj", "{A40662EB-D202-46A4-AB41-9C32ADE6D6B5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -111,6 +113,10 @@ Global {B2ABC1F2-C365-4515-9F23-A5725050CC48}.Debug|x86.Build.0 = Debug|Any CPU {B2ABC1F2-C365-4515-9F23-A5725050CC48}.Release|x86.ActiveCfg = Release|Any CPU {B2ABC1F2-C365-4515-9F23-A5725050CC48}.Release|x86.Build.0 = Release|Any CPU + {A40662EB-D202-46A4-AB41-9C32ADE6D6B5}.Debug|x86.ActiveCfg = Debug|x86 + {A40662EB-D202-46A4-AB41-9C32ADE6D6B5}.Debug|x86.Build.0 = Debug|x86 + {A40662EB-D202-46A4-AB41-9C32ADE6D6B5}.Release|x86.ActiveCfg = Release|x86 + {A40662EB-D202-46A4-AB41-9C32ADE6D6B5}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE