// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : Certance.cs // Author(s) : Natalia Portillo // // Component : Certance vendor commands. // // --[ Description ] ---------------------------------------------------------- // // Contains vendor commands for Certance SCSI devices. // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library 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 // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ using System; using DiscImageChef.Console; namespace DiscImageChef.Devices { public partial class Device { /// /// Parks the load arm in preparation for transport /// /// Sense buffer. /// Timeout. /// Duration. public bool CertancePark(out byte[] senseBuffer, uint timeout, out double duration) { return CertanceParkUnpark(out senseBuffer, true, timeout, out duration); } /// /// Unparks the load arm prior to operation /// /// Sense buffer. /// Timeout. /// Duration. public bool CertanceUnpark(out byte[] senseBuffer, uint timeout, out double duration) { return CertanceParkUnpark(out senseBuffer, false, timeout, out duration); } /// /// Parks the load arm in preparation for transport or unparks it prior to operation /// /// Sense buffer. /// If set to true, parks the load arm /// Timeout. /// Duration. public bool CertanceParkUnpark(out byte[] senseBuffer, bool park, uint timeout, out double duration) { byte[] buffer = new byte[0]; byte[] cdb = new byte[6]; senseBuffer = new byte[32]; bool sense; cdb[0] = (byte)ScsiCommands.Certance_ParkUnpark; if(park) cdb[4] = 1; lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration, out sense); error = lastError != 0; DicConsole.DebugWriteLine("SCSI Device", "CERTANCE PARK UNPARK took {0} ms.", duration); return sense; } } }