Skip to content

Can't send peripherals controls on ACS ACR1252U #1280

@SomaticIT

Description

@SomaticIT

Hello,

Thank you for your amazing work porting PCSC on ChromeOS.
We are working on a project which require us to communicate directly with the reader internal chip.

However when we try to send SCardControl with a control code of SCARD_CTL_CODE(3500) as indicated in the ACR ACS1252U API docs (chapter 5.4. Peripherals Control), we receive a SCARD_E_UNSUPPORTED_FEATURE error code from ifdwrapper.c.

It seems to happen because SCARD_CTL_CODE(3500) is not known by the port.
Can we help improving the PCSC implementation to support custom CTL CODES?

Thanks,

PS: here is an pseudo code implementation:

const api_context = GoogleSmartCard.PcscLiteClient.Context("myapp");

api_context.addOnInitializedCallback(async (api) => {
  const context_result = await api.SCardEstablishContext(GoogleSmartCard.PcscLiteClient.API.SCARD_SCOPE_SYSTEM); //also tried USER
  const context = await get_async(context_result);

  const connect_result = await api.SCardConnect(context, reader, GoogleSmartCard.PcscLiteClient.API.SCARD_SHARE_DIRECT, GoogleSmartCard.PcscLiteClient.API.SCARD_PROTOCOL_UNDEFINED); // also tried RAW
  const [card, protocol] = await get_all_async(connect_result);
  if (protocol !== 4) throw "bad protocol";

  const firmware_result = await api.SCardControl(
    card,
    GoogleSmartCard.PcscLiteClient.API.SCARD_CTL_CODE(3500),
    [0xe0, 0x00, 0x00, 0x18, 0x00]
  );

  const firmware = await get_async(firmware_res); // respond with GoogleSmartCard.PcscLiteClient.API.SCARD_E_UNSUPPORTED_FEATURE
});

api_context.initialize();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions