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

Find by idVendor, avoiding usb.core possible bugs with other USB devices #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion emotiv/epoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,14 @@ def set_channel_mask(self, channel_mask):
self.channel_mask = channel_mask

def enumerate(self):

"""Traverse through USB bus and enumerate EPOC devices."""
if self.method == "dummy":
self.endpoint = open("/dev/urandom")
self.get_sample = self.__get_sample_dummy
return

devices = usb.core.find(find_all=True, custom_match=self._is_epoc)
devices = usb.core.find(idVendor=0x1234, find_all=True, custom_match=self._is_epoc)

if not devices:
raise EPOCNotPluggedError("Emotiv EPOC not found.")
Expand Down