Ejemplo n.º 1
0
        public static ModePage_06?DecodeModePage_06(byte[] pageResponse)
        {
            if ((pageResponse?[0] &0x40) == 0x40)
            {
                return(null);
            }

            if ((pageResponse?[0] &0x3F) != 0x06)
            {
                return(null);
            }

            if (pageResponse[1] + 2 != pageResponse.Length)
            {
                return(null);
            }

            if (pageResponse.Length < 4)
            {
                return(null);
            }

            ModePage_06 decoded = new ModePage_06();

            decoded.PS   |= (pageResponse[0] & 0x80) == 0x80;
            decoded.RUBR |= (pageResponse[2] & 0x01) == 0x01;

            return(decoded);
        }
Ejemplo n.º 2
0
        public static string PrettifyModePage_06(ModePage_06?modePage)
        {
            if (!modePage.HasValue)
            {
                return(null);
            }

            ModePage_06   page = modePage.Value;
            StringBuilder sb   = new StringBuilder();

            sb.AppendLine("SCSI optical memory:");

            if (page.PS)
            {
                sb.AppendLine("\tParameters can be saved");
            }
            if (page.RUBR)
            {
                sb.AppendLine("\tOn reading an updated block drive will return RECOVERED ERROR");
            }

            return(sb.ToString());
        }