def processWpaReturn(output):
    """
    Extract AP info from wpa_supplicant output

    Args:
        output, string by bytes 

    Returns:
        A list of dictionary with 3 fields: "ssid", "quality" and "signal"
    """
    lines = output.split('\n')
    length = len(lines)
    AP_info = []
    if length > 1:
        for i in range(1, length): # Start from the second line of output
            fields = lines[i].split('\t')
            if len(fields) < 5:
                continue
            bssid = fields[0]
            signal = fields[2]
            ssid = fields[-1]
            frequency = fields[1]
            AP = {'bssid': bssid, 'signal': signal, 'ssid': ssid+ '(' + frequency + ')'}
            AP_info.append(AP)
    else:
        print("Networks not detected.")
    return AP_info