[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to convert a byte array into a hexadecimal string

Posted on 2008-11-12
2
Medium Priority
?
1,392 Views
Last Modified: 2012-05-05
I am programming an NFC smart card reader and am having trouble getting the hexadecimal version of the byte array the device is sending back to me.

I put in FF00000004D44A0100, which is in hex form but the NFC reader spits is back to me in decimal form which makes it hard to look at the list of responses that the API lists. Is there any quick and easy way to convert this array into the hexidecimal equivalent and have it as string? Thanks!



 'Send Polling Command, Checks to see if
Reader0.Transmit(SCUtil.ToByteArray("FF00000004D44A0100"), resByte)
Reader1.Transmit(SCUtil.ToByteArray("FF00000004D44A0100"), resByte)
Reader2.Transmit(SCUtil.ToByteArray("FF00000004D44A0100"), resByte)
Reader3.Transmit(SCUtil.ToByteArray("FF00000004D44A0100"), resByte)

'Returns one of two values
 'Tag Found (0) = 97 (1) = 17 in hex = 0x610E
 'Tag Not Found (0) = 97 (1) = 5 in hex =0x6105

 If (SCUtil.FromByteArray(resByte)) Then

                'GetTagID
                Reader0.Transmit(SCUtil.ToByteArray("FFC000000E"), resByte)
                SCUtil.FromByteArray(resByte)

                'Got Tag ID, now based on reader and tag, do something
 End If
0
Comment
Question by:ckehoe
2 Comments
 
LVL 7

Accepted Solution

by:
aherps earned 2000 total points
ID: 22944118
0
 
LVL 1

Author Comment

by:ckehoe
ID: 22944333
ah perfect! Thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question