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) }