예제 #1
0
def connect_preconditions():
    print "checking preconditions for WiFi connection"
    # get list of saved networks
    savedssids = wpa_cli_mod.listsavednetwork("wlan0")
    print "Saved ssID =", savedssids
    if savedssids:
        # get all cells from the air
        ssids = []
        ssids = wifilist_ssid(3)

        print "ssID on air =", ssids
        logger.info("Final Number of scan SSID: %d", len(ssids))

        for ssid in savedssids:
            #print " Scheme ", scheme
            if ssid in ssids:
                print "At least one of WIFI network detected have saved credentials, ssid=", ssid
                logger.info(
                    "At least one of WIFI network can be connected, ssid=%s",
                    ssid)
                return ssid
    else:
        print "No Saved wifi network to connect to"
        logger.info("No Saved wifi network to connect to")
    print "No conditions to connect to wifi network"
    logger.info("No conditions to connect to wifi network")
    return ""
예제 #2
0
def connect_preconditions():
    print "checking preconditions for WiFi connection"
    # get all cells from the air
    ssids = []
    i = 0
    while (len(ssids) == 0 and i < 3):
        i = i + 1
        ssids = wifilist_ssid()

    print "ssID on air =", ssids
    logger.info("Number of scan SSID: %d", len(ssids))
    savedssids = wpa_cli_mod.listsavednetwork("wlan0")
    for ssid in savedssids:
        #print " Scheme ", scheme
        if ssid in ssids:
            print "At least one of WIFI network detected have saved credentials, ssid=", ssid
            return ssid
    print "No conditions to connect to wifi network"
    return ""
예제 #3
0
def connect_preconditions():
	print "checking preconditions for WiFi connection"
	# get all cells from the air
	ssids=[]
	i=0
	while (len(ssids)==0 and i<3):
		i=i+1
		ssids=wifilist_ssid()

	print "ssID on air =", ssids
	logger.info("Number of scan SSID: %d",len(ssids))
	savedssids = wpa_cli_mod.listsavednetwork("wlan0")
	for ssid in savedssids:
		#print " Scheme ", scheme
		if ssid in ssids:
			print "At least one of WIFI network detected have saved credentials, ssid=" , ssid
			logger.info("At least one of WIFI network can be connected, ssid=%s" , ssid)
			return ssid
	print "No conditions to connect to wifi network"
	logger.info("No conditions to connect to wifi network")
	return ""
예제 #4
0
def savedwifilist_ssid():
    # get all setting from interfaces file
    return wpa_cli_mod.listsavednetwork('wlan0')
예제 #5
0
def savedwifilist_ssid():
	# get all setting from interfaces file
	return wpa_cli_mod.listsavednetwork('wlan0')