python3.7.2安装pywifi_python pywifi

1、the status of the wifi:

const.IFACE_DISCONNECTED

const.IFACE_SCANNING

const.IFACE_INACTIVE

const.IFACE_CONNECTING

const.IFACE_CONNECTED

2、authention algorithm: almost use open

const.AUTH_OPEN

const.AUTH_SHARED

3、key management type

an AP is no security setting, set the profile akm as AKM_TYPE_NONE.

an AP is in WPA mode, set the profile akm as AKM_TYUPE_WPAPSK.

an AP is in WPA2 mode, set the profile akm as AKM_TYUPE_WPA2PSK.

AKM_TYPE_WPA and AKM_TYPE_WPA2 are used by the enterprise APs.

const.AKM_TYPE_NONE

const.AKM_TYPE_WPA

const.AKM_TYPE_WPAPSK

const.AKM_TYPE_WPA2

const.AKM_TYPE_WPA2PSK

4、cipher types

const.CIPHER_TYPE_NONE

const.CIPHER_TYPE_WEP

const.CIPHER_TYPE_TKIP

const.CIPHER_TYPE_CCMP

5、network profile

ssid - The ssid of the AP.

auth - The authentication algorithm of the AP.

akm - The key management type of the AP.

cipher - The cipher type of the AP.

key (optinoal) - The key of the AP. This should be set if the cipher is not CIPHER_TYPE_NONE.import pywifi

wifi = pywifi.PyWiFi()

iface = wifi.interfaces()[0]

Interface.name()

Get the name of the Wi-Fi interface.

Interface.scan()

Trigger the interface to scan APs.

Interface.scan_results()

Obtain the results of the previous triggerred scan. A Profile list will be returned.

Note. Because the scan time for each Wi-Fi interface is variant. It is safer to call scan_results() 2 ~ 8 seconds later after calling scan().

Interface.add_network_profile(profile)

Add the AP profile for connecting to later.

Interface.remove_all_network_profiles()

Remove all the AP profiles.

Interface.network_profiles()

Obtain all the saved AP profiles by returning a Profile list.

Interface.connect(profile)

Connect to the specified AP by the given profile. Note. As current design, add_network_profile(profile) should be called before connect(profile) is called.

Interface.disconnect()

Disconnect current AP connection.

Interface.status()

Get the status of current status.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值