API documentation

Interface

Inheritance diagram of pyconnman.interface

class pyconnman.interface.ConnInterface(path, addr)[source]

Bases: pyconnman.interface.ConnSimpleInterface

Wrapper around dbus to encapsulated a connman interface entry point e.g., an adapter, a device, etc.

Parameters:
  • path (str) – Object path pertaining to the interface to open e.g., ‘/net/connman/service/ethernet_b827ebaf24d8_cable’
  • addr (str) – dbus address of the interface instance to open e.g., ‘net.connman.Service’

Note

This class should always be sub-classed with a concrete implementation of a connman interface which has both signals and properties.

SIGNAL_PROPERTY_CHANGED = u'PropertyChanged'
Signal PropertyChanged(sig_name, user_arg, prop_name, prop_value):
 Signal notifying when a property has changed.
add_signal_receiver(callback_fn, signal, user_arg)[source]

Add a signal receiver callback with user argument

See also remove_signal_receiver(), ConnSignalNameNotRecognisedException

Parameters:
  • callback_fn (func) – User-defined callback function to call when signal triggers
  • signal (str) – Signal name e.g., ConnInterface.SIGNAL_PROPERTY_CHANGED
  • user_arg – User-defined callback argument to be passed with callback function
Returns:

Raises ConnSignalNameNotRecognisedException:
 

if the signal name is not registered

get_property(name=None)[source]

Helper to get a property value by name or all properties as a dictionary.

See also set_property()

Parameters:

name (str) – Defaults to None which means all properties in the object’s dictionary are returned as a dict. Otherwise, the property name key is used and its value is returned.

Returns:

Property value by property key, or a dictionary of all properties

Raises:
  • KeyError – if the property key is not found in the object’s dictionary
  • dbus.Exception – [service].Error.InvalidArguments
remove_signal_receiver(signal)[source]

Remove an installed signal receiver by signal name.

See also add_signal_receiver() exceptions.ConnSignalNameNotRecognisedException

Parameters:signal (str) – Signal name to uninstall e.g., SIGNAL_PROPERTY_CHANGED
Returns:
Raises ConnSignalNameNotRecognisedException:
 if the signal name is not registered
set_property(name, value)[source]

Helper to set a property value by name, translating to correct dbus type

See also get_property()

Parameters:
  • name (str) – The property name in the object’s dictionary whose value shall be set.
  • value – Properties new value to be assigned.
Returns:

Raises:
  • KeyError – if the property key is not found in the object’s dictionary
  • dbus.Exception – [service].Error.InvalidProperty
  • dbus.Exception – [service].Error.InvalidArguments
class pyconnman.interface.ConnSimpleInterface(path, addr)[source]

Wrapper around dbus to encapsulated a connman simple interface entry point (i.e., has no signals or properties).

Parameters:
  • path (str) – Object path pertaining to the interface to open e.g., ‘/net/connman/service/ethernet_b827ebaf24d8_cable’
  • addr (str) – dbus address of the interface instance to open e.g., ‘net.connman.Service’

Note

This class should always be sub-classed with a concrete implementation of a connman interface which has no signals or properties.

class pyconnman.interface.Signal(signal, user_callback, user_arg)[source]

Encapsulation of user callback wrapper for signals fired by dbus. This allows us to prepend the signal name and the user callback argument.

Parameters:
  • signal (str) – Signal name
  • user_callback (func) – User-defined callback function to call when the signal triggers
  • user_arg – User-defined callback argument to be passed as callback function
signal_handler(*args)[source]

Method to call in order to invoke the user callback.

Parameters:args – list of signal-dependent arguments
Returns:
pyconnman.interface.translate_to_dbus_type(typeof, value)[source]

Helper function to map values from their native Python types to dbus types.

Parameters:
  • typeof (type) – Target for type conversion e.g., ‘dbus.Dictionary’
  • value – Value to assign using type ‘typeof’
Returns:

‘value’ converted to type ‘typeof’

Return type:

typeof

Manager

Inheritance diagram of pyconnman.manager

class pyconnman.manager.ConnManager[source]

Bases: pyconnman.interface.ConnInterface

Wrapper around dbus to encapsulate the net.connman.Manager interface which notionally is used to manage all network connections.

Properties :
  • State(str) [readonly]:

    The global connection state of a system. Possible values are “offline”, “idle”, “ready” and “online”.

    If the device is in offline mode, the value “offline” indicates this special global state. It can also be retrieved via the OfflineMode property, but is kept here for consistency and to differentiate from “idle”.

    However when OfflineMode property is true, the State property can still be “idle”, “ready” or “online” since it is possible by the end user to re-enable individual technologies like WiFi and Bluetooth while in offline mode.

    The states “idle”, “ready” and “online” match to states from the services. If no service is in either “ready” or “online” state it will indicate the “idle” state.

    If at least one service is in “ready” state and no service is in “online” state, then it will indicate the “ready” state.

    When at least one service is in “online” state, this property will indicate “online” as well.

  • OfflineMode(boolean) [readwrite]:

    The offline mode indicates the global setting for switching all radios on or off. Changing offline mode to true results in powering down all devices. When leaving offline mode the individual policy of each device decides to switch the radio back on or not.

    During offline mode, it is still possible to switch certain technologies manually back on. For example the limited usage of WiFi or Bluetooth devices might be allowed in some situations.

See also ConnService and ConnTechnology

SIGNAL_SERVICES_CHANGED = u'ServicesChanged'
:signal ServicesChanged(signal_name, user_arg,
array{object, dict}, array{object}):

Signals a list of services that have been changed via the first array. And a list of service that have been removed via the second array.

The list of added services is sorted. The dictionary with the properties might be empty in case none of the properties have changed. Or only contains the properties that have changed.

For newly added services the whole set of properties will be present.

The list of removed services can be empty.

This signal will only be triggered when the sort order of the service list or the number of services changes. It will not be emitted if only a property of the service object changes. For that it is required to watch the SIGNAL_PROPERTY_CHANGED signal of the service object.

SIGNAL_TECHNOLOGY_ADDED = u'TechnologyAdded'
Signal TechnologyAdded(signal_name, user_arg, object_path, props):
 

Signal that is sent when a new technology is added.

It contains the object path of the technology and also its properties.

SIGNAL_TECHNOLOGY_REMOVED = u'TechnologyRemoved'
Signal TechnologyRemoved(signal_name, user_arg, object_path):
 

Signal that is sent when a technology has been removed.

The object path is no longer accessible after this signal and only emitted for reference.

add_signal_receiver(callback_fn, signal, user_arg)

Add a signal receiver callback with user argument

See also remove_signal_receiver(), ConnSignalNameNotRecognisedException

Parameters:
  • callback_fn (func) – User-defined callback function to call when signal triggers
  • signal (str) – Signal name e.g., ConnInterface.SIGNAL_PROPERTY_CHANGED
  • user_arg – User-defined callback argument to be passed with callback function
Returns:

Raises ConnSignalNameNotRecognisedException:
 

if the signal name is not registered

get_property(name=None)

Helper to get a property value by name or all properties as a dictionary.

See also set_property()

Parameters:

name (str) – Defaults to None which means all properties in the object’s dictionary are returned as a dict. Otherwise, the property name key is used and its value is returned.

Returns:

Property value by property key, or a dictionary of all properties

Raises:
  • KeyError – if the property key is not found in the object’s dictionary
  • dbus.Exception – [service].Error.InvalidArguments
get_services()[source]

Returns a sorted list of tuples with service object path and dictionary of service properties.

This list will not contain sensitive information like passphrases etc.

Returns:List of tuples containing object path,dict
Return type:array{object,dict}
Raises dbus.Exception:
 net.connman.Manager.Error.InvalidArguments
get_technologies()[source]

Returns a list of tuples with technology object path and dictionary of technology properties.

Returns:List of tuples containing object path,dict
Return type:array{object,dict}
Raises dbus.Exception:
 net.connman.Manager.Error.InvalidArguments
register_agent(path)[source]

Register new agent for handling user requests.

Returns:
Raises dbus.Exception:
 net.connman.Manager.Error.InvalidArguments
remove_signal_receiver(signal)

Remove an installed signal receiver by signal name.

See also add_signal_receiver() exceptions.ConnSignalNameNotRecognisedException

Parameters:signal (str) – Signal name to uninstall e.g., SIGNAL_PROPERTY_CHANGED
Returns:
Raises ConnSignalNameNotRecognisedException:
 if the signal name is not registered
set_property(name, value)

Helper to set a property value by name, translating to correct dbus type

See also get_property()

Parameters:
  • name (str) – The property name in the object’s dictionary whose value shall be set.
  • value – Properties new value to be assigned.
Returns:

Raises:
  • KeyError – if the property key is not found in the object’s dictionary
  • dbus.Exception – [service].Error.InvalidProperty
  • dbus.Exception – [service].Error.InvalidArguments
unregister_agent(path)[source]

Unregister an existing agent.

Returns:
Raises dbus.Exception:
 net.connman.Manager.Error.InvalidArguments

Technology

Inheritance diagram of pyconnman.technology

class pyconnman.technology.ConnTechnology(obj_path)[source]

Bases: pyconnman.interface.ConnInterface

Wrapper around dbus to encapsulate the net.connman.Technology interface which notionally is used to manage network technologies e.g., ethernet, wifi, bluetooth.

Parameters:obj_path (str) – Object path pertaining to the interface to open e.g., ‘/net/connman/technology/wifi’
Properties :
  • Powered(boolean) [readwrite]:

    Boolean representing the power state of the technology. False means that the technology is off (and is available RF-Killed) while True means that the technology is enabled.

  • Connected(boolean) [readonly]:

    Boolean representing if a technology is connected.

    This is just a convience property for allowing the UI to easily show if this technology has an active connection or not.

    If this property is True it means that at least one service of this technology is in ready state.

  • Name(string) [readonly]:

    Name of this technology.

  • Type(string) [readonly]:

    The technology type (for example “ethernet” etc.)

    This information should only be used to determine advanced properties or showing the correct icon to the user.

  • Tethering(boolean) [readwrite]:

    This option allows to enable or disable the support for tethering. When tethering is enabled then the default service is bridged to all clients connected through the technology.

  • TetheringIdentifier(string) [readwrite]:

    The tethering broadcasted identifier.

    This property is only valid for the WiFi technology, and is then mapped to the WiFi AP SSID clients will have to join in order to gain internet connectivity.

  • TetheringPassphrase(string) [readwrite]:

    The tethering connection passphrase.

    This property is only valid for the WiFi technology, and is then mapped to the WPA pre-shared key clients will have to use in order to establish a connection.

add_signal_receiver(callback_fn, signal, user_arg)

Add a signal receiver callback with user argument

See also remove_signal_receiver(), ConnSignalNameNotRecognisedException

Parameters:
  • callback_fn (func) – User-defined callback function to call when signal triggers
  • signal (str) – Signal name e.g., ConnInterface.SIGNAL_PROPERTY_CHANGED
  • user_arg – User-defined callback argument to be passed with callback function
Returns:

Raises ConnSignalNameNotRecognisedException:
 

if the signal name is not registered

get_property(name=None)

Helper to get a property value by name or all properties as a dictionary.

See also set_property()

Parameters:

name (str) – Defaults to None which means all properties in the object’s dictionary are returned as a dict. Otherwise, the property name key is used and its value is returned.

Returns:

Property value by property key, or a dictionary of all properties

Raises:
  • KeyError – if the property key is not found in the object’s dictionary
  • dbus.Exception – [service].Error.InvalidArguments
remove_signal_receiver(signal)

Remove an installed signal receiver by signal name.

See also add_signal_receiver() exceptions.ConnSignalNameNotRecognisedException

Parameters:signal (str) – Signal name to uninstall e.g., SIGNAL_PROPERTY_CHANGED
Returns:
Raises ConnSignalNameNotRecognisedException:
 if the signal name is not registered
scan()[source]

Trigger a scan for this specific technology. The method call will return when a scan has been finished and results are available. So setting a longer D-Bus timeout might be a really good idea.

Results will be signaled via the ServicesChanged signal from the manager interface.

In case of P2P technology, results will be signaled via the PeersChanged signal from the manager interface.

Returns:
set_property(name, value)

Helper to set a property value by name, translating to correct dbus type

See also get_property()

Parameters:
  • name (str) – The property name in the object’s dictionary whose value shall be set.
  • value – Properties new value to be assigned.
Returns:

Raises:
  • KeyError – if the property key is not found in the object’s dictionary
  • dbus.Exception – [service].Error.InvalidProperty
  • dbus.Exception – [service].Error.InvalidArguments

Service

Inheritance diagram of pyconnman.service

class pyconnman.service.ConnService(obj_path)[source]

Bases: pyconnman.interface.ConnInterface

Wrapper around dbus to encapsulate the net.connman.Service interface which notionally is used to manage network services and their connections.

Parameters:obj_path (str) – Object path pertaining to the interface to open e.g., ‘/net/connman/service/ethernet_b827ebaf24d8_cable’
Properties :
  • State(string) [readonly]:

    The service state information.

    Valid states are “idle”, “failure”, “association”, “configuration”, “ready”, “disconnect” and “online”.

    The “ready” state signals a successfully connected device. “online” signals that an Internet connection is available and has been verified.

    See doc/overview-api.txt for more information about state transitions.

  • Error(string) [readonly]:

    The service error status details.

    When error occur during connection or disconnection the detailed information is represented in this property to help the user interface to present the user with alternate options.

    This property is only valid when the service is in the “failure” state. Otherwise it might be empty or not present at all.

    Currently defined error code is “dhcp-failed”.

  • Name(string) [readonly]:

    The service name (for example “Wireless” etc.)

    This name can be used for directly displaying it in the application. It has pure informational purpose and no attempt should be made to translate it.

    For Ethernet devices and hidden WiFi networks this property is not present.

  • Type(string) [readonly]:

    The service type (for example “ethernet”, “wifi” etc.)

    This information should only be used to determine advanced properties or showing the correct icon to the user.

    Together with a missing Name property, this can be used to identify hidden WiFi networks.

  • Security(array{string}) [readonly]:

    If the service type is WiFi, then this property is present and contains the list of security methods or key management settings.

    Possible values are “none”, “wep”, “psk”, “ieee8021x” and also “wps”.

    This property might be only present for WiFi services.

  • Strength(uint8) [readonly]:

    Indicates the signal strength of the service. This is a normalized value between 0 and 100.

    This property will not be present for Ethernet devices.

  • Favorite(boolean) [readonly]:

    Will be true if a cable is plugged in or the user selected and successfully connected to this service.

    This value is automatically changed and to revert it back to false the Remove() method needs to be used.

  • Immutable(boolean) [readonly]:

    This value will be set to true if the service is configured externally via a configuration file.

    The only valid operation are Connect() and of course Disconnect(). The Remove() method will result in an error.

  • AutoConnect(boolean) [readwrite]:

    If set to true, this service will auto-connect when no other connection is available.

    The service won’t auto-connect while roaming.

    For favorite services it is possible to change this value to prevent or permit automatic connection attempts.

  • Roaming(boolean) [readonly]:

    This property indicates if this service is roaming.

    In the case of Cellular services this normally indicates connections to a foreign provider when traveling abroad.

  • Nameservers(array{string}) [readonly]:

    The list of currently active nameservers for this service. If the server is not in READY or ONLINE state than this list will be empty.

    Global nameservers are automatically added to this list. The array represents a sorted list of the current nameservers. The first one has the highest priority and is used by default.

    When using DHCP this array represents the nameservers provided by the network. In case of manual settings, the ones from Nameservers.Configuration are used.

  • Nameservers.Configuration(array{string}) [readonly]:

    The list of manually configured domain name servers. Some cellular networks don’t provide correct name servers and this allows for an override.

    This array is sorted by priority and the first entry in the list represents the nameserver with the highest priority.

    When using manual configuration and no global nameservers are configured, then it is useful to configure this setting.

    Changes to the domain name servers can be done at any time. It will not cause a disconnect of the service. However there might be small window where name resolution might fail.

  • Timeservers(array{string}) [readonly]:

    The list of currently active timeservers for this service. If the server is not in READY or ONLINE state than this list will be empty.

  • Timerserves.Configuration(array{string}) [readwrite]:

    The list of manually configured time servers.

    The first entry in the list represents the timeserver with the highest priority.

    When using manual configuration this setting is useful to override all the other timeserver settings. This is service specific, hence only the values for the default service are used.

    Changes to this property will result in restart of NTP query.

  • Domains(array{string}) [readonly]:

    The list of currently used search domains taken from Domains.Configurations if set, otherwise a domain name if provided by DHCP or VPNs.

  • Domains.Configuration(array{string}) [readwrite]:

    The list of manually configured search domains.

  • IPv4(dict) [readonly]:

    • Method(string) [readonly]:

      Possible values are “dhcp”, “manual” and “off”.

      The value “fixed” indicates an IP address that can not be modified. For example cellular networks return fixed information.

    • Address(string) [readonly]:

      The current configured IPv4 address.

    • Netmask(string) [readonly]:

      The current configured IPv4 netmask.

    • Gateway(string) [readonly]:

      The current configured IPv4 gateway.

  • IPv4.Configuration(dict) [readwrite]:

    Same values as IPv4 property. The IPv4 represents the actual system configuration while this allows user configuration.

    Changing these settings will cause a state change of the service. The service will become unavailable until the new configuration has been successfully installed.

  • IPv6(dict) [readonly]:

    • Method(string) [readonly]:

      Possible values are “auto”, “manual”, “6to4” and “off”.

      The value “fixed” indicates an IP address that can not be modified. For example cellular networks return fixed information. The value “6to4” is returned if 6to4 tunnel is created by connman. The tunnel can only be created if method was set to “auto” by the user. User cannot set the method to “6to4”.

    • Address(string) [readonly]:

      The current configured IPv6 address.

    • PrefixLength(uint8) [readonly]:

      The prefix length of the IPv6 address.

    • Gateway(string) [readonly]:

      The current configured IPv6 gateway.

    • Privacy(string) [readonly]:

      Enable or disable IPv6 privacy extension that is described in RFC 4941. The value has only meaning if Method is set to “auto”.

      Value “disabled” means that privacy extension is disabled and normal autoconf addresses are used.

      Value “enabled” means that privacy extension is enabled and system prefers to use public addresses over temporary addresses.

      Value “prefered” means that privacy extension is enabled and system prefers temporary addresses over public addresses.

      Default value is “disabled”.

  • IPv6.Configuration(dict) [readwrite]:

    Same values as IPv6 property. The IPv6 represents the actual system configuration while this allows user configuration.

    Changing these settings will cause a state change of the service. The service will become unavailable until the new configuration has been successfully installed.

  • Proxy(dict) [readonly]:

    • Method(string) [readonly]:

      Possible values are “direct”, “auto” and “manual”.

      In case of “auto” method, the URL file can be provided unless you want to let DHCP/WPAD auto-discover to be tried. In such case if DHCP and WPAD auto-discover methods fails then method will be “direct”.

      In case of “direct” no additional information are provided. For the “manual” method the Servers have to be set, Excludes is optional.

    • URL(string) [readonly]:

      Automatic proxy configuration URL. Used by “auto” method.

    • Servers(array{string}) [readonly]:

      Used when “manual” method is set.

      List of proxy URIs. The URI without a protocol will be interpreted as the generic proxy URI. All others will target a specific protocol and only once.

      Example for generic proxy server entry would be like this: “server.example.com:911”.

    • Excludes(array{string}) [readonly]:

      Used when “manual” method is set.

      List of hosts which can be accessed directly.

  • Proxy.Configuration(dict) [readwrite]:

    Same values as Proxy property. The Proxy represents the actual system configuration while this allows user configuration.

    If “auto” method is set with an empty URL, then DHCP/WPAD auto-discover will be tried. Otherwise the specified URL will be used.

  • Provider(dict) [readonly]:

    • Host(string) [readonly]:

      VPN host IP.

    • Domain(string) [readonly]:

      VPN Domain.

    • Name(string) [readonly]:

      VPN provider Name.

    • Type(string) [readonly]:

      VPN provider type.

  • Ethernet(dict) [readonly]:

    • Method(string) [readonly]:

      Possible values are “auto” and “manual”.

    • Interface(string) [readonly]:

      Interface name (for example eth0).

    • Address(string) [readonly]

      Ethernet device address (MAC address).

    • MTU(uint16) [readonly]:

      The Ethernet MTU (default is 1500).

    • Speed(uint16) [readonly] [deprecated]:

      Selected speed of the line.

      This information is not available.

    • Duplex(string) [readonly] [deprecated]:

      Selected duplex settings of the line. Possible values are “half” and “full”.

      This information is not available.

add_signal_receiver(callback_fn, signal, user_arg)

Add a signal receiver callback with user argument

See also remove_signal_receiver(), ConnSignalNameNotRecognisedException

Parameters:
  • callback_fn (func) – User-defined callback function to call when signal triggers
  • signal (str) – Signal name e.g., ConnInterface.SIGNAL_PROPERTY_CHANGED
  • user_arg – User-defined callback argument to be passed with callback function
Returns:

Raises ConnSignalNameNotRecognisedException:
 

if the signal name is not registered

clear_property(name)[source]

Clears the value of the specified property.

Properties cannot be cleared for hidden WiFi service entries or provisioned services.

Returns:

Raises:
  • dbus.Exception – net.connman.Service.Error.InvalidArguments
  • dbus.Exception – net.connman.Service.Error.InvalidProperty
connect()[source]

Connect this service. It will attempt to connect WiFi or Bluetooth services.

For Ethernet devices this method can only be used if it has previously been disconnected. Otherwise the plugging of a cable will trigger connecting automatically. If no cable is plugged in this method will fail.

This method call will only return in case of an error or when the service is fully connected. So setting a longer D-Bus timeout might be a really good idea.

Calling Connect() on a hidden WiFi service entry will query the missing SSID via the Agent API causing a WiFi service with the given SSID to be scanned, created and connected.

Returns:
Raises dbus.Exception:
 net.connman.Service.Error.InvalidArguments
disconnect()[source]

Disconnect this service. If the service is not connected an error message will be generated.

On Ethernet devices this will disconnect the IP details from the service. It will not magically unplug the cable. When no cable is plugged in this method will fail.

This method can also be used to abort a previous connection attempt via the Connect method.

Hidden WiFi service entries cannot be disconnected as they always stay in idle state.

Returns:
Raises dbus.Exception:
 net.connman.Service.Error.InvalidArguments
get_property(name=None)

Helper to get a property value by name or all properties as a dictionary.

See also set_property()

Parameters:

name (str) – Defaults to None which means all properties in the object’s dictionary are returned as a dict. Otherwise, the property name key is used and its value is returned.

Returns:

Property value by property key, or a dictionary of all properties

Raises:
  • KeyError – if the property key is not found in the object’s dictionary
  • dbus.Exception – [service].Error.InvalidArguments
move_after(obj_path)[source]

If a service has been used before, this allows a reorder of the favorite services.

Parameters:obj_path (string) – Service’s object path to move this object before
Returns:
Raises dbus.Exception:
 net.connman.Service.Error.InvalidArguments
move_before(obj_path)[source]

If a service has been used before, this allows a reorder of the favorite services.

Parameters:obj_path (string) – Service’s object path to move this object before
Returns:
Raises dbus.Exception:
 net.connman.Service.Error.InvalidArguments
remove()[source]

A successfully connected service with Favorite=true can be removed this way. If it is connected, it will be automatically disconnected first.

If the service requires a passphrase it will be cleared and forgotten when removing.

This is similar to setting the Favorite property to false, but that is currently not supported.

In the case a connection attempt failed and the service is in the State=failure, this method can also be used to reset the service.

Calling this method on Ethernet devices, hidden WiFi services or provisioned services will cause an error message. It is not possible to remove these kind of services.

Returns:
Raises dbus.Exception:
 net.connman.Service.Error.InvalidArguments
remove_signal_receiver(signal)

Remove an installed signal receiver by signal name.

See also add_signal_receiver() exceptions.ConnSignalNameNotRecognisedException

Parameters:signal (str) – Signal name to uninstall e.g., SIGNAL_PROPERTY_CHANGED
Returns:
Raises ConnSignalNameNotRecognisedException:
 if the signal name is not registered
reset_counters()[source]

[experimental] Reset the counter statistics.

set_property(name, value)

Helper to set a property value by name, translating to correct dbus type

See also get_property()

Parameters:
  • name (str) – The property name in the object’s dictionary whose value shall be set.
  • value – Properties new value to be assigned.
Returns:

Raises:
  • KeyError – if the property key is not found in the object’s dictionary
  • dbus.Exception – [service].Error.InvalidProperty
  • dbus.Exception – [service].Error.InvalidArguments

Agent

Inheritance diagram of pyconnman.agent

class pyconnman.agent.GenericAgent(obj_path)[source]

Bases: dbus.service.Object

Generic agent service object class.

Note

GenericAgent can’t be directly instantiated. It should be sub-classed and provides a template for implementing an agent service object.

Parameters:obj_path (str) – Freely definable object path for the agent service e.g., ‘/agent/netman’.
Introspect(object_path, connection)

Return a string of XML encoding this object’s supported interfaces, methods and signals.

add_to_connection(connection, path)

Make this object accessible via the given D-Bus connection and object path.

Parameters :
connection : dbus.connection.Connection

Export the object on this connection. If the class attribute SUPPORTS_MULTIPLE_CONNECTIONS is False (default), this object can only be made available on one connection; if the class attribute is set True by a subclass, the object can be made available on more than one connection.

path : dbus.ObjectPath or other str

Place the object at this object path. If the class attribute SUPPORTS_MULTIPLE_OBJECT_PATHS is False (default), this object can only be made available at one object path; if the class attribute is set True by a subclass, the object can be made available with more than one object path.

Raises ValueError:
 

if the object’s class attributes do not allow the object to be exported in the desired way.

Since :

0.82.0

connection

The Connection on which this object is available. Access raises AttributeError if there is no Connection, or more than one Connection.

Changed in 0.82.0: AttributeError can be raised.

locations

An iterable over tuples representing locations at which this object is available.

Each tuple has at least two items, but may have more in future versions of dbus-python, so do not rely on their exact length. The first two items are the dbus.connection.Connection and the object path.

Since :0.82.0
remove_from_connection(connection=None, path=None)

Make this object inaccessible via the given D-Bus connection and object path. If no connection or path is specified, the object ceases to be accessible via any connection or path.

Parameters :
connection : dbus.connection.Connection or None

Only remove the object from this Connection. If None, remove from all Connections on which it’s exported.

path : dbus.ObjectPath or other str, or None

Only remove the object from this object path. If None, remove from all object paths.

Raises LookupError:
 

if the object was not exported on the requested connection or path, or (if both are None) was not exported at all.

Since :

0.81.1

class pyconnman.agent.SimpleWifiAgent(obj_path)[source]

Bases: pyconnman.agent.GenericAgent

SimpleWifiAgent is a service agent that allows the user to join WiFi networks through a variety of different WiFi access security schemes.

The agent is invoked whenever a ‘connect’ request is made on a service using the ‘wifi’ technology, depending on the security policy in place.

See GenericAgent which describes in more detail the different security schemes supported and use-cases.

Introspect(object_path, connection)

Return a string of XML encoding this object’s supported interfaces, methods and signals.

add_to_connection(connection, path)

Make this object accessible via the given D-Bus connection and object path.

Parameters :
connection : dbus.connection.Connection

Export the object on this connection. If the class attribute SUPPORTS_MULTIPLE_CONNECTIONS is False (default), this object can only be made available on one connection; if the class attribute is set True by a subclass, the object can be made available on more than one connection.

path : dbus.ObjectPath or other str

Place the object at this object path. If the class attribute SUPPORTS_MULTIPLE_OBJECT_PATHS is False (default), this object can only be made available at one object path; if the class attribute is set True by a subclass, the object can be made available with more than one object path.

Raises ValueError:
 

if the object’s class attributes do not allow the object to be exported in the desired way.

Since :

0.82.0

connection

The Connection on which this object is available. Access raises AttributeError if there is no Connection, or more than one Connection.

Changed in 0.82.0: AttributeError can be raised.

locations

An iterable over tuples representing locations at which this object is available.

Each tuple has at least two items, but may have more in future versions of dbus-python, so do not rely on their exact length. The first two items are the dbus.connection.Connection and the object path.

Since :0.82.0
remove_from_connection(connection=None, path=None)

Make this object inaccessible via the given D-Bus connection and object path. If no connection or path is specified, the object ceases to be accessible via any connection or path.

Parameters :
connection : dbus.connection.Connection or None

Only remove the object from this Connection. If None, remove from all Connections on which it’s exported.

path : dbus.ObjectPath or other str, or None

Only remove the object from this object path. If None, remove from all object paths.

Raises LookupError:
 

if the object was not exported on the requested connection or path, or (if both are None) was not exported at all.

Since :

0.81.1

Exceptions

Inheritance diagram of pyconnman.exceptions

class pyconnman.exceptions.ConnSignalNameNotRecognisedException[source]

Exception raised for when a signal name is not recognized. Check the originating class for a list of supported signal names