This commit is contained in:
zhiqiang feng
2020-12-22 12:08:06 +08:00
parent f0983f0d02
commit 689c5748ec
+3 -3
View File
@@ -1,10 +1,11 @@
package utils
import (
"github.com/tarm/serial"
"io"
"log"
"time"
"github.com/tarm/serial"
)
var (
@@ -12,7 +13,7 @@ var(
baudrate int
bytesize byte
port *serial.Port
portOpened bool
portOpened = false
)
func OpenPort(device string, baudrate int, bytesize byte) error {
@@ -45,4 +46,3 @@ func ReadPort() ([]byte, int){
func IsPortOpen() bool {
return portOpened
}