2021-02-16 01:43 AM
2021-02-22 02:22 AM
Hi Vincent,
then in your state machine do something like:
switch (state){
....
case WAIT_NFC_TXRX_ACTIVE:
rfalWorker();
if (ERR_BUSY != rfalGetTransceiveStatus())
state = NFC_TXRX_DONE;
break;
....
Regards, Ulysses
2021-02-16 02:48 AM
Hi VGone.1,
just replicate what the blocking functions are essentially doing: Create a transceive context, then call rfalWorker as long as the transceive status says ERR_BUSY:
rfalCreateByteFlagsTxRxContext( ctx, txBuf, txBufLen, rxBuf, rxBufLen, actLen, flags, fwt );
EXIT_ON_ERR( ret, rfalStartTransceive( &ctx ) );
do{
rfalWorker();
ret = rfalGetTransceiveStatus();
}
while((ret == ERR_BUSY) ;
return ret;
Of course you can also place the calls into a state machine running the transceive. rfal_nfc.c is a convenient layer which which breaks tag detection, activation and data transfers into a state machine offering convenient interfaces.
Best Regards, Ulysses
2021-02-16 05:02 AM
Hi Ulysses,
Thank you for your quick answer. I've already try to adapt the function to be run into a state machine but I wasn't able to read the tags. I will retry as soon as possible.
2021-02-21 12:53 AM
Hi,
In my case, the status remains indefinitely "BUSY". Is there something else I can try to solve this problem ?
2021-02-22 12:47 AM
Hi VGone.1,
above code should do exactly the same as the ...Blocking... functions so if they work the code snippet should also work. Did you correctly put rfalWorker() inside the loop?
Regards, Ulysses
2021-02-22 01:33 AM
Hi Ulysses,
You're right, but I don't want to use a do...while loop. I want to call a function rfalTransceiveNonBlockingRx(). This function calls rfalWorker() and rfalGetTransceiveStatus() without any loop. My goal is to call the function rfalTransceiveNonBlockingRx() several times in a state machine until the status is "Not Busy".
Best regards,
Vincent
2021-02-22 02:22 AM
Hi Vincent,
then in your state machine do something like:
switch (state){
....
case WAIT_NFC_TXRX_ACTIVE:
rfalWorker();
if (ERR_BUSY != rfalGetTransceiveStatus())
state = NFC_TXRX_DONE;
break;
....
Regards, Ulysses