fix stopbits bytesize
This commit is contained in:
+1
-1
@@ -85,7 +85,7 @@ func start() {
|
||||
for utils.ServerRunning {
|
||||
if !utils.IsPortOpen() {
|
||||
logger.Info("try to open port")
|
||||
err := utils.OpenPort(device, baudrate, bytesize, stopbits)
|
||||
err := utils.OpenPort(device, baudrate)
|
||||
if err != nil {
|
||||
logger.Fatal("error in open serial port ", zap.Error(err))
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ Test load sqlite database and init table`,
|
||||
|
||||
func test() {
|
||||
logger.Info("Testing environment")
|
||||
_ = utils.OpenPort(device, baudrate, bytesize, stopbits)
|
||||
_ = utils.OpenPort(device, baudrate)
|
||||
|
||||
err := utils.InitDb(dbFile, dbInit)
|
||||
if err != nil {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ var (
|
||||
const readDuration = 500 * time.Millisecond
|
||||
|
||||
// OpenPort open serial port
|
||||
func OpenPort(device string, baudrate int, bytesize byte, stopbits byte) error {
|
||||
func OpenPort(device string, baudrate int) error {
|
||||
Log.Info("opening serial device ",
|
||||
zap.String("port", device),
|
||||
zap.Int("baudrate", baudrate))
|
||||
|
||||
Reference in New Issue
Block a user