示例#1
0
        private void rbAP_CheckedChanged(object sender, EventArgs e)
        {
            DHCPMode m = DHCPMode.AP_STA;

            if (rbAPDHCP.Checked)
            {
                m = DHCPMode.AP;
            }
            else if (rbSTA.Checked)
            {
                m = DHCPMode.STA;
            }
            _growbe.SetDHCPMode(m);
        }
示例#2
0
        public bool SetDHCPMode(DHCPMode mode)
        {
            var str = "";

            if (mode == DHCPMode.AP_STA)
            {
                str = "2,1";
            }
            else
            {
                str = ((int)mode).ToString();
            }
            var r = SendCommand($"AT+CWDHCP_{ConfigMode}={str}");

            if (r.Result == "OK")
            {
                DHCPMode = mode;
                return(true);
            }
            return(false);
        }
示例#3
0
 public DHCPConfig SetDHCPMode(DHCPMode mode)
 {
     this.mode = mode;
     return(this);
 }
示例#4
0
 public DHCPConfig(WIFIInterface wifiInterface, DHCPMode mode)
 {
     this.SetDHCPMode(mode).SetInterface(wifiInterface);
 }