Hello
I am working with the pn1750 nfc controller
I am trying to read one tag and write to the other like in the duplicate example.
It does not work !
I can see that I read the tag's data (I change it), I do the ' NxpNci_ReaderReActivate(..) ' and then try to write and read the other tag but actually I right and read to the first tag that I read from. Maybe you know why?
Besides that, when I try to rewrite the wait for discovery notification function (cause I can't have a running real time code with all this while loops) then I see strange results right at the start maybe you can help:
(it could have been much easier to analyze it by myself if I knew what is the meaning of nfcc return values and what are all the necessary commands (in byte array values context) .
which creates a message { 0x21, 0x03, 0x09, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x06, 0x01, 00000 }
what does that message mean, it does not start with 0x00, 0x00 like you wrote
i can guess according to data sheet the 0x2 is the 001 MT of Control Packet - Command Message as a payload
and the 1 in the first 4 bits of the first byte is the GID, but what is GID = 1, what other values the GID has ? i could not find it in the data sheet
same question about the second byte, i guess it is the OID , what are the possible values of the OID and what do they refer to ?
and if i want to read or write to a tag to i have to run start discovery before (in my case tags will be inserted to microswitches so i have some validation that a tag is present ) ?
I can not have such infinite loop in my program, how can i better do that with out looping waiting for the desired answer ??
while(Answer[AnswerSize-1] == 0x02) NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_100MS);
what does it means ? do you not know a head how many messages the pn7150 has? i only have 2 tags, of the same ntag213 type, to read.
does it work like waiting for some data from each tag in the area ?
after the NxpNci_WaitForDiscoveryNotification() return SUCCESS,
in the NxpNci_ReaderActivateNext(&RfInterface[1]) , i get the following response
00 00 00 00 00 00 04 00 41 04 01 00 ff 61 05 17 01 01 02 00 ff 01 0c 44 00 07 04 83 b8 aa 28 63 81 01 00 00 00 00 00 ff ff ff ...
while, this is expected:
/* First disconnect current tag */
NxpNci_HostTransceive(NCIStopDiscovery, sizeof(NCIStopDiscovery), Answer, sizeof(Answer), &AnswerSize);
if((Answer[0] != 0x41) && (Answer[1] != 0x06) && (Answer[3] != 0x00)) return NXPNCI_ERROR;
NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_100MS);
if((Answer[0] != 0x61) && (Answer[1] != 0x06)) return NXPNCI_ERROR;
in the last line i get NXPNCI_ERROR, and its the same message for both parts
best regards
Ziv