'NfcV Tag Read data does not make sense
nfc.addTagDiscoveredListener((nfcEvent) => {
nfc.connect('android.nfc.tech.NfcV')
.then(data => {
for (let i = 0; i < 45; i += 3) {
hexString = (i).toString(16);
let writeData = new Uint8Array(4);
writeData[0] = 0x02;
writeData[1] = 0x23;
writeData[2] = hexString;
writeData[3] = 0x02;
nfc.transceive(writeData.buffer)
.then(response => {
data = new Uint8Array(response);
$scope.result[i * 8] = data.split(1, 25);
$scope.$apply();
})
.catch(error => {
alert('Error transceive: ' + JSON.stringify(error));
});
}
})
.catch((error) => {
console.log('Connection failed', error)
});
});
I am using the above code to read data from a CGMS NFC Tag. Below is the output i get.
7,29,0,32,5,0,4,192,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
74,70,71,89,48,55,48,45,84,49,48,55,56,71,193,251,52,0,16,0,23,12,192,78
20,3,150,128,90,0,237,166,28,163,218,224,4,176,42,104,139,2,203,27,0,0,0,0
59,84,192,78,15,0,63,5,197,194,224,224,154,0,204,194,224,204,154,0,234,194,224,56
7,29,0,32,5,0,4,192,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
7,29,0,32,5,0,4,192,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
155,0,248,194,224,76,91,0,234,194,224,80,155,0,213,194,224,92,155,0,200,194,224,100
155,0,193,194,224,96,155,0,193,194,224,104,155,0,195,194,224,108,155,0,194,194,224,104
155,0,193,194,224,112,155,0,200,194,224,120,155,0,202,194,224,180,91,0,203,194,224,12
7,29,0,32,5,0,4,192,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
7,29,0,32,5,0,4,192,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
92,0,191,194,224,248,90,0,59,197,224,160,219,0,173,196,224,124,154,0,99,196,224,156
154,0,250,195,224,236,155,0,174,195,224,40,156,0,130,195,224,92,156,0,93,195,224,136
92,0,76,195,224,72,156,0,71,195,224,0,93,0,57,195,224,128,156,0,87,195,224,192
7,29,0,32,5,0,4,192,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
It's 360 bytes of data. I want to extract the Blood glucose values and their time stamp from these bytes. Please advice.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
