前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >python pywifi

python pywifi

作者头像
用户5760343
发布2019-07-08 11:55:10
1.1K0
发布2019-07-08 11:55:10
举报
文章被收录于专栏:sktj

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.

代码语言:javascript
复制
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.

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019.06.03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Interface.name()
  • Interface.scan()
  • Interface.scan_results()
  • Interface.add_network_profile(profile)
  • Interface.remove_all_network_profiles()
  • Interface.network_profiles()
  • Interface.connect(profile)
  • Interface.disconnect()
  • Interface.status()
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档