318
253
nm_access_point_get_max_bitrate (NMAccessPoint *ap)
320
NMAccessPointPrivate *priv;
322
255
g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0);
324
priv = NM_ACCESS_POINT_GET_PRIVATE (ap);
325
if (!priv->max_bitrate) {
326
priv->max_bitrate = _nm_object_get_uint_property (NM_OBJECT (ap),
327
NM_DBUS_INTERFACE_ACCESS_POINT,
328
DBUS_PROP_MAX_BITRATE,
332
return priv->max_bitrate;
257
_nm_object_ensure_inited (NM_OBJECT (ap));
258
return NM_ACCESS_POINT_GET_PRIVATE (ap)->max_bitrate;
344
270
nm_access_point_get_strength (NMAccessPoint *ap)
346
NMAccessPointPrivate *priv;
348
272
g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0);
350
priv = NM_ACCESS_POINT_GET_PRIVATE (ap);
351
if (!priv->strength) {
352
priv->strength = _nm_object_get_byte_property (NM_OBJECT (ap),
353
NM_DBUS_INTERFACE_ACCESS_POINT,
358
return priv->strength;
274
_nm_object_ensure_inited (NM_OBJECT (ap));
275
return NM_ACCESS_POINT_GET_PRIVATE (ap)->strength;
362
* nm_access_point_filter_connections:
279
* nm_access_point_connection_valid:
363
280
* @ap: an #NMAccessPoint to validate @connection against
364
* @connections: an #NMConnection to validate against @ap
281
* @connection: an #NMConnection to validate against @ap
366
283
* Validates a given connection against a given WiFi access point to ensure that
367
284
* the connection may be activated with that AP. The connection must match the
475
392
* returned connections will match the @ap's SSID and (if given) BSSID and
476
393
* other attributes like security settings, channel, etc.
395
* To obtain the list of connections that are compatible with this access point,
396
* use nm_remote_settings_list_connections() and then filter the returned list
397
* for a given #NMDevice using nm_device_filter_connections() and finally
398
* filter that list with this function.
478
400
* Returns: (transfer container) (element-type NetworkManager.Connection): a
479
401
* list of #NMConnection objects that could be activated with the given @ap.
480
402
* The elements of the list are owned by their creator and should not be freed
593
register_for_property_changed (NMAccessPoint *ap)
515
register_properties (NMAccessPoint *ap)
595
517
NMAccessPointPrivate *priv = NM_ACCESS_POINT_GET_PRIVATE (ap);
596
const NMPropertiesChangedInfo property_changed_info[] = {
597
{ NM_ACCESS_POINT_FLAGS, _nm_object_demarshal_generic, &priv->flags },
598
{ NM_ACCESS_POINT_WPA_FLAGS, _nm_object_demarshal_generic, &priv->wpa_flags },
599
{ NM_ACCESS_POINT_RSN_FLAGS, _nm_object_demarshal_generic, &priv->rsn_flags },
600
{ NM_ACCESS_POINT_SSID, demarshal_ssid, &priv->ssid },
601
{ NM_ACCESS_POINT_FREQUENCY, _nm_object_demarshal_generic, &priv->frequency },
602
{ NM_ACCESS_POINT_HW_ADDRESS, _nm_object_demarshal_generic, &priv->bssid },
603
{ NM_ACCESS_POINT_MODE, _nm_object_demarshal_generic, &priv->mode },
604
{ NM_ACCESS_POINT_MAX_BITRATE, _nm_object_demarshal_generic, &priv->max_bitrate },
605
{ NM_ACCESS_POINT_STRENGTH, _nm_object_demarshal_generic, &priv->strength },
518
const NMPropertiesInfo property_info[] = {
519
{ NM_ACCESS_POINT_FLAGS, &priv->flags },
520
{ NM_ACCESS_POINT_WPA_FLAGS, &priv->wpa_flags },
521
{ NM_ACCESS_POINT_RSN_FLAGS, &priv->rsn_flags },
522
{ NM_ACCESS_POINT_SSID, &priv->ssid, demarshal_ssid },
523
{ NM_ACCESS_POINT_FREQUENCY, &priv->frequency },
524
{ NM_ACCESS_POINT_HW_ADDRESS, &priv->bssid },
525
{ NM_ACCESS_POINT_MODE, &priv->mode },
526
{ NM_ACCESS_POINT_MAX_BITRATE, &priv->max_bitrate },
527
{ NM_ACCESS_POINT_STRENGTH, &priv->strength },
609
_nm_object_handle_properties_changed (NM_OBJECT (ap),
611
property_changed_info);
531
_nm_object_register_properties (NM_OBJECT (ap),
615
constructor (GType type,
616
guint n_construct_params,
617
GObjectConstructParam *construct_params)
537
constructed (GObject *object)
620
539
NMAccessPointPrivate *priv;
622
object = (NMObject *) G_OBJECT_CLASS (nm_access_point_parent_class)->constructor (type,
541
G_OBJECT_CLASS (nm_access_point_parent_class)->constructed (object);
628
543
priv = NM_ACCESS_POINT_GET_PRIVATE (object);
630
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object),
545
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
632
nm_object_get_path (object),
547
nm_object_get_path (NM_OBJECT (object)),
633
548
NM_DBUS_INTERFACE_ACCESS_POINT);
635
register_for_property_changed (NM_ACCESS_POINT (object));
637
return G_OBJECT (object);
550
register_properties (NM_ACCESS_POINT (object));