api/wifi: add GetAllAccessPoints() method

The original GetAccessPoints() method call never returned hidden SSID
access points.  That's useful though, and the new AccessPoints
property returns all of them too, so add this new method to return
all access points, including hidden SSID ones.
This commit is contained in:
Dan Williams 2014-01-08 11:40:56 -06:00
parent a0c4483bdb
commit 67676c65bf
2 changed files with 37 additions and 4 deletions

View file

@ -6,11 +6,27 @@
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_get_access_points"/>
<arg name="access_points" type="ao" direction="out">
<tp:docstring>
List of access point object paths
List of access point object paths.
</tp:docstring>
</arg>
<tp:docstring>
Get the list of access points visible to this device.
DEPRECATED. Get the list of access points visible to this device. Note
that this list does not include access points which hide their SSID. To
retrieve a list of all access points (including hidden ones) use the
GetAllAccessPoints() method.
</tp:docstring>
</method>
<method name="GetAllAccessPoints">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_get_all_access_points"/>
<arg name="access_points" type="ao" direction="out">
<tp:docstring>
List of access point object paths.
</tp:docstring>
</arg>
<tp:docstring>
Get the list of all access points visible to this device, including
hidden ones for which the SSID is not yet known.
</tp:docstring>
</method>

View file

@ -65,6 +65,10 @@ static gboolean impl_device_get_access_points (NMDeviceWifi *device,
GPtrArray **aps,
GError **err);
static gboolean impl_device_get_all_access_points (NMDeviceWifi *device,
GPtrArray **aps,
GError **err);
static void impl_device_request_scan (NMDeviceWifi *device,
GHashTable *options,
DBusGMethodInvocation *context);
@ -1376,9 +1380,8 @@ impl_device_get_access_points (NMDeviceWifi *self,
GSList *elt;
*aps = g_ptr_array_new ();
for (elt = priv->ap_list; elt; elt = g_slist_next (elt)) {
NMAccessPoint * ap = NM_AP (elt->data);
NMAccessPoint *ap = NM_AP (elt->data);
if (nm_ap_get_ssid (ap))
g_ptr_array_add (*aps, g_strdup (nm_ap_get_dbus_path (ap)));
@ -1386,6 +1389,20 @@ impl_device_get_access_points (NMDeviceWifi *self,
return TRUE;
}
static gboolean
impl_device_get_all_access_points (NMDeviceWifi *self,
GPtrArray **aps,
GError **err)
{
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
GSList *elt;
*aps = g_ptr_array_new ();
for (elt = priv->ap_list; elt; elt = g_slist_next (elt))
g_ptr_array_add (*aps, g_strdup (nm_ap_get_dbus_path (NM_AP (elt->data))));
return TRUE;
}
static void
request_scan_cb (NMDevice *device,
DBusGMethodInvocation *context,