Reputation: 11
We are developing an application using chainway C72 device (Android 11). We have to read multiple tags simultaneously and for each tag, we have to get EPC, Tag ID and one particular word from EPC (64 to 1 word - DataWord). We managed to get all data but tagID, EPC and the data word are not getting properly when multiple tags are in range. It is giving epc of one tag, tag id of another one and Data word of another one tag. Is there any method to read all three parameters together for a particular tag? We are using the UHFReadData function to get the result.
Upvotes: 1
Views: 474
Reputation: 1
yes. Below code will give you all memory banks data.
private suspend fun doBulkScanTags() = withContext(Dispatchers.IO) { // to run code in Background Thread
var strTid: String
var strResult: String
var res: UHFTAGInfo? = null
while (startBulkScan) {
res = mReader?.readTagFromBuffer()
if (res != null) {
strTid = res.tid
strResult =
if (strTid.isNotEmpty() && strTid != "0000000" + "000000000" && strTid != "000000000000000000000000") {
"TID:$strTid\n"
} else {
""
}
// val value = strResult + "EPC:" + res.epc //+ "@" + res.rssi
val value = res.pc+ res.epc //+ "@" + res.rssi
//this is you app call back to activity or view model class
callBack?.onBulkInventoryRead(value)
}
}
}
Upvotes: 0