(self)
Setup for headset on the Windows platform.
Setup for headset on the Windows platform.
Setup for headset on the Windows platform .
def setup_windows(self):
        """
        Setup for headset on the Windows platform.
        """
        devices = []
        try:
            for device in hid.find_all_hid_devices():
                if device_is_emotiv(device, self.platform):
                    devices.append(device)
            if len(devices) == 0:
                print_hid_enumerate(system_platform, hid)
                sys.exit()
            device = devices[1]
            device.open()
            self.hid = device
            self.serial_number = device.serial_number
            print("Reader detected serial number: {serial_number}".format(serial_number=self.serial_number))
            device.set_raw_data_handler(self.data_handler)
        except Exception as ex:
            print("Emotiv WindowsSetupError ", sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2], " : ", ex)
        finally:
            if self.hid is not None:
                self.hid.close()
def setup_windows ( self ) : devices = [ ] try : for device in hid . find_all_hid_devices ( ) : if device_is_emotiv ( device , self . platform ) : devices . append ( device ) if len ( devices ) == 0 : print_hid_enumerate ( system_platform , hid ) sys . exit ( ) device = devices [ 1 ] device . open ( ) self . hid = device self . serial_number = device . serial_number print ( "Reader detected serial number: {serial_number}" . format ( serial_number = self . serial_number ) ) device . set_raw_data_handler ( self . data_handler ) except Exception as ex : print ( "Emotiv WindowsSetupError " , sys . exc_info ( ) [ 0 ] , sys . exc_info ( ) [ 1 ] , sys . exc_info ( ) [ 2 ] , " : " , ex ) finally : if self . hid is not None : self . hid . close ( )