Search code examples
nfcapdu

Disable the default red LED on the ACR122U


I would like to send an APDU such that the default LED state on the ACS ACR122U card reader (without a card present) will be that no LEDs are lit.

The documentation would indicate that such a command would be FF 00 40 0c 04 00 00 00 00, leaving the Final LED State of both Red and Green at 0 (off). However, this just flashes the light to off then back.

This seems to be because APDUs go to the card not to the reader. However, there are Pseudo-APDUs that control the device parameters. Basically, I know it's not documented, but does anyone know if such a parameter still exists? Or some workaround?

Thanks, Gausie.


Solution

  • As stated above, there is no "solution" as such, but there is a workaround.

    Bit 7 of the PICC Operating Parameter is used to enable auto polling, if this bit is set to 0 the reader does not drive the LED's. Command 0x51 allows you to change the PICC operating parameters. Of course, the reader does not poll for a card with bit 7 disabled, but this can be overcome by communicating directly to the PN532 chip via the PICC Direct Transmit command (0x00 - see section 6.1 in ACR API Manual 2.02).

    With direct transmit you can issue the PN532 command "InAutoPoll" which will put the chip into polling mode, but leave the LED's alone as they are part of the reader and not part of the PN532 chip.

    The PICC LED & Driver command (0x40) can then be used to set LED's and Buzzer to whatever you desire.

    The PN532 chip commands can be found in the NXP user manual located here.

    The ACR122 PICC communications protocol encapsulates the PN532 commands in a CCID header. If you are using libnfc run your application with LIBNFC_DEBUG_LEVEL=3 and you will be able to monitor the data exchange.