In my App (Android studio java) I'm trying to read a payload from a specific tag with result of type ndefFormatable and NfcV.
Once I get the intent and identify the tag by:
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
I then create a NFCV object and do the following operation:
NfcV nfcV = NfcV.get(tag);
byte[] data = new byte[0];
byte[] id = tag.getId();
if (nfcV != null) {
byte[] infoCmd = new byte[2 + id.length];
// set "addressed" flag
infoCmd[0] = 0x20;
// Get System Information command byte
infoCmd[1] = 0x2B;
//adding the tag id
System.arraycopy(id, 0, infoCmd, 2, id.length);
System.arraycopy(id, 0, infoCmd, 2, 8);
try {
nfcV.connect();
// infoCmd VALUE: [32, 43, 107, 32, -61, -97, 116, 77, 2, -32]
// DATA RESULT: [0, 11, 107, 32, -61, -97, 116, 77, 2, -32, -1, 0, 78]
data = nfcV.transceive(infoCmd);
}
catch (IOException e) {
e.printStackTrace();
}
finally {
try {
nfcV.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
}
The problem is that the data I receive from the nfc.transceive is not what I expect it to be, I don't know if it is because the content of infoCmd is wrong or simply because like this I cannot get the payload from the device. If it can help I want to clarify that with this exact nfc device, in an other c# code I am able to get the payload with the ProximityDevice Object by:
ProximityMessage message;
var rawMsg = message.Data.ToArray();
And I must replicate this exact result (rawMsg) in my Android app, basically I'm trying to get the same payload sent from the same nfc device but in an other app, in this case Android.