Documentation ¶
Index ¶
- func GetDigitPattern(n int, dpoint bool) int
- type Dock
- type Event
- type EventType
- type Module
- type ModuleType
- type Pipe
- type Request
- type RequestType
- type Simulator
- func (s *Simulator) Close()
- func (s *Simulator) Connect(modType ModuleType, channel int) error
- func (s *Simulator) Disconnect(channel int) error
- func (s *Simulator) NotifyAttachedModules() error
- func (s *Simulator) NotifyUpdate(modType ModuleType, channel int, params ...int) error
- func (s *Simulator) Type(channel int) ModuleType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDigitPattern ¶
Types ¶
type Dock ¶
func ConnectDock ¶
func ConnectDock(port io.ReadWriter) *Dock
func (*Dock) GetModuleType ¶
func (d *Dock) GetModuleType(port int) ModuleType
func (*Dock) SetModuleData ¶
func (d *Dock) SetModuleData(port int, mtype ModuleType, params ...int) error
type Module ¶
type Module struct { ModuleType *Dock // contains filtered or unexported fields }
func (*Module) ProcessEvent ¶
type ModuleType ¶
type ModuleType int
const ( Unknown ModuleType = iota Joystick Slider Touch Motion Light Colour Dial Weather Number Motor Rainbow Matrix )
func FromString ¶
func FromString(name string) ModuleType
func (ModuleType) String ¶
func (m ModuleType) String() string
type Pipe ¶
func (*Pipe) Endpoints ¶
func (p *Pipe) Endpoints() (io.ReadWriteCloser, io.ReadWriteCloser)
type Request ¶
type Request struct { RequestType Channel int Params []int ParamStr string Error error }
type RequestType ¶
type RequestType int
const ( ReqInvalid RequestType = iota ReqEnquire ReqResetToBootloader ReqVersion ReqPower ReqName ReqDebug ReqSet ReqError )
func (RequestType) String ¶
func (e RequestType) String() string
type Simulator ¶
type Simulator struct { sync.Mutex Requests chan Request // contains filtered or unexported fields }
func NewSimulator ¶
func NewSimulator(port io.ReadWriteCloser) *Simulator
func (*Simulator) Disconnect ¶
func (*Simulator) NotifyAttachedModules ¶
func (*Simulator) NotifyUpdate ¶
func (s *Simulator) NotifyUpdate(modType ModuleType, channel int, params ...int) error
func (*Simulator) Type ¶
func (s *Simulator) Type(channel int) ModuleType
Source Files ¶
Click to show internal directories.
Click to hide internal directories.