Open hotspot setting activity

EASYUICONTEXT->openActivity("SoftApSettingActivity");

Hotspot operation interface description

Get the SoftApManager object

#include "net/NetManager.h"
SoftApManager *pSAM = NETMANAGER->getSoftApManager();

// You can define a macro to facilitate the following functino calls
#define SOFTAPMANAGER     NETMANAGER->getSoftApManager()

Turn on hotspot

SOFTAPMANAGER->setEnable(true);

Whether the hotspot is on

SOFTAPMANAGER->isEnable();

Get current hotspot state

SOFTAPMANAGER->getSoftApState();

// There are the following states
E_SOFTAP_DISABLED    // Disabled
E_SOFTAP_ENABLING    // During tunning on
E_SOFTAP_ENABLED    // Turn on successfully
E_SOFTAP_DISABLING // During tunning off
E_SOFTAP_ENABLE_ERROR    // Turn on failed

Modify hotspot name and password

SOFTAPMANAGER->setSsidAndPwd("zkswe", "abcd1234");

Get hotspot name and password

SOFTAPMANAGER->getSsid();
SOFTAPMANAGER->getPwd();

Registration and un-registration hotspot status monitoring

void addSoftApStateListener(ISoftApStateListener *pListener);
void removeSoftApStateListener(ISoftApStateListener *pListener);
powered by Gitbooklast modified: 2020-12-08 18:24:17

results matching ""

    No results matching ""