0

Have built an NFC-RFID reader interfacing an arduino with an Adobe AIR application.

My confusion is in how to deal with the 4 and 7 byte HEX UID values being returned

example

0xED 0xAD 0x8F 0x9A

or

0x04 0x70 0xE9 0x2A 0x42 0x2B 0x80

Converting a simple HEX value to decimal in AS3 is straightforward, namely

var decimal:int =  parseInt("FFFFFF",16); // output : 16777215

But how would I 'massage' the returned RFID HEX values first BEFORE trying to convert using the parseInt method?

Bachalo
  • 6,965
  • 27
  • 95
  • 189
  • Can you clarify what you mean by "massage"? parseInt() should correctly convert to decimal all of those values, as well as casting it in int() uint() etc. – Bennett Keller Mar 19 '14 at 15:35
  • you can't simply pass '0xED 0xAD 0x8F 0x9A' into parseInt. I'm assuming that you need to remove all '0x' from bytes first, then create a single string from the result – Bachalo Mar 19 '14 at 15:56
  • Oh I see the confusion, the entire return are those space separated values. Ok so the value is supposed to be the concatenation of those 4-7 byte values? – Bennett Keller Mar 19 '14 at 16:14
  • Do you know what each hex set means? The data is specific to the device. – Bennett Keller Mar 19 '14 at 21:12
  • You may also want to take a look at this: [Why most does RFiD tags use hexadecimal number?](http://electronics.stackexchange.com/questions/49318/why-most-does-rfid-tags-use-hexadecimal-number) – Bennett Keller Mar 19 '14 at 21:38
  • thanks, yes read that – Bachalo Mar 20 '14 at 03:31

0 Answers0