cmd.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:esp8266 作者: fadushin 项目源码 文件源码
def ifconfig():
    import network
    sta_if = network.WLAN(network.STA_IF)
    if sta_if.active() :        
        (ip, subnet, gateway, dns) = sta_if.ifconfig()
        print("Station:\n\tip: {}\n\tsubnet: {}\n\tgateway: {}\n\tdns: {}".format(ip, subnet, gateway, dns))
    ap_if = network.WLAN(network.AP_IF)
    if ap_if.active() :        
        (ip, subnet, gateway, dns) = ap_if.ifconfig()
        print("Access Point:\n\tip: {}\n\tsubnet: {}\n\tgateway: {}\n\tdns: {}".format(ip, subnet, gateway, dns))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号