QWlanManager
Loading...
Searching...
No Matches
qwm::Interface Class Reference

Class containing interface properties. More...

Public Member Functions

 Interface (const Interface &other)
 
 Interface (Interface &&other)
 
bool isValid () const
 Allow to know if an interface instance is valid.
 
bool isBusy () const
 Allow to know if an interface is busy.
 
IfaceState getState () const
 Retrieve current interface state.
 
IfaceOptions getOptions () const
 Retrieve current interface options.
 
const QUuid & getUid () const
 Retrieve interface Universally Unique Identifier (UUID)
 
const QString & getHwAddress () const
 Retrieve hardware address of the interface.
 
const QString & getName () const
 Retrieve interface name.
 
const QString & getDescription () const
 Retrieve interface description.
 
const CachePolicygetCachePolicy () const
 Retrieve interface cache policy.
 
const MapNetworksgetMapNetworks () const
 Retrieve all networks that interface has detected.
 
ListNetworks getListNetworks () const
 Retrieve all networks that interface has detected.
 
Network getNetwork (const QString &ssid) const
 Allow to retrieve a network via SSID.
 
Network getNetworkConnected () const
 Allow to retrieve interface current network.
 
void setCachePolicy (const CachePolicy &cachePolicy)
 Allow to set the cache policy of an interface.
 
void setOptions (IfaceOptions opts)
 Allow to set options of an interface.
 
Interfaceoperator= (const Interface &other)
 
Interfaceoperator= (Interface &&other) noexcept
 
bool operator== (const Interface &other) const
 Use to compare interface instances.
 
bool operator!= (const Interface &other) const
 

Properties

QUuid uid
 
QString hwAddress
 
QString name
 
QString description
 
CachePolicy cachePolicy
 
IfaceOptions options
 

Friends

class InterfaceMutator
 

Detailed Description

Class containing interface properties.

This class contains all related interface properties (status, name, list of networks, etc...).
This class use implicit sharing memory (via shared pointer), this allow to:

  • Always have an interface object with "last" known properties without having to fetch them from qwm::Manager
  • When setting properties, they are propagated to all instances
  • Passing this class by value is cheap This class is also compatible with QML.
See also
Manager::getInterfaces()

Member Function Documentation

◆ isValid()

bool qwm::Interface::isValid ( ) const

Allow to know if an interface instance is valid.

Returns
Returns true if interface is valid

◆ isBusy()

bool qwm::Interface::isBusy ( ) const

Allow to know if an interface is busy.

Returns
Returns true if interface is currently performing a request.

◆ getState()

IfaceState qwm::Interface::getState ( ) const

Retrieve current interface state.

Returns
Returns state of interface

◆ getOptions()

IfaceOptions qwm::Interface::getOptions ( ) const

Retrieve current interface options.

Returns
Returns options of interface
See also
setOptions()

◆ getUid()

const QUuid & qwm::Interface::getUid ( ) const

Retrieve interface Universally Unique Identifier (UUID)

Returns
Returns UUID of the interface

◆ getHwAddress()

const QString & qwm::Interface::getHwAddress ( ) const

Retrieve hardware address of the interface.

Returns
Returns hardware address of the interface.
The hardware address will be formatted as: AA:11:BB:22:CC:33

◆ getName()

const QString & qwm::Interface::getName ( ) const

Retrieve interface name.

Returns
Returns name of the interface

◆ getDescription()

const QString & qwm::Interface::getDescription ( ) const

Retrieve interface description.

Returns
Returns description of the interface

◆ getCachePolicy()

const CachePolicy & qwm::Interface::getCachePolicy ( ) const

Retrieve interface cache policy.

Returns
Returns cache policy of the interface

◆ getMapNetworks()

const MapNetworks & qwm::Interface::getMapNetworks ( ) const

Retrieve all networks that interface has detected.

Returns
Returns maps of available networks.
See also
getListNetworks()
Manager::doScan()

◆ getListNetworks()

ListNetworks qwm::Interface::getListNetworks ( ) const

Retrieve all networks that interface has detected.

Returns
Returns list of available networks.
See also
getMapNetworks()
Manager::doScan()

◆ getNetwork()

Network qwm::Interface::getNetwork ( const QString & ssid) const

Allow to retrieve a network via SSID.

Parameters
[in]ssidNetwork SSID to use.
If SSID is unknown/unavailable, returned network will be invalid.
Returns
Returns network related to the SSID.
See also
getNetworkConnected(), getMapNetworks(), getListNetworks()
Network::isValid()

◆ getNetworkConnected()

Network qwm::Interface::getNetworkConnected ( ) const

Allow to retrieve interface current network.

Returns
Returns current network of the interface. If interface is not connected, returned network will be invalid.
See also
getNetwork(), getMapNetworks(), getListNetworks()
Network::isValid()

◆ setCachePolicy()

void qwm::Interface::setCachePolicy ( const CachePolicy & cachePolicy)

Allow to set the cache policy of an interface.

Parameters
[in]cachePolicyCache policy to use.
See also
setOptions()

◆ setOptions()

void qwm::Interface::setOptions ( IfaceOptions opts)

Allow to set options of an interface.

Parameters
[in]optsOptions to use.
See also
getOptions()
setCachePolicy()

◆ operator==()

bool qwm::Interface::operator== ( const Interface & other) const

Use to compare interface instances.

Interface are considered equals if UUID are equals or if both are invalid.

Parameters
[in]otherOther interface to compare
Returns
Returns true if equals.
See also
getUid()

The documentation for this class was generated from the following files: