trikRuntime
trikGui::WiFiClientWidget Class Reference

Widget that shows current IP address and a list of available WiFi networks. More...

#include <wiFiClientWidget.h>

Inheritance diagram for trikGui::WiFiClientWidget:
Collaboration diagram for trikGui::WiFiClientWidget:

Public Member Functions

 WiFiClientWidget (trikWiFi::TrikWiFi &trikWiFi, QWidget *parent=nullptr)
 Constructor. More...
 
 ~WiFiClientWidget ()
 Destructor. More...
 
void renewFocus () override
 Set focus properly on this widget or one of its children. More...
 
- Public Member Functions inherited from trikGui::TrikGuiDialog
 TrikGuiDialog (QWidget *parent=0)
 Constructor. More...
 
virtual ~TrikGuiDialog ()
 
virtual int exec ()
 Show widget and wait until it will be closed. More...
 
- Public Member Functions inherited from trikGui::MainWidget
 MainWidget (QWidget *parent)
 Constructor. More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *event) override
 
- Protected Member Functions inherited from trikGui::TrikGuiDialog
virtual void exit ()
 
virtual void goHome ()
 

Additional Inherited Members

- Public Types inherited from trikGui::TrikGuiDialog
enum  Result { normalExit, goHomeExit }
 
- Public Types inherited from trikGui::MainWidget
enum  FileManagerRootType { FileManagerRootType::scriptsDir, FileManagerRootType::allFS }
 
- Signals inherited from trikGui::MainWidget
void newWidget (trikGui::MainWidget &widget)
 Emitted when the widget created a new one and wants it to be shown. More...
 

Detailed Description

Widget that shows current IP address and a list of available WiFi networks.

Network is available when it is listed in /etc/wpa_supplicant.conf or it is open network without security.

Protocol of communication between this widget and underlying WiFi controller is highly asynchronous due to use of wpa_supplicant, which uses asynchronous message passing to communicate with client software.

  1. Upon construction widget requests status from WiFi controller.
  2. Upon construction widget requests scan from WiFi controller (so every time this widget is opened it will ask WiFi controller to rescan networks, no "Rescan" button is needed).
  3. On status response it shows IP address and connection status.
  4. On Scan response it refreshes list of available networks (and shows them instead of "Scanning..." message). It also clears internal network info model and repopulates it with new information.
  5. On selecting new network in a network list widget moves to "connecting" state and then tries to connect.
  6. After "connect" request widget expects "disconnected" signal and then "connected" signal. 6.1. Planned "disconnected" signal is ignored since widget is already in "connecting" state. 6.2. "connected" signal moves widget to "connected" state and causes to refresh ip address and connection status indication. 6.3. If widget does not receive "connected" signal in time, it will move to "errored" state (with proper indication).
  7. If a widget gets unplanned "disconnect" signal from WiFi controller, it will move to "notConnected" state and initiate network scan.
  8. Receiving "scanFinished" signal will cause widget to refresh available networks list.
  9. It is possible to receive unplanned "connected" signal, widget will update connection information accordingly.

Constructor & Destructor Documentation

WiFiClientWidget::WiFiClientWidget ( trikWiFi::TrikWiFi trikWiFi,
QWidget *  parent = nullptr 
)
explicit

Constructor.

Parameters
parent- parent QObject.
WiFiClientWidget::~WiFiClientWidget ( )

Destructor.

Member Function Documentation

void WiFiClientWidget::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Reimplemented from trikGui::TrikGuiDialog.

void WiFiClientWidget::renewFocus ( )
overridevirtual

Set focus properly on this widget or one of its children.

Implements trikGui::MainWidget.


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