From 50a252a1b3c84d8a47711904b75e986ad32f1df8 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sun, 2 Jul 2017 18:45:46 +0200 Subject: [PATCH] esp8266: default to boardtype ESP8266 whe using tcpfirmata Signed-off-by: deadprogram --- platforms/firmata/tcp_firmata_adaptor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platforms/firmata/tcp_firmata_adaptor.go b/platforms/firmata/tcp_firmata_adaptor.go index 7dc7f53b..44504f36 100644 --- a/platforms/firmata/tcp_firmata_adaptor.go +++ b/platforms/firmata/tcp_firmata_adaptor.go @@ -18,12 +18,14 @@ func connect(address string) (io.ReadWriteCloser, error) { } // 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 { address := args[0].(string) a := NewAdaptor(address) a.SetName(gobot.DefaultName("TCPFirmata")) + a.BoardType = "esp8266" a.PortOpener = func(port string) (io.ReadWriteCloser, error) { return connect(port) }