Skip to content

Commit e79bfb4

Browse files
umbynoscmaglie
authored andcommitted
add dummy settings var and return it in the Describe implementation
1 parent 1871c4f commit e79bfb4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

dummy-monitor/main.go

+19-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ type dummyMonitor struct {
3535
closeChan chan<- bool
3636
}
3737

38+
var settings = &monitor.PortDescriptor{
39+
Protocol: "test",
40+
ConfigurationParameter: map[string]*monitor.PortParameterDescriptor{
41+
"speed": {
42+
Label: "Baudrate",
43+
Type: "enum",
44+
Values: []string{"9600", "19200", "38400", "57600", "115200"},
45+
Selected: "9600",
46+
},
47+
"echo": {
48+
Label: "echo",
49+
Type: "enum",
50+
Values: []string{"on", "off"},
51+
Selected: "on",
52+
},
53+
},
54+
}
55+
3856
func main() {
3957
args.Parse()
4058
dummy := &dummyMonitor{}
@@ -53,7 +71,7 @@ func (d *dummyMonitor) Hello(userAgent string, protocol int) error {
5371

5472
//TODO implement
5573
func (d *dummyMonitor) Describe() (*monitor.PortDescriptor, error) {
56-
return nil, nil
74+
return settings, nil
5775
}
5876

5977
//TODO implement

0 commit comments

Comments
 (0)