summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sample-config.toml4
-rw-r--r--src/rhctl/conf.go4
-rw-r--r--src/rhctl/main.go1
3 files changed, 9 insertions, 0 deletions
diff --git a/sample-config.toml b/sample-config.toml
index 6709572..800f764 100644
--- a/sample-config.toml
+++ b/sample-config.toml
@@ -2,6 +2,10 @@
dev = "/dev/ttyUSB0"
baud = 9600
timeout = "500ms"
+ports = [ { name = "master_main", number = 1 },
+ { name = "master_music", number = 2 },
+ { name = "standby_main", number = 3 },
+ { name = "standby_music", number = 4 } ]
[servers]
diff --git a/src/rhctl/conf.go b/src/rhctl/conf.go
index 2dfb9ec..47a51b8 100644
--- a/src/rhctl/conf.go
+++ b/src/rhctl/conf.go
@@ -34,6 +34,10 @@ type Config struct {
Device string `toml:"dev"`
Baudrate Baudrate `toml:"baud"`
Timeout Duration `toml:"timeout"`
+ Ports []struct {
+ Name string `toml:"name"`
+ Number uint `toml:"number"`
+ }
}
Servers map[string]struct {
diff --git a/src/rhctl/main.go b/src/rhctl/main.go
index f529265..2aaf7aa 100644
--- a/src/rhctl/main.go
+++ b/src/rhctl/main.go
@@ -76,6 +76,7 @@ func main() {
return
}
rhl.Printf("just started...")
+ rhdl.Printf("configuration: %+v", conf)
sw, err := SwitchInit(conf)
if err != nil {