예제 #1
0
 /// <summary>
 /// Gets the "SC Specific Use" part of the ProtocolID.
 /// </summary>
 /// <param name="pid">The PID byte to decode.</param>
 /// <returns>The "SC Specific Use" value.</returns>
 /// <exception cref="T:System.ArgumentException">Value in pid is not from the "SC specific" range.</exception>
 public static byte GetSCSpecificUseValue(byte pid)
 {
     if (ProtocolID.IsSCSpecificUse(pid))
     {
         return((byte)(pid - 192));
     }
     else
     {
         throw new ArgumentException("Value is not from the \"SC specific\" range.", "pid");
     }
 }
예제 #2
0
 /// <summary>
 /// Extracts the "Reserved" part of the PID.
 /// </summary>
 /// <param name="pid">The PID containing the value.</param>
 /// <returns>The value of the "Reserved" part.</returns>
 /// <exception cref="T:System.ArgumentException">Value is not from the "Reserved" range.</exception>
 public static byte GetReservedValue(byte pid)
 {
     if (ProtocolID.IsReserved(pid))
     {
         return((byte)(pid - 128));
     }
     else
     {
         throw new ArgumentException("Value is not from the \"Reserved\" range.", "pid");
     }
 }