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

How to end the Tap listerning events #18

Open
wxjames opened this issue May 16, 2023 · 1 comment
Open

How to end the Tap listerning events #18

wxjames opened this issue May 16, 2023 · 1 comment

Comments

@wxjames
Copy link

wxjames commented May 16, 2023

In the example code for Windows, the above code works for listening the raw data from sensor.

tap_instance = TapSDK()
tap_instance.run()
tap_instance.register_connection_events(on_connect)
tap_instance.register_disconnection_events(on_disconnect)
tap_instance.register_raw_data_events(on_raw_sensor_data)

How could I end the listening events?

@ilouzl
Copy link
Contributor

ilouzl commented May 16, 2023

There is no api in the sdk to do that, at the moment.
You could modify it and start a PR if you like.

In windows, I believe you could do something like:

def deregister_connection_events(self, listener=None):
        if listener is not None:
            TAPManager.Instance.OnTapConnected -= listener

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

2 participants