code: def _connect(self, address):
          
  
          latency = 0
          conn_interval_min = 6
          conn_interval_max = 100
          timeout = 1.0
  
          try:
              #Allow passing either a binary address or a hex string
              if isinstance(address, str) and len(address) > 6:
                  address = address.replace(':', '')
                  address = bytes(bytearray.fromhex(address)[::-1])
          except ValueError:
              return False, None
  
          #Allow simple determination of whether a device has a public or private address
          #This is not foolproof
          private_bits = bytearray(address)[-1] >> 6
          if private_bits == 0b11:
              address_type = 1
          else:
              address_type = 0
  
          payload = struct.pack("<6sBHHHH", address, address_type, conn_interval_min,
                                conn_interval_max, int(timeout*100.0), latency)
          response = self._send_command(6, 3, payload)
  
          result, handle = unpack("<HB", response.payload)
          if result != 0:
              return False, None
  
          #Now wait for the connection event that says we connected or kill the attempt after timeout
          def conn_succeeded(event):
              if event.command_class == 3 and event.command == 0:
                  event_handle, = unpack("B", event.payload[0:1])
                  return event_handle == handle
  
          #FIXME Hardcoded timeout
          events = self._wait_process_events(4.0, lambda x: False, conn_succeeded)
          if len(events) != 1:
              self._stop_scan()
              return False, None
  
          handle, _, addr, _, interval, timeout, latency, _ = unpack("<BB6sBHHHB", events[0].payload)
          formatted_addr = ":".join(["%02X" % x for x in bytearray(addr)])
          self._logger.info('Connected to device %s with interval=%d, timeout=%d, latency=%d',
                            formatted_addr, interval, timeout, latency)
  
          connection = {"handle": handle}
          return True, connection
docs: Connect to a device given its uuid