def network_profiles(self, obj):
        """Get AP profiles."""

        networks = []
        network_ids = []
        network_summary = self._send_cmd_to_wpas(
            obj['name'],
            'LIST_NETWORKS',
            True)
        network_summary = network_summary[:-1].split('\n')
        if len(network_summary) == 1:
            return networks

        for l in network_summary[1:]:
            network_ids.append(l.split()[0])

        for network_id in network_ids:
            network = Profile()

            network.id = network_id

            ssid = self._send_cmd_to_wpas(
                obj['name'],
                'GET_NETWORK {} ssid'.format(network_id), True)
            if ssid.upper().startswith('FAIL'):
                continue
            else:
                network.ssid = ssid[1:-1]

            key_mgmt = self._send_cmd_to_wpas(
                obj['name'],
                'GET_NETWORK {} key_mgmt'.format(network_id),
                True)

            network.akm = []
            if key_mgmt.upper().startswith('FAIL'):
                continue
            else:
                if key_mgmt.upper() in ['WPA-PSK']:
                    proto = self._send_cmd_to_wpas(
                        obj['name'],
                        'GET_NETWORK {} proto'.format(network_id),
                        True)

                    if proto.upper() == 'RSN':
                        network.akm.append(AKM_TYPE_WPA2PSK)
                    else:
                        network.akm.append(AKM_TYPE_WPAPSK)
                elif key_mgmt.upper() in ['WPA-EAP']:
                    proto = self._send_cmd_to_wpas(
                        obj['name'],
                        'GET_NETWORK {} proto'.format(network_id),
                        True)

                    if proto.upper() == 'RSN':
                        network.akm.append(AKM_TYPE_WPA2)
                    else:
                        network.akm.append(AKM_TYPE_WPA)

            ciphers = self._send_cmd_to_wpas(
                obj['name'],
                'GET_NETWORK {} pairwise'.format(network_id),
                True).split(' ')

            if ciphers[0].upper().startswith('FAIL'):
                continue
            else:
                # Assume the possible ciphers TKIP and CCMP
                if len(ciphers) == 1:
                    network.cipher = cipher_str_to_value(ciphers[0].upper())
                elif 'CCMP' in ciphers:
                    network.cipher = CIPHER_TYPE_CCMP

            networks.append(network)

        return networks