diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/TobiiGlassesPro2/TobiiController.py | 4 | ||||
-rw-r--r-- | src/argaze/TobiiGlassesPro2/TobiiNetworkInterface.py | 15 |
2 files changed, 7 insertions, 12 deletions
diff --git a/src/argaze/TobiiGlassesPro2/TobiiController.py b/src/argaze/TobiiGlassesPro2/TobiiController.py index d61d6ab..49e0834 100644 --- a/src/argaze/TobiiGlassesPro2/TobiiController.py +++ b/src/argaze/TobiiGlassesPro2/TobiiController.py @@ -31,7 +31,7 @@ class TobiiController(TobiiNetworkInterface.TobiiNetworkInterface): calibration_id = None """Calibration identifier.""" - def __init__(self, ip_address, project_name = DEFAULT_PROJECT_NAME, participant_name = DEFAULT_PARTICIPANT_NAME): + def __init__(self, ip_address = None, project_name = DEFAULT_PROJECT_NAME, participant_name = DEFAULT_PARTICIPANT_NAME): """Create a project, a participant and start calibration.""" super().__init__(ip_address) @@ -185,7 +185,7 @@ class TobiiController(TobiiNetworkInterface.TobiiNetworkInterface): def calibrate(self): """Start Tobii glasses calibration for current project and participant.""" - input('Position Tobbi glasses calibration target then presse \'Enter\' to start calibration.') + input('Position Tobbi glasses calibration target then press \'Enter\' to start calibration.') data = { 'ca_project': self.project_id, diff --git a/src/argaze/TobiiGlassesPro2/TobiiNetworkInterface.py b/src/argaze/TobiiGlassesPro2/TobiiNetworkInterface.py index 52d0be5..2b55eb7 100644 --- a/src/argaze/TobiiGlassesPro2/TobiiNetworkInterface.py +++ b/src/argaze/TobiiGlassesPro2/TobiiNetworkInterface.py @@ -92,8 +92,6 @@ class TobiiNetworkInterface(): logging.error("Device discovery is not available due to a missing dependency (netifaces)") exit(1) - logging.debug("Looking for a Tobii Pro Glasses 2 device ...") - MULTICAST_ADDR = 'ff02::1' PORT = 13006 @@ -114,18 +112,15 @@ class TobiiNetworkInterface(): PORT_OUT = PORT if sys.platform == 'win32' or sys.platform == 'darwin' else PORT + 1 try: + + # Sending discover request discover_json = '{"type":"discover"}' s6.sendto(discover_json.encode('utf-8'), (MULTICAST_ADDR, PORT_OUT)) - logging.debug("Discover request sent to %s on interface %s " % ( str((MULTICAST_ADDR, PORT_OUT)),if_name) ) - logging.debug("Waiting for a reponse from the device ...") - + # Waiting for a reponse from the device ... data, address = s6.recvfrom(1024) jdata = json.loads(data.decode('utf-8')) - logging.debug("From: " + address[0] + " " + str(data)) - logging.debug("Tobii Pro Glasses found with address: [%s]" % address[0]) - addr = address[0] if sys.version_info.major == 3 and sys.version_info.minor >= 8: @@ -134,9 +129,9 @@ class TobiiNetworkInterface(): return (jdata, addr) except: - logging.debug("No device found on interface %s" % if_name) - logging.debug("The discovery process did not find any device!") + # No device found on interface + pass return (None, None) |