2013-10-23 07:45:31 +08:00
|
|
|
package gobot
|
2013-10-24 13:00:03 +08:00
|
|
|
|
|
|
|
type Adaptor struct {
|
2014-06-16 08:32:00 +08:00
|
|
|
Name string
|
|
|
|
Port string
|
|
|
|
Connected bool
|
|
|
|
Params map[string]interface{}
|
2013-10-24 13:00:03 +08:00
|
|
|
}
|
|
|
|
|
2013-12-19 07:25:07 +08:00
|
|
|
type AdaptorInterface interface {
|
|
|
|
Finalize() bool
|
|
|
|
Connect() bool
|
2014-06-14 01:46:58 +08:00
|
|
|
port() string
|
|
|
|
name() string
|
2014-06-15 09:49:02 +08:00
|
|
|
setName(string)
|
2014-06-14 01:46:58 +08:00
|
|
|
params() map[string]interface{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Adaptor) port() string {
|
|
|
|
return a.Port
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Adaptor) name() string {
|
|
|
|
return a.Name
|
|
|
|
}
|
|
|
|
|
2014-06-15 09:49:02 +08:00
|
|
|
func (a *Adaptor) setName(s string) {
|
|
|
|
a.Name = s
|
|
|
|
}
|
|
|
|
|
2014-06-14 01:46:58 +08:00
|
|
|
func (a *Adaptor) params() map[string]interface{} {
|
|
|
|
return a.Params
|
2013-10-24 13:00:03 +08:00
|
|
|
}
|