[Pcsclite-muscle] PCSC proxy mode and READER_STATE struct

Ludovic Rousseau ludovic.rousseau at gmail.com
Sat Oct 28 07:18:56 PDT 2023


Le ven. 27 oct. 2023 à 10:36, Andrey Af <public.irkutsk at gmail.com> a écrit :
>
> Hi all, I use the pcsc-lite-1.8.24 API.

Hello,

> So, PCSC API call to SCardGetStatusChange does the conversion from
> READER_STATE to CARDREADER_STATE.
> But I have an internal myScardGetStatusChange call and I get a ready
> SCARD READER_STATE.
>
> How do I do the reverse conversion, from SCARD_READER_STATE to
> READER_STATE, so that  SCardGetStatusChange is working?
> I have variables dwCurrentState, dwEventState and need to get
> readerState variable.

I don't know what you call SCARD_READER_STATE.

> Sample code what am I doing:
>
> (dwCurrentState, dwEventState, rgbAtr[]) = myGetStatusChange(hContext,
> dwTimeout, readerName, dwCurrentState, dwEventState, rgbAtr[]);
>
> if(dwEventState & ReaderStateChanged)
> {
>    READER_STATE[x].readerState = dwEventState & ReaderStatePresent ?
> CardReaderStatePresent : CardReaderStateAbsent;
> }
>
> And returned READER_STATE[] from unix socket, for CMD_GET_READERS_STATE.

You are trying to talk directly on the pcscd/libcsclite1 communication socket.
This is not supported or documented.

> When scanning, I get the token information, and then after a while -
> "Card state: Card removed"

You should first describe what you want to do at a high level.
For example what do you call "proxy mode"?

Bye

--
 Dr. Ludovic Rousseau



More information about the pcsclite-muscle mailing list