Hello everyone,
Does anyone have any experience using NFC to communicate between two devices, not only reading or writing to/from tags? My question here refers to the exchange of data between my app and the medical device using NFC. I have the protocol specification that I need to follow. The problem is, how can I achieve the “request-response” communication between them. For instance, first I need to send a set of bytes to the device to initiate recognition, then the response from the device is sent back which my app should read and process and so on.
this.nfc.addNdefListener(nfcEvent => this.readNFCTag(nfcEvent.tag)).subscribe(data => {
this.toast.show('NDEF Listener Detected', '10000', 'center').subscribe(toast => {
console.log('NDEF Listener Detected');
});
payload = this.nfc.stringToBytes("0xAB 0x00 0x2a 0x00 0x00 0x00 0x00 0x00 0xB0");
this.seePayload = payload;
record = this.ndef.record(this.ndef.TNF_EXTERNAL_TYPE, type, id, payload);
var message = [record];
this.nfc.write(message).then(data => {
//Here should be the response after writing to the device
});
});
Thanks a lot