Have you tried lowercase UID? It is worth a shot. auth.PCDchallenge should also be lowercase to match.
When I send my UID to vivokey I flip it’s Endianness. This only applies to the UID, everything else that I send and receive from my chip and from Vivokey is unmodified. This means the UID should be rearranged to look like this: XXXXXXXXXXXX04
Bit of floundering on my part but me and @AbbottSmith been chatting in DM’s and we made progress. I’ll update later as got to leave for work in 15 minutes but ive got PCD response and PICC response!
I suppose the most confusing part in the API is here there is no mention of Endianness and it shows a UID being sent with 04 at the begining (knowing all NXP chips start with that) you would think that i could send it like that but nope.
It might be of use to someone so here it is, it aint finished but it will scan my spark2 and auth it. Also added detecting a non vivokey device and returning that info.
Just pushed another commit to tidy a few things and finish adding Apex support. Obviously I have no way to test it for Apex so if someone did and an ACR122U handy id appreciate it.