Android Question HEX Problem...

Duncan H Williamson

Member
Licensed User
Longtime User
Hi All
I have an RFID card reader/writer with a serial interface..
according to the manual it communicates via HEX.
I have connected a USB serial adapter to it and am using felusb to communicate with it.
when a tag is read it should produce a series of hex characters with the first being AA BB then the UID of the tag.
It is producing a HEX output however the first two are 95 22 instead of AA BB the correct number of hex characters is being produced but are all incorrect.
I have double checked that I have set the baud rate, stop bit etc correctly , and in fact have changed the baud rate to ensure i had it right.
with multiple tag reads on the same tag it always produces the same hex characters
I have used the code below to initially see what is being produced..
would really appreciate it if someone could point me in the right direction

B4X:
Private Sub serial_DataAvailable (Buffer() As Byte)
    Label1.Text = Label1.text & " " & bc.HexFromBytes(Buffer)
 
End Sub
 

Duncan H Williamson

Member
Licensed User
Longtime User
LogCat connected to: B4A-Bridge: samsung SM-G930F
--------- beginning of main

"
{
u



am

j
��
** Activity (main) Pause, UserClosed = false **
My apologies for not being clear, I meant the commands sent to the reader and recieved are shown as hex in the instructions
 
Upvote 0

Duncan H Williamson

Member
Licensed User
Longtime User
Thanks for checking that for me Erel, it is much apreciated,I have found the problem !! although the output from the reader was TTL level, the data polarity was RS232
my TTL to USB adapter was expecting normal TTL polarity. Added a hex inverter and all is well !!
 
Upvote 0
Top