add stopbits parameter , add serial docs

This commit is contained in:
zhiqiang feng
2020-12-24 10:35:13 +08:00
parent 8d777b4134
commit 710932d03b
5 changed files with 23 additions and 8 deletions
+4 -1
View File
@@ -17,9 +17,10 @@ package cmd
import (
"fmt"
"github.com/spf13/cobra"
"os"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
@@ -28,6 +29,7 @@ var (
device string
baudrate int
bytesize byte
stopbits byte
lograw bool
dbFile string
@@ -95,6 +97,7 @@ func initConfig() {
device = viper.GetString("serial.device")
baudrate = viper.GetInt("serial.baudrate")
bytesize = byte(viper.GetInt("serial.bytesize"))
stopbits = byte(viper.GetInt("serial.stopbits"))
lograw = viper.GetBool("serial.lograw")
dbFile = viper.GetString("sqlite.file")
dbInit = viper.GetBool("sqlite.init")