I am trying to send Mifare DesFire (and Mifare Plus) APDUs to PCSC compliant readers. As I have read in the documentation you have to encapsulate those commands before sending them to those kind of readers. For example:
in DesFire the command 'Format PICC' is FC. You have to send either: 90 FC 00 00 00 which is the ISO - formatted command or FF DE 00 00 01 FC - the format FF DE 00 00 [Length_of_command] [command] is in the documentation of most PCSC readers
The problem is that the above format works fine only when the bytes of the response are more than one. If the response is one byte it always returns an unknown error code. E.g. if the FC command is sent as a first command it should return 'AE'. Instead I get an unknown error, which seems to be a problem of the reader.
Note: In the ISO-formatted command 90 FC 00 00 00 the response is correct ('91AE')