Support legacy baud

This commit is contained in:
nemunaire 2022-08-19 21:44:10 +02:00
parent 469e7d3430
commit cfc9a8d0c7

View File

@ -273,6 +273,7 @@ func treatLine(line []byte) (key string, horodate *time.Time, data []byte, err e
}
func main() {
var legacyMode = flag.Bool("legacy-mode", false, "Assume teleinformation in legacy mode")
var influxScheme = flag.String("influx-scheme", "http", "Scheme to use to contact InfluxDB")
var influxHost = flag.String("influx-host", "localhost", "Host where lives InfluxDB")
var influxPort = flag.Uint("influx-port", 8086, "Port where InfluxDB is accessible")
@ -287,9 +288,14 @@ func main() {
return
}
serialSpeed := 9600
if *legacyMode {
serialSpeed = 1200
}
config := &serial.Config{
Name: flag.Args()[0],
Baud: 9600,
Baud: serialSpeed,
Size: 7,
Parity: serial.ParityNone,
StopBits: 1,