marcus905 / libnfc

Automatically exported from code.google.com/p/libnfc
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Frame synchronisation is needed for serial device #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. configure using more than one serial device (ie. pn532_uart and arygon)
2. plug a serial device (ie. arygon)
3. run a libnfc's example

What is the expected output? What do you see instead?
The device should be detected, but it doesn't.

The problem comes from the non-effective serial input flush (see r1004):
When you are looking for the attempted bytes, we read the previously sent bytes.
eg. libnfc send a PN532 command to detect a pn532_uart device on a port where 
an ARYGON is plugged.
The ARYGON device reply to that command but as it not the attempted reply by a 
pn532_uart device, we continue with the next driver.
But as we don't have fully flush the RX buffer, when the ARYGON driver want to 
read a reply, it read the previously received data; so the driver fails to 
detect the ARYGON device.

Original issue reported on code.google.com by romu...@libnfc.org on 22 Apr 2011 at 5:02

GoogleCodeExporter commented 9 years ago
Partially fixed in r1094: there is now a working input flush but its only used 
at connection time, not in decoding process to recove from a bad frame sync.
BTW, this is really a lot more stable since 1.5.x series, so except we found a 
way to reproduce a frame desync, this issue is considered as closed.

Original comment by romu...@libnfc.org on 17 Oct 2011 at 5:10