Skip to content

Conversation

@Klami
Copy link

@Klami Klami commented Jan 13, 2020

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

If another command after the -I option is issues the script fails
@skuep
Copy link
Collaborator

skuep commented Jan 13, 2020

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?

@Klami
Copy link
Author

Klami commented Jan 14, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants