TEAM ENVI^ ENVIMODE=1| ENVI^ FORCELOCAL=1
LOGS **2 * X.LOG
WIN1
_SUB WIN1,W243H254,WIFI测试,
    EDIT -3D -VCENTER EDIT1,L95T25W124H30,,,
    EDIT -3D -VCENTER EDIT2,L95T71W124H30,,,1
    LABE LABE1,L13T26W60H30,SSID,,
    LABE LABE2,L14T71W60H30,密码,,
    ITEM ITEM1,L29T149W60H30,连接,WiFiConnect "%EDIT1%" "%EDIT2%",
    ITEM ITEM2,L136T149W60H30,查询,WiFiQuery
_END

_SUB WiFiConnect
    FIND $[ '%~1'='' | '%~2'='' ],EXIT 
    ENVI @ITEM1.Enable=0
    TEAM BASE %~1,&SSID | BASE %~2,&PSWD
    ADSL-wlan %&SSID%,%&PSWD%,  //WPA2PSK AES
    ENVI @ITEM1.Enable=1
_END

_SUB WiFiQuery
    SET &SSID=%~1
    //FIND $[ '%~1'='' ],EXIT 
    ENVI @ITEM2.Enable=0
    TEAM BASE %~1,&SSID | BASE %~2,&PSWD
    ADSL-wlan  ,,query,&&V1
    ADSL-wlan  ,,list,&&V2
    MESS %V1%  第3列为1则连上\n\n 下面第3列最低位为1则连上\n%v2%
    ENVI @ITEM2.Enable=1
_END
