Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Condition to Stop read_response Function in i2c.py #10

Open
YairBenamou opened this issue Aug 27, 2024 · 0 comments
Open

Add Condition to Stop read_response Function in i2c.py #10

YairBenamou opened this issue Aug 27, 2024 · 0 comments

Comments

@YairBenamou
Copy link

YairBenamou commented Aug 27, 2024

I’d like to propose an enhancement for the py532lib library, specifically in the i2c.py file. Currently, the read_response function continuously listens for incoming NFC chips without a built-in mechanism to stop this process based on a condition.

I suggest adding a simple flag to the class that can be used to control the execution of the loop.

def __init__(self, address=PN532_I2C_SLAVE_ADDRESS, i2c_channel=RPI_DEFAULT_I2C_NEW):
    ...
    self.condition = True

def read_response(self):
    ...

    while self.condition:

        ....

This change would provide more control over the NFC reading process, enabling users to stop listening based on specific conditions like listening for incoming chips only on working hours.

I have not found any existing method to stop the read_mifare() function from waiting for incoming chips, so this enhancement would fill a useful gap in the library’s functionality.

Thank you.

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

No branches or pull requests

1 participant