def l2cap_connect (self, addrport):
        addr, port = addrport
        dbg ("connecting to %s port %d" % (addr, port))
        if not is_valid_address (addr):
            raise ValueError (addr % "invalid address %s")

        if not self._if.assign_psm_value (L2CAP_UUID, port):
            raise BluetoothError ("Failed to assign PSM %d" % port)
        if not self._if.set_security_level ("", _widcomm.BTM_SEC_NONE, False):
            raise BluetoothError ("Failed to set security level")
        if not self._if.register ():
            raise BluetoothError ("Failed to register PSM")

        self.connecting = True

        if not self._wc.connect (self._if, str_to_BD_ADDR (addr)):
            raise BluetoothError ("Connect failed")

        while self.connecting:
            self.l2cap_read_msg ()

        if not self.connected:
            raise BluetoothError ("connection failed")
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/pybluez/bluetooth/widcomm.py/BluetoothSocket.l2cap_connect/swapped operands of `%`