// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : SCSI_MMC.cs // Author(s) : Natalia Portillo // // Component : Aaru device testing. // // --[ 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 © 2011-2021 Natalia Portillo // ****************************************************************************/ using Aaru.Console; using Aaru.Devices; namespace Aaru.Tests.Devices { internal static partial class ScsiMmc { public static void Menu(string devPath, Device dev) { while(true) { System.Console.Clear(); AaruConsole.WriteLine("Device: {0}", devPath); AaruConsole.WriteLine("Send a special SCSI MultiMedia command to the device:"); AaruConsole. WriteLine("1.- Try to read the cache data from a device with a MediaTek chipset (F1h command 06h subcommand)."); AaruConsole.WriteLine("2.- Try to read a GD-ROM using a trap disc."); AaruConsole.WriteLine("3.- Try to read Lead-Out using a trap disc."); AaruConsole.WriteLine("0.- Return to command class menu."); AaruConsole.Write("Choose: "); string strDev = System.Console.ReadLine(); if(!int.TryParse(strDev, out int item)) { AaruConsole.WriteLine("Not a number. Press any key to continue..."); System.Console.ReadKey(); continue; } switch(item) { case 0: AaruConsole.WriteLine("Returning to command class menu..."); return; case 1: MediaTekReadCache(devPath, dev); continue; case 2: CheckGdromReadability(devPath, dev); continue; case 3: ReadLeadOutUsingTrapDisc(devPath, dev); continue; default: AaruConsole.WriteLine("Incorrect option. Press any key to continue..."); System.Console.ReadKey(); continue; } } } } }