trikRuntime
trikWiFi::TrikWiFiWorker Class Reference

Worker object for TrikWiFi, supposed to be runned in its own thread. More...

#include <trikWiFiWorker.h>

Inheritance diagram for trikWiFi::TrikWiFiWorker:
Collaboration diagram for trikWiFi::TrikWiFiWorker:

Signals

void scanFinished ()
 Emitted when scanning for available networks initiated by scan() is finished and results are available and ready to be obtained by scanResults method. More...
 
void connected ()
 Emitted when wpa_supplicant connects to WiFi network. SSID of this network can be retrieved by status() method. More...
 
void disconnected (trikWiFi::DisconnectReason reason)
 Emitted when wpa_supplicant disconnects from current network. More...
 
void statusReady ()
 Emitted when connection status requested by statusRequest() is ready and results can be obtained by statusResult() method. More...
 
void error (const QString &message)
 Emitted when something goes wrong. More...
 

Public Member Functions

 TrikWiFiWorker (const QString &interfaceFilePrefix, const QString &daemonFile)
 Constructor. More...
 
 ~TrikWiFiWorker () override
 
Q_INVOKABLE void connect (const QString &ssid)
 Connect to a network with given ssid. More...
 
Q_INVOKABLE void disconnect ()
 Disconnect from network if we are currently connected to one. More...
 
Q_INVOKABLE void reinit ()
 Disposes an old connection to wpa_supplicant and creates a new one. More...
 
Q_INVOKABLE void dispose ()
 Closes the connection to wpa_supplicant. More...
 
Q_INVOKABLE void statusRequest ()
 Gets conection status and connection information such as SSID and IP. More...
 
Status statusResult ()
 Returns last known connection status. To refresh, use statusRequest() method. More...
 
Q_INVOKABLE void scanRequest ()
 Scans for available WiFi networks. More...
 
QList< ScanResultscanResult ()
 Returns a list of currently known available WiFi networks. Use scanRequest() method to refresh. More...
 

Detailed Description

Worker object for TrikWiFi, supposed to be runned in its own thread.

Constructor & Destructor Documentation

TrikWiFiWorker::TrikWiFiWorker ( const QString &  interfaceFilePrefix,
const QString &  daemonFile 
)

Constructor.

Parameters
interfaceFilePrefix- path and prefix of file names that are used by this library to communicate with wpa_supplicant.
daemonFile- file that wpa_supplicant uses to communicate with clients, something like /run/wpa_supplicant/wlan0.
TrikWiFiWorker::~TrikWiFiWorker ( )
override

Member Function Documentation

void TrikWiFiWorker::connect ( const QString &  ssid)

Connect to a network with given ssid.

void trikWiFi::TrikWiFiWorker::connected ( )
signal

Emitted when wpa_supplicant connects to WiFi network. SSID of this network can be retrieved by status() method.

void TrikWiFiWorker::disconnect ( )

Disconnect from network if we are currently connected to one.

void trikWiFi::TrikWiFiWorker::disconnected ( trikWiFi::DisconnectReason  reason)
signal

Emitted when wpa_supplicant disconnects from current network.

void TrikWiFiWorker::dispose ( )

Closes the connection to wpa_supplicant.

void trikWiFi::TrikWiFiWorker::error ( const QString &  message)
signal

Emitted when something goes wrong.

void TrikWiFiWorker::reinit ( )

Disposes an old connection to wpa_supplicant and creates a new one.

void trikWiFi::TrikWiFiWorker::scanFinished ( )
signal

Emitted when scanning for available networks initiated by scan() is finished and results are available and ready to be obtained by scanResults method.

void TrikWiFiWorker::scanRequest ( )

Scans for available WiFi networks.

When done, sends scanFinished() signal, then scan results can be obtained via scanResult() method.

QList< ScanResult > TrikWiFiWorker::scanResult ( )

Returns a list of currently known available WiFi networks. Use scanRequest() method to refresh.

void trikWiFi::TrikWiFiWorker::statusReady ( )
signal

Emitted when connection status requested by statusRequest() is ready and results can be obtained by statusResult() method.

void TrikWiFiWorker::statusRequest ( )

Gets conection status and connection information such as SSID and IP.

Emits statusReady when done, then status can be obtained by statusResult() call.

Status TrikWiFiWorker::statusResult ( )

Returns last known connection status. To refresh, use statusRequest() method.


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