(ssid, interface=None)
return nw
Scan for networks nearby.

  Blocks until the association is complete.

  The call to scanForNetworksWithName_error_ will return a list of networks
  including many duplicates, so this function uses the rssiValue to pick
  the CWNetwork object with the strongest signal for a given SSID. The RSSI
  value goes from 0 to -100 with 0 being the best signal.

  Args:
    ssid: optional, an SSID to search for.
    interface: the CWInterface to operate on.

  Returns:
    dict: CWNetwork objects keyed by the SSIDs.
Scan for networks nearby.
Scan for networks nearby .
def ScanForNetworks(ssid, interface=None):
  """Scan for networks nearby.

  Blocks until the association is complete.

  The call to scanForNetworksWithName_error_ will return a list of networks
  including many duplicates, so this function uses the rssiValue to pick
  the CWNetwork object with the strongest signal for a given SSID. The RSSI
  value goes from 0 to -100 with 0 being the best signal.

  Args:
    ssid: optional, an SSID to search for.
    interface: the CWInterface to operate on.

  Returns:
    dict: CWNetwork objects keyed by the SSIDs.
  """
  if not interface:
    interface = GetDefaultInterface()
    if not interface:
      return None

  SetInterfacePower(True, interface=interface)

  nw = {}

  networks, error = interface.scanForNetworksWithName_error_(ssid, None)

  if not networks:
    logging.debug('Failed to get networks. Error: %s', error)
    return nw

  for network in networks:
    network_ssid = network.ssid()
    if network_ssid not in nw:
      nw[network_ssid] = network
    else:
      if network.rssiValue() > nw[network_ssid].rssiValue():
        nw[network_ssid] = network

  return nw
def ScanForNetworks ( ssid , interface = None ) : if not interface : interface = GetDefaultInterface ( ) if not interface : return None SetInterfacePower ( True , interface = interface ) nw = { } networks , error = interface . scanForNetworksWithName_error_ ( ssid , None ) if not networks : logging . debug ( 'Failed to get networks. Error: %s' , error ) return nw for network in networks : network_ssid = network . ssid ( ) if network_ssid not in nw : nw [ network_ssid ] = network else : if network . rssiValue ( ) > nw [ network_ssid ] . rssiValue ( ) : nw [ network_ssid ] = network return nw