Android Question Reading NfcV tag ISO15693

AlbertoCervigni

New Member
Licensed User
Hello, i try to read memory of tag using
TagTech.RunAsync("TT", "transceive", Array(Array As Byte(0x20, 0x20, 0x01)), 0)
Wait For TT_RunAsync (Flag As Int, Success As Boolean, Result As Object)
but the result is different each time the same tag is read!

TagTech.Initialize("TagTech", "android.nfc.tech.NfcV" , si)
'Get the UID
Dim jo As JavaObject = TagTech
Dim tag As JavaObject = jo.RunMethod("getTag", Null)
Dim rawId() As Byte = tag.RunMethod("getId", Null)
Dim bc As ByteConverter
Log($"ID: ${bc.HexFromBytes(rawId)}"$)
and the rawid is different each time!

Please help me, and sorry for my poor english!
 

drgottjr

Expert
Licensed User
Longtime User
in the case of contactless cards, some commands are designed to return a different answer to the same question.
you should obtain the list of technologies supported by this card. if it supports isodep or ndef, you should communicate with it using one of those technologies. once you start talking to NfcV directly, things become more difficult.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
not sure what you mean; examples of what? you need to see if the tag supports other technologies. who told you the tag was NfcV?

i assume this line from your app:
B4X:
TagTech.Initialize("TagTech", "android.nfc.tech.NfcV" , si)

comes from erel's famous nfc tutorial:
B4X:
If techs.IndexOf("android.nfc.tech.Ndef") > -1 Then
   TagTech.Initialize("TagTech", "android.nfc.tech.Ndef" , si)
   'Connect to the tag
   TagTech.Connect
Else ...

something told you to use NfcV. in erel's tutorial, "techs" is the list of technolgies supported by the tag when it was discovered. tags can support multiple technologies. Ndef, for example, is very common and there will be a million examples for you. It's like a person who speaks several languages: french and english. if you speak a little french but a lot of english, you would prefer to communicate in english. if your tag (assuming it is NfcV) can support Ndef, you would want to communicate with it using Ndef, not NfcV. as android documentation indicates, if you use NfcV technolgy, you have to implement everything yourself, which means studying a log of documentation. the tag may have more than 1 way to make its data available to you. same data, different "language" does your tag support multiple technologies?
 
Upvote 0
Top