Some interface improvements.
This commit is contained in:
@ -2,6 +2,7 @@ package at
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
@ -32,6 +33,8 @@ type Port interface {
|
||||
IsConnected() bool
|
||||
|
||||
Send(cmd string) (Resp, error)
|
||||
|
||||
io.Closer
|
||||
}
|
||||
|
||||
func New(logger *log.Logger, portName string, baudrate int) Port {
|
||||
@ -110,3 +113,7 @@ func (p *atPort) Send(cmd string) (Resp, error) {
|
||||
|
||||
return Resp(resp), nil
|
||||
}
|
||||
|
||||
func (p *atPort) Close() error {
|
||||
return p.port.Close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user