public PcscCardReaderConnectionInformation(IntPtr readerHandle, SCardApi scardApi) { string SystemName = Encoding.Unicode.GetString(scardApi.GetAttribute(readerHandle, SCardAttributes.DeviceSystemName).GetSubArray(0, -2));//remove trailing null character this.SystemName = SystemName; uint ChannelInfo = scardApi.GetAttribute(readerHandle, SCardAttributes.ChannelID).ToUInt32(); this.Channel = PcscCardReaderConnectionInformation.GetChannelString(ChannelInfo); byte Characteristics = scardApi.GetAttribute(readerHandle, SCardAttributes.Characteristics)[0]; this.SupportsSwallowing = Characteristics.IsBitSet(1); this.SupportsEject = Characteristics.IsBitSet(2); this.SupportsCapture = Characteristics.IsBitSet(3); this.DefaultClockRate = PcscCardReaderConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.DefaultClock)); this.DefaultDataRate = PcscCardReaderConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.DefaultDataRate)); }
public PcscSmartCardConnectionInformation(IntPtr readerHandle, SCardApi scardApi) { this.CurrentBlockWaitingTime = PcscSmartCardConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.CurrentBWT)); this.CurrentCharacterWaitingTime = PcscSmartCardConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.CurrentBWT)); this.CurrentClockRate = PcscSmartCardConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.CurrentClock)); this.CurrentD = PcscSmartCardConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.CurrentD)); this.CurrentEbcEncoding = PcscSmartCardConnectionInformation.ToEcbEncoding(scardApi.GetAttribute(readerHandle, SCardAttributes.CurrentEBCEncoding)); this.CurrentF = PcscSmartCardConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.CurrentF)); this.CurrentN = PcscSmartCardConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.CurrentN)); this.CurrentW = PcscSmartCardConnectionInformation.ToUInt32(scardApi.GetAttribute(readerHandle, SCardAttributes.CurrentW)); }