From 225d96a8386442feee8165e3c753cc5832f3a8c0 Mon Sep 17 00:00:00 2001 From: 456vv <123@456vv.com> Date: Thu, 7 Jan 2021 18:01:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8C=87=E5=AE=9A=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0IP=EF=BC=8C=E4=B8=80=E4=BA=9B=E5=A4=9A=E7=BD=91?= =?UTF-8?q?=E5=8D=A1=E3=80=82=E4=BC=9A=E9=80=A0=E6=88=90=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=BD=91=E5=8D=A1=EF=BC=8C=E8=80=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E5=B8=B8=E5=8F=91=E9=80=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/cmd/main.go | 6 +----- demo/esptouch.go | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/demo/cmd/main.go b/demo/cmd/main.go index 39586a5..5b4bd57 100644 --- a/demo/cmd/main.go +++ b/demo/cmd/main.go @@ -44,16 +44,12 @@ func main() { if err != nil { panic(err) } - task, err := esptouch.NewEsptouchTask([]byte(apSsid), []byte(apPassword), bssidBytes) + task, err := esptouch.NewEsptouchTask([]byte(apSsid), []byte(apPassword), bssidBytes, net.ParseIP(sip)) if err != nil { panic(err) } defer task.Close() task.SetBroadcast(mode) - if sip != "" { - ip := net.ParseIP(sip) - task.SetLocalIP(ip) - } log.Println("SmartConfig run.") diff --git a/demo/esptouch.go b/demo/esptouch.go index 5979b82..34a2e27 100644 --- a/demo/esptouch.go +++ b/demo/esptouch.go @@ -6,7 +6,7 @@ import ( ) func main() { - task, err := esptouch.NewEsptouchTask([]byte("jiajiajia"), []byte("400302100"), []byte{0x4c, 0x50, 0x77, 0x73, 0x37, 0xb0}) + task, err := esptouch.NewEsptouchTask([]byte("jiajiajia"), []byte("400302100"), []byte{0x4c, 0x50, 0x77, 0x73, 0x37, 0xb0}, nil) if err != nil { panic(err) }