Start the wifi setting interface

EASYUICONTEXT->openActivity("WifiSettingActivity");

Description of wifi operation interface

Get WifiManager object

#include "net/NetManager.h"
WifiManager *pWM = NETMANAGER->getWifiManager();

// You can define a macro to facilitate the following interface calls
#define  WIFIMANAGER    NETMANAGER->getWifiManager()

Check whether the machine supports wifi

WIFIMANAGER->isSupported();

Check if wifi is on

WIFIMANAGER->isWifiEnable();

Switch wifi

WIFIMANAGER->enableWifi(true);

Scan wifi

WIFIMANAGER->startScan();

Connect to wifi

WIFIMANAGER->connect(ssid, pw);

Disconnect wifi connection

WIFIMANAGER->disconnect();

Check if wifi is connected

WIFIMANAGER->isConnected();

Get connected wifi information

WIFIMANAGER->getConnectionInfo();

Registration and anti-registration wifi information monitoring

void addWifiListener(IWifiListener *pListener);
void removeWifiListener(IWifiListener *pListener);

Sample code

See the NetDemo project in the sample code

powered by Gitbooklast modified: 2021-05-28 12:00:31

results matching ""

    No results matching ""