AnsweredAssumed Answered

How to convert MiFare Classic UID read to character

Question asked by Cyndi L on Feb 18, 2017
Latest reply on Feb 22, 2017 by Jorge_Gonzalez

Hi Nxp Community,

 

I'm currently using the NFC Reader Library for Linux Example 4 for MiFare Classic 1k tag and I'm trying to convert the UID and store the data read to a const character variable (so I can parse the data using socket to my application on the PC).

 

However, after multiple tries of type casting to char, char array, pointer of char or even using itoa method (even though the UID is of unsigned integer of 8 bytes), I still can't get it to work I am unsure if I missed out anything or misinterpreted the UID data type as when i do casting, it shows me 

warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

or

warning: assignment makes pointer from integer without a cast

 

I'm new to C and this is a huge hurdle for me.. Any help or examples to convert would be greatly appreciated and feel free to let me know should the code for sending data via socket is needed for reference. Thank you!

Outcomes