def connect(self):
        # TODO push this to a background connecting thread so the constructor
        # can return
        port = 1
        connected = False
        while not connected:
            self.socket = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
            try:
                self.socket.connect((self.address, port))
            except IOError as e:
                LOG.warn("Unable to connect to %s" % self.address, e)
            else:
                LOG.info("Opened bluetooth device at %s", port)
                connected = True
dataset/ETHPy150Open openxc/openxc-python/openxc/sources/bluetooth.py/BluetoothVehicleInterface.connect/original