def AddAccessPoint(self, dev_path, ap_name, ssid, hw_address,
                   mode, frequency, rate, strength, security):
    '''Add an access point to an existing WiFi device.

    You have to specify WiFi Device path, Access Point object name,
    ssid, hw_address, mode, frequency, rate, strength and security.
    For valid access point property values, please visit
    http://projects.gnome.org/NetworkManager/developers/api/09/spec.html#org.freedesktop.NetworkManager.AccessPoint

    Please note that this does not set any global properties.

    Returns the new object path.
    '''
    dev_obj = dbusmock.get_object(dev_path)
    ap_path = '/org/freedesktop/NetworkManager/AccessPoint/' + ap_name
    if ap_path in dev_obj.access_points:
        raise dbus.exceptions.DBusException(
            'Access point %s on device %s already exists' % (ap_name, dev_path),
            name=MANAGER_IFACE + '.AlreadyExists')

    flags = NM80211ApFlags.NM_802_11_AP_FLAGS_PRIVACY
    if security == NM80211ApSecurityFlags.NM_802_11_AP_SEC_NONE:
        flags = NM80211ApFlags.NM_802_11_AP_FLAGS_NONE

    self.AddObject(ap_path,
                   ACCESS_POINT_IFACE,
                   {'Ssid': dbus.ByteArray(ssid.encode('UTF-8')),
                    'HwAddress': dbus.String(hw_address),
                    'Flags': dbus.UInt32(flags),
                    'LastSeen': dbus.Int32(1),
                    'Frequency': dbus.UInt32(frequency),
                    'MaxBitrate': dbus.UInt32(rate),
                    'Mode': dbus.UInt32(mode),
                    'RsnFlags': dbus.UInt32(security),
                    'WpaFlags': dbus.UInt32(security),
                    'Strength': dbus.Byte(strength)},
                   [])
    self.object_manager_emit_added(ap_path)

    dev_obj.access_points.append(ap_path)

    aps = dev_obj.Get(WIRELESS_DEVICE_IFACE, 'AccessPoints')
    aps.append(ap_path)
    dev_obj.Set(WIRELESS_DEVICE_IFACE, 'AccessPoints', aps)

    dev_obj.EmitSignal(WIRELESS_DEVICE_IFACE, 'AccessPointAdded', 'o', [ap_path])

    return ap_path
def AddAccessPoint ( self , dev_path , ap_name , ssid , hw_address , mode , frequency , rate , strength , security ) : dev_obj = dbusmock . get_object ( dev_path ) ap_path = '/org/freedesktop/NetworkManager/AccessPoint/' + ap_name if ap_path in dev_obj . access_points : raise dbus . exceptions . DBusException ( 'Access point %s on device %s already exists' % ( ap_name , dev_path ) , name = MANAGER_IFACE + '.AlreadyExists' ) flags = NM80211ApFlags . NM_802_11_AP_FLAGS_PRIVACY if security == NM80211ApSecurityFlags . NM_802_11_AP_SEC_NONE : flags = NM80211ApFlags . NM_802_11_AP_FLAGS_NONE self . AddObject ( ap_path , ACCESS_POINT_IFACE , { 'Ssid' : dbus . ByteArray ( ssid . encode ( 'UTF-8' ) ) , 'HwAddress' : dbus . String ( hw_address ) , 'Flags' : dbus . UInt32 ( flags ) , 'LastSeen' : dbus . Int32 ( 1 ) , 'Frequency' : dbus . UInt32 ( frequency ) , 'MaxBitrate' : dbus . UInt32 ( rate ) , 'Mode' : dbus . UInt32 ( mode ) , 'RsnFlags' : dbus . UInt32 ( security ) , 'WpaFlags' : dbus . UInt32 ( security ) , 'Strength' : dbus . Byte ( strength ) } , [ ] ) self . object_manager_emit_added ( ap_path ) dev_obj . access_points . append ( ap_path ) aps = dev_obj . Get ( WIRELESS_DEVICE_IFACE , 'AccessPoints' ) aps . append ( ap_path ) dev_obj . Set ( WIRELESS_DEVICE_IFACE , 'AccessPoints' , aps ) dev_obj . EmitSignal ( WIRELESS_DEVICE_IFACE , 'AccessPointAdded' , 'o' , [ ap_path ] ) return ap_path
Add an access point to an existing WiFi device.

    You have to specify WiFi Device path, Access Point object name,
    ssid, hw_address, mode, frequency, rate, strength and security.
    For valid access point property values, please visit
    http://projects.gnome.org/NetworkManager/developers/api/09/spec.html#org.freedesktop.NetworkManager.AccessPoint

    Please note that this does not set any global properties.

    Returns the new object path.