firmata: display address in log for TCPFirmata connections

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-01-03 10:29:21 +01:00
parent 7f9062d0ba
commit dacb2e59be
1 changed files with 3 additions and 2 deletions

View File

@ -11,12 +11,13 @@ type TCPAdaptor struct {
// NewTCPAdaptor opens and uses a TCP connection to a microcontroller running
// WiFiFirmata
func NewTCPAdaptor(args ...interface{}) *TCPAdaptor {
conn, err := net.Dial("tcp", args[0].(string))
address := args[0].(string)
conn, err := net.Dial("tcp", address)
if err != nil {
// TODO: handle error
}
a := NewAdaptor(conn)
a := NewAdaptor(conn, address)
a.SetName("TCPFirmata")
return &TCPAdaptor{