trikRuntime
trikWiFi::WpaSupplicantCommunicator Class Reference

Allows communication with wpa_supplicant daemon. More...

#include <wpaSupplicantCommunicator.h>

Inheritance diagram for trikWiFi::WpaSupplicantCommunicator:
Collaboration diagram for trikWiFi::WpaSupplicantCommunicator:

Public Member Functions

 WpaSupplicantCommunicator (const QString &interfaceFile, const QString &daemonFile, QObject *parent=nullptr)
 Constructor. More...
 
 ~WpaSupplicantCommunicator ()
 Destructor. More...
 
int fileDescriptor ()
 Handle of a file. More...
 
int attach ()
 Attach communicator to wpa_supplicant to be able to receive network events. More...
 
int detach ()
 Detach communicator from wpa_supplicant. More...
 
int request (const QString &command, QString &reply)
 Send a request to wpa_supplicant. More...
 
bool isPending ()
 Returns true if there are unread incoming messages from wpa_supplicant. More...
 
int receive (QString &message)
 Receive next incoming message from wpa_supplicant. More...
 

Detailed Description

Allows communication with wpa_supplicant daemon.

Constructor & Destructor Documentation

WpaSupplicantCommunicator::WpaSupplicantCommunicator ( const QString &  interfaceFile,
const QString &  daemonFile,
QObject *  parent = nullptr 
)

Constructor.

Parameters
interfaceFile- file that is 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.
parent- parent QObject.
WpaSupplicantCommunicator::~WpaSupplicantCommunicator ( )

Destructor.

Member Function Documentation

int WpaSupplicantCommunicator::attach ( )

Attach communicator to wpa_supplicant to be able to receive network events.

int WpaSupplicantCommunicator::detach ( )

Detach communicator from wpa_supplicant.

int WpaSupplicantCommunicator::fileDescriptor ( )

Handle of a file.

bool WpaSupplicantCommunicator::isPending ( )

Returns true if there are unread incoming messages from wpa_supplicant.

int WpaSupplicantCommunicator::receive ( QString &  message)

Receive next incoming message from wpa_supplicant.

int WpaSupplicantCommunicator::request ( const QString &  command,
QString &  reply 
)

Send a request to wpa_supplicant.

Parameters
command- command to wpa_supplicant. List of available commands is here: http://hostap.epitest.fi/wpa_supplicant/devel/ctrl_iface_page.html
reply- reply from wpa_supplicant.

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