maix::network::wifi
maix.network.wifi module
This is
maix::network::wifi
module of MaixCDK.
All of these elements are in namespacemaix::network::wifi
.For MaixCDK developer: DO NOT edit this doc file manually, this doc is auto generated!
Module
No module
Enum
Variable
Function
list_devices
List WiFi interfaces
item | description |
---|---|
return | WiFi interface list, string type |
C++ defination code:
std::vector<std::string> list_devices()
Class
AP_Info
WiFi AP info
C++ defination code:
class AP_Info
ssid
WiFi AP info SSID
item | description |
---|---|
type | var |
static | False |
readonly | False |
C++ defination code:
std::vector<uint8_t> ssid
bssid
WiFi AP info BSSID
item | description |
---|---|
type | var |
static | False |
readonly | False |
C++ defination code:
std::string bssid
security
WiFi AP info security
item | description |
---|---|
type | var |
static | False |
readonly | False |
C++ defination code:
std::string security
channel
WiFi AP info channel
item | description |
---|---|
type | var |
static | False |
readonly | False |
C++ defination code:
int channel
frequency
WiFi AP info frequency
item | description |
---|---|
type | var |
static | False |
readonly | False |
C++ defination code:
int frequency
rssi
WiFi AP info rssi
item | description |
---|---|
type | var |
static | False |
readonly | False |
C++ defination code:
int rssi
ssid_str
WiFi AP info ssid_str
item | description |
---|---|
type | func |
static | False |
C++ defination code:
std::string ssid_str()
Wifi
Wifi class
C++ defination code:
class Wifi
Wifi
Wifi class
item | description |
---|---|
type | func |
param | iface: wifi interface name, default is wlan0 |
static | False |
C++ defination code:
Wifi(std::string iface = "wlan0")
get_ip
Get current WiFi ip
item | description |
---|---|
type | func |
return | ip, string type, if network not connected, will return empty string. |
static | False |
C++ defination code:
std::string get_ip()
get_mac
Get current WiFi MAC address
item | description |
---|---|
type | func |
return | ip, string type. |
static | False |
C++ defination code:
std::string get_mac()
get_ssid
Get current WiFi SSID
item | description |
---|---|
type | func |
param | from_cache: if true, will not read config from file, direct use ssid in cache. attention, first time call this method will auto matically read config from file, and if call connect method will set cache. |
return | SSID, string type. |
static | False |
C++ defination code:
std::string get_ssid(bool from_cache = true)
get_gateway
Get current WiFi ip
item | description |
---|---|
type | func |
return | ip, string type, if network not connected, will return empty string. |
static | False |
C++ defination code:
std::string get_gateway()
start_scan
WiFi start scan AP info around in background.
item | description |
---|---|
type | func |
return | If success, return err.Err.ERR_NONE, else means failed. |
static | False |
C++ defination code:
err::Err start_scan()
get_scan_result
Get WiFi scan AP info.
item | description |
---|---|
type | func |
return | wifi.AP_Info list. |
static | False |
C++ defination code:
std::vector<network::wifi::AP_Info> get_scan_result()
stop_scan
Stop WiFi scan AP info.
item | description |
---|---|
type | func |
static | False |
C++ defination code:
void stop_scan()
connect
Connect to WiFi AP.
item | description |
---|---|
type | func |
param | ssid: SSID of AP password: password of AP, if no password, leave it empty. wait: wait for got IP or failed or timeout. timeout: connect timeout internal, unit second. |
return | If success, return err.Err.ERR_NONE, else means failed. |
static | False |
C++ defination code:
err::Err connect(const std::string &ssid, const std::string &password, bool wait = true, int timeout = 60)
disconnect
Disconnect from WiFi AP.
item | description |
---|---|
type | func |
return | If success, return err.Err.ERR_NONE, else means failed. |
static | False |
C++ defination code:
err::Err disconnect()
is_connected
See if WiFi is connected to AP.
item | description |
---|---|
type | func |
return | If connected return true, else false. |
static | False |
C++ defination code:
bool is_connected()
start_ap
Start WiFi AP.
item | description |
---|---|
type | func |
param | ssid: SSID of AP. password: password of AP, if no password, leave it empty. ip: ip address of hostap, default empty string means auto generated one according to hardware. netmask: netmask, default 255.255.255.0, now only support 255.255.255.0 . mode: WiFi mode, default g(IEEE 802.11g (2.4 GHz)), a = IEEE 802.11a (5 GHz), b = IEEE 802.11b (2.4 GHz). channel: WiFi channel number, 0 means auto select. MaixCAM not support auto, will default channel 1. hidden: hidden SSID or not. |
return | If success, return err.Err.ERR_NONE, else means failed. |
static | False |
C++ defination code:
err::Err start_ap(const std::string &ssid, const std::string &password, std::string mode = "g", int channel = 0, const std::string &ip = "192.168.66.1", const std::string &netmask = "255.255.255.0", bool hidden = false)
stop_ap
Stop WiFi AP.
item | description |
---|---|
type | func |
return | If success, return err.Err.ERR_NONE, else means failed. |
static | False |
C++ defination code:
err::Err stop_ap()
is_ap_mode
Whether WiFi is AP mode
item | description |
---|---|
type | func |
return | True if AP mode now, or False. |
static | False |
C++ defination code:
bool is_ap_mode()