Skip to content

Commit ca21798

Browse files
umbynoscmaglie
authored andcommitted
add describe() implementation
1 parent e79bfb4 commit ca21798

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

monitor.go

+16-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,22 @@ func (d *Server) hello(cmd string) {
168168
}
169169

170170
func (d *Server) describe() {
171-
171+
if !d.initialized {
172+
d.outputChan <- messageError("describe", "Monitor not STARTed")
173+
return
174+
}
175+
var port_description *PortDescriptor
176+
port_description, err := d.impl.Describe()
177+
if err != nil {
178+
d.outputChan <- messageError("hello", err.Error())
179+
return
180+
}
181+
d.outputChan <- &message{
182+
EventType: "describe",
183+
Message: "OK",
184+
PortDescription: port_description,
185+
}
186+
d.initialized = true
172187
}
173188

174189
func (d *Server) configure(cmd string) {

0 commit comments

Comments
 (0)