Open Klami opened 4 years ago
This poses a severe race condition problem! The protocol "framing" using CRLF was originally put in place (by me) to solve the issue of finding the end of the response. Whereas your code only works when the underlying operating system routines process the response in a single chunk. This however cannot be guaranteed. What exactly does trigger the problem?
A Command like this: ./chamtool.py -p /dev/ttyACM0 -s1 -c ISO14443A_READER -I -s2 -c -U
without my fix I've get a error that ATQA is not parse able to int base10 because the the second line from the identify command is interpreted as status response from the next command. It's also possible to clear the buffer after each read and lose the rest of information or change the firmware that it responses as one line
If another command after the -I option is issues the script fails
I've edited the 'readResponse(self)' to read until the end of the response instead of only one line