I'm developing software for an Android Things device with RFID reader RC522. I use this library: https://github.com/Galarzaa90/android-things-rc522
My task querying the RC533 RFID reader:
protected Boolean doInBackground(Object... params) {
mRc522.stopCrypto();
while (true) {
........
byte[] uuid = mRc522.getUid();
return mRc522.selectTag(uuid);
}
}
In my activity I use this to convert the UID value into a string:
String tagRC522 = toHexString(mRc522.getUid(), "")
Another application in our ecosystem used to scan the NFC tags on an Android smartphone:
public void onNewIntent(Intent intent) {
Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
String tagNFC = bytesToHex(tagFromIntent.getId());
....
}
Other apps from Play Store (e.g. NFC Tools) give the same results as the code of the smartphone app above.
The problem I face now is that the value tagRC522
(on the Android Things device using RC522) does not match the value tagNFC
(in the smartphone app).
Tag1 tagRC522 = 45DOD86528 tagNFC = 45DOD865 Tag2 tagRC522 = 3567500103 tagNFC = 35675001 Tag3 tagRC522 = 88046f12F1 tagNFC = 046F12CA193A84 Tag4 tagRC522 = 3EBA46D517 tagNFC = 3EBA46D5
Why are the results between the two applications different? How must I change my Android Things code? Android mobile is production code and a many data in firebase in tagNFC version, I couldn't change that.