summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sample-config.toml8
-rw-r--r--src/rhctl/audio_switch_command.go4
-rw-r--r--src/rhctl/conf.go5
3 files changed, 11 insertions, 6 deletions
diff --git a/sample-config.toml b/sample-config.toml
index cdd27da..e31db07 100644
--- a/sample-config.toml
+++ b/sample-config.toml
@@ -3,10 +3,10 @@ dev = "/dev/ttyUSB0"
baud = 19200
timeout = "500ms"
unit = 0
-ports = [ { name = "master_main", number = 1 },
- { name = "master_music", number = 2 },
- { name = "standby_main", number = 3 },
- { name = "standby_music", number = 4 } ]
+ports = [ { server = "master", channel = "main", number = 1 },
+ { server = "master", channel = "music", number = 2 },
+ { server = "standby", channel = "main", number = 3 },
+ { server = "standby", channel = "music", number = 4 } ]
[servers]
diff --git a/src/rhctl/audio_switch_command.go b/src/rhctl/audio_switch_command.go
index 3c67b3c..1c2e2fb 100644
--- a/src/rhctl/audio_switch_command.go
+++ b/src/rhctl/audio_switch_command.go
@@ -76,6 +76,10 @@ func (i *SwitchInputNum) FromString(str string) error {
return nil
}
+func (i *SwitchInputNum) UnmarshalTOML(data []byte) error {
+ return i.FromString(string(data))
+}
+
type SwitchOutputNum uint
func (o SwitchOutputNum) String() string {
diff --git a/src/rhctl/conf.go b/src/rhctl/conf.go
index b6f21ca..77ab174 100644
--- a/src/rhctl/conf.go
+++ b/src/rhctl/conf.go
@@ -36,8 +36,9 @@ type Config struct {
Timeout Duration `toml:"timeout"`
Unit SwitchUnitID `toml:"unit"`
Ports []struct {
- Name string `toml:"name"`
- Number uint `toml:"number"`
+ Server string `toml:"server"`
+ Channel string `toml:"channel"`
+ Number SwitchInputNum `toml:"number"`
}
}