2020-07-09 04:08:39 +01:00
|
|
|
|
// /***************************************************************************
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Aaru Data Preservation Suite
|
2020-07-09 04:08:39 +01:00
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : SCSI_MMC.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Component : Aaru device testing.
|
2020-07-09 04:08:39 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2024-12-19 10:45:18 +00:00
|
|
|
|
// Copyright © 2011-2025 Natalia Portillo
|
2020-07-09 04:08:39 +01:00
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
2025-08-17 05:50:25 +01:00
|
|
|
|
using System;
|
2020-07-09 04:08:39 +01:00
|
|
|
|
using Aaru.Devices;
|
2025-08-17 05:50:25 +01:00
|
|
|
|
using Aaru.Logging;
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
namespace Aaru.Tests.Devices;
|
|
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
|
static partial class ScsiMmc
|
2020-07-09 04:08:39 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
public static void Menu(string devPath, Device dev)
|
2020-07-09 04:08:39 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
while(true)
|
2020-07-09 04:08:39 +01:00
|
|
|
|
{
|
2025-08-17 05:50:25 +01:00
|
|
|
|
Console.Clear();
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.WriteLine(Localization.Device_0, devPath);
|
|
|
|
|
|
AaruLogging.WriteLine(Localization.Send_a_special_SCSI_MultiMedia_command_to_the_device);
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.WriteLine(Localization
|
2024-05-01 04:05:22 +01:00
|
|
|
|
.Try_to_read_the_cache_data_from_a_device_with_a_MediaTek_chipset_F1h_command_06h_subcommand);
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.WriteLine(Localization.Try_to_read_a_GD_ROM_using_a_trap_disc);
|
|
|
|
|
|
AaruLogging.WriteLine(Localization.Try_to_read_Lead_Out_using_a_trap_disc);
|
2020-07-09 20:36:08 +01:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.WriteLine(Localization.Return_to_command_class_menu);
|
|
|
|
|
|
AaruLogging.Write(Localization.Choose);
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2025-08-17 05:50:25 +01:00
|
|
|
|
string strDev = Console.ReadLine();
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(!int.TryParse(strDev, out int item))
|
|
|
|
|
|
{
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.WriteLine(Localization.Not_a_number_Press_any_key_to_continue);
|
2025-08-17 05:50:25 +01:00
|
|
|
|
Console.ReadKey();
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
switch(item)
|
|
|
|
|
|
{
|
|
|
|
|
|
case 0:
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.WriteLine(Localization.Returning_to_command_class_menu);
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
return;
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
MediaTekReadCache(devPath, dev);
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
CheckGdromReadability(devPath, dev);
|
2020-07-09 20:36:08 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
ReadLeadOutUsingTrapDisc(devPath, dev);
|
2020-07-09 21:35:31 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
default:
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.WriteLine(Localization.Incorrect_option_Press_any_key_to_continue);
|
2025-08-17 05:50:25 +01:00
|
|
|
|
Console.ReadKey();
|
2020-07-09 04:08:39 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
2020-07-09 04:08:39 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|