Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 964 Bytes

README.md

File metadata and controls

40 lines (29 loc) · 964 Bytes

ESPTouch-Go-SDK

My Learning Project of Smartconfig for ESP8266-WiFi

Looking for my study notes? see: https://www.imsry.cn/posts/bf40eeb6.html

Finally. the sdk package born up. ( Code is migrated from https://github.com/EspressifApp/EsptouchForAndroid

该库做了一些修改,原库来自: https://github.com/haowanxing/esptouch-go

感谢作者(haowanxing)的辛苦!

SDK-Usage:

package main

import (
	"github.com/456vv/esptouch-go"
	"log"
	"net"
)

func main() {
	task, err := esptouch.NewEsptouchTask([]byte("My-AP"), []byte("400300200"), []byte{0x4c, 0x50, 0x77, 0x73, 0x37, 0xb0}, net.ParseIP("192.168.1.2"))
	if err != nil {
		panic(err)
	}
	defer task.Close()
    // false for multicast, true for broadcast
	task.SetBroadcast(false)
	
	log.Println("SmartConfig run.")
    // smartconfig device num: 1
	rList := task.ExecuteForResults(1)
	log.Println("Finished", rList)
	return
}