esp8266: default to boardtype ESP8266 whe using tcpfirmata
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
206f8aadfe
commit
50a252a1b3
|
@ -18,12 +18,14 @@ func connect(address string) (io.ReadWriteCloser, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTCPAdaptor opens and uses a TCP connection to a microcontroller running
|
// NewTCPAdaptor opens and uses a TCP connection to a microcontroller running
|
||||||
// WiFiFirmata
|
// WiFiFirmata. NewTCPAdaptor defaults to a BoardType of esp8266. Set to a
|
||||||
|
// different boardtype if your application requires it.
|
||||||
func NewTCPAdaptor(args ...interface{}) *TCPAdaptor {
|
func NewTCPAdaptor(args ...interface{}) *TCPAdaptor {
|
||||||
address := args[0].(string)
|
address := args[0].(string)
|
||||||
|
|
||||||
a := NewAdaptor(address)
|
a := NewAdaptor(address)
|
||||||
a.SetName(gobot.DefaultName("TCPFirmata"))
|
a.SetName(gobot.DefaultName("TCPFirmata"))
|
||||||
|
a.BoardType = "esp8266"
|
||||||
a.PortOpener = func(port string) (io.ReadWriteCloser, error) {
|
a.PortOpener = func(port string) (io.ReadWriteCloser, error) {
|
||||||
return connect(port)
|
return connect(port)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue