Description

  • This text introduces wifi related API.

Interface version

Version number Writer Date Description
1.0 Leng Youjun December 10, 2020 initial release

API list

Name Description
get get configuration
scan scan
set set configuration

get

Request parameter description

none

Call sample

wapi 8ms '{"ver": "1.0", "module": "wifi", "api": "get"}'

Return sample

{ 
    "ver" : "1.0" , 
    "api" : "get" , 
    "errcode" : 0 , 
    "result" :{ 
        "disabled" : 1 , 
        "ifname" : "wlan0" , 
        "ssid" : "wt-sta-wifi" , 
        "encryption" : "none"
     } , 
    "module" : "wifi"
 }

Return parameter description

Parameter name Type Description
ifname string device name
ssid string ssid name
encryption string none: no encryption;mixed-psk: encryption
key string password
disabled int 0:on;1:off

Error code

Error Code Description

scan

Request parameter description

none

Call sample

wapi 8ms '{"ver": "1.0", "module": "wifi", "api": "scan"}'

Return sample

{ 
    "ver" : "1.0" , 
    "api" : "scan" , 
    "errcode" : 0 , 
    "result" :{ 
        "aplist" :[
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "AC:67:B2:47:57:99" , 
                "ssid" : "lw7821-5798" , 
                "signal" : -85
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "7A:54:99:55:D0:CC" , 
                "ssid" : "Luman_AP_HG255D" , 
                "signal" : -74
             } ,
            { 
                "encryption" : "none" , 
                "bssid" : "8C:AA:B5:B2:82:95" , 
                "ssid" : "ESP_B28295" , 
                "signal" : -61
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "D4:EE:07:19:0B:6A" , 
                "ssid" : "HiWiFi_190B6A" , 
                "signal" : -77
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "34:68:95:74:86:C7" , 
                "ssid" : "HP-Print-c7-LaserJet Pro MFP" , 
                "signal" : - 93
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "50:3A:A0:F3:2C:6E" , 
                "ssid" : "MERCURY_2C6E" , 
                "signal" : -83
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "38:83:45:C4:54:A0" , 
                "ssid" : "Adams" , 
                "signal" : -77
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "94:77:2B:66:A0:68" , 
                "ssid" : "test" , 
                "signal" : -64
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "6C:06:D6:11:8C:78" , 
                "ssid" : "WT-HW" , 
                "signal" : -74
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "94:D9:B3:A6:B8:7A" , 
                "ssid" : "IDO-OFFICE-2G" , 
                "signal" : -79
             } ,
            { 
                "encryption" : "mixed-psk" , 
                "bssid" : "60:EE:5C:DF:A5:D0" , 
                "ssid" : "1" , 
                "signal" : -74
             }
         ]
     },
    "module":"wifi"
}

Return parameter description

Parameter name Type Description
aplist array scanned AP list
ssid string ssid
bssid string bssid
signal int signal strength
encryption string none: no encryption;mixed-psk: encryption

Error code

Error Code Description

set

Request parameter description

Parameter name Type Description
ssid string ssid name
encryption string none: no encryption;mixed-psk: encryption
key string password
disabled int 0:on;1:off

Call sample

wapi 8ms '{"ver": "1.0", "module": "wifi", "api": "set", "param"
: {"ssid": "123", "encryption": "none", "disabled": "0"}}'

Return sample

{ 
    "ver" : "1.0" , 
    "api" : "set" , 
    "errcode" : 0 , 
    "result" :{ 

    } , 
    "module" : "wifi"
 }

Return parameter description

Parameter name Type Description
ifname string device name
ssid string ssid name
encryption string none: no encryption;mixed-psk: encryption
key string password
disabled int 0:on;1:off

Error code

Error Code Description
文档更新时间: 2021-06-02 10:38   作者:plj