26 lines
509 B
Go
26 lines
509 B
Go
package cp3000
|
|
|
|
import (
|
|
"io"
|
|
"time"
|
|
|
|
"src.dualinventive.com/go/lib/dilog"
|
|
)
|
|
|
|
// Callback is the router callback prototype
|
|
type Callback func(Router, []string) error
|
|
|
|
// Router is a CP3000 router interface
|
|
type Router interface {
|
|
Close() error
|
|
AddDevice(uid string, d io.Closer)
|
|
RemoveDevice(uid string)
|
|
ReceiveReply(time.Duration) (*Msg, error)
|
|
Register(Command, Callback)
|
|
Run()
|
|
Send(Command, ...string) error
|
|
SendReply(uint8) error
|
|
SetLogger(dilog.Logger)
|
|
SetReplyWriteTimeout(time.Duration)
|
|
}
|