From ca6f7573acbae8ad895b3b9be56b263eb8313482 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sat, 13 May 2017 11:13:33 +0200 Subject: [PATCH] firmata: switch to using go-serial package Signed-off-by: deadprogram --- Makefile | 2 +- platforms/firmata/firmata_adaptor.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 804470f9..1a73800d 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ deps: github.com/mgutz/logxi/v1 \ github.com/nats-io/nats \ github.com/sigurn/crc8 \ - github.com/tarm/serial \ + go.bug.st/serial.v1 \ github.com/veandco/go-sdl2/sdl \ golang.org/x/net/websocket \ golang.org/x/sys/unix diff --git a/platforms/firmata/firmata_adaptor.go b/platforms/firmata/firmata_adaptor.go index 3908270e..f800cc9d 100644 --- a/platforms/firmata/firmata_adaptor.go +++ b/platforms/firmata/firmata_adaptor.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/tarm/serial" + serial "go.bug.st/serial.v1" "gobot.io/x/gobot" "gobot.io/x/gobot/drivers/i2c" "gobot.io/x/gobot/platforms/firmata/client" @@ -54,7 +54,7 @@ func NewAdaptor(args ...interface{}) *Adaptor { conn: nil, board: client.New(), PortOpener: func(port string) (io.ReadWriteCloser, error) { - return serial.OpenPort(&serial.Config{Name: port, Baud: 57600}) + return serial.Open(port, &serial.Mode{BaudRate: 57600}) }, Eventer: gobot.NewEventer(), }