Documentation
¶
Index ¶
- Variables
- type Connector
- type Gateway
- func (g *Gateway) GetConnectStatus() bool
- func (g *Gateway) GetSubDeviceConnectStatus(deviceIdentifier string) bool
- func (g *Gateway) Run()
- func (g *Gateway) SendDeviceAddWaitResponse(subDevice proto.DeviceInfo) error
- func (g *Gateway) SendDeviceChangeStatusWaitResponse(deviceIdentifier string, connectStatus proto.DeviceConnectStatus) error
- func (g *Gateway) SendDeviceCommandResponse(mid int, success bool, body interface{}) (err error)
- func (g *Gateway) SendDeviceData(deviceIdentifier string, services []proto.Service) (err error)
- func (g *Gateway) SendDeviceQueryWaitResponse(deviceIdentifier string) (proto.DeviceInfo, error)
- type MsgHandler
- type Terminal
- func (t *Terminal) ConnectionLost(client MQTT.Client, err error)
- func (t *Terminal) GetConnectStatus() bool
- func (t *Terminal) GetSubDeviceConnectStatus(deviceIdentifier string) bool
- func (t *Terminal) OnConnected(client MQTT.Client)
- func (t *Terminal) Run()
- func (t *Terminal) SendDeviceAddWaitResponse(deviceInfo proto.DeviceInfo) (err error)
- func (t *Terminal) SendDeviceChangeStatusWaitResponse(deviceIdentifier string, connectStatus proto.DeviceConnectStatus) (err error)
- func (t *Terminal) SendDeviceCommandResponse(mid int, success bool, body interface{}) (err error)
- func (t *Terminal) SendDeviceData(deviceIdentifier string, services []proto.Service) (err error)
- func (t *Terminal) SendDeviceQueryWaitResponse(deviceIdentifier string) (deviceInfo proto.DeviceInfo, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDeviceNotRegister = errors.New("device not register") ErrDeviceNotOnline = errors.New("device not online") )
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface { Run() GetConnectStatus() bool GetSubDeviceConnectStatus(deviceIdentifier string) bool SendDeviceAddWaitResponse(deviceInfo proto.DeviceInfo) error SendDeviceChangeStatusWaitResponse(deviceIdentifier string, connectStatus proto.DeviceConnectStatus) error SendDeviceQueryWaitResponse(deviceIdentifier string) (proto.DeviceInfo, error) SendDeviceCommandResponse(mid int, success bool, body interface{}) error SendDeviceData(deviceIdentifier string, services []proto.Service) error }
func NewConnector ¶
func NewConnector(conf proto.Config, handler MsgHandler) Connector
func NewGateway ¶
func NewGateway(conf proto.Config, handler MsgHandler) Connector
func NewTerminal ¶
func NewTerminal(conf proto.Config, handler MsgHandler) Connector
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
func (*Gateway) GetConnectStatus ¶
func (*Gateway) GetSubDeviceConnectStatus ¶
func (*Gateway) SendDeviceAddWaitResponse ¶
func (g *Gateway) SendDeviceAddWaitResponse(subDevice proto.DeviceInfo) error
func (*Gateway) SendDeviceChangeStatusWaitResponse ¶
func (g *Gateway) SendDeviceChangeStatusWaitResponse(deviceIdentifier string, connectStatus proto.DeviceConnectStatus) error
func (*Gateway) SendDeviceCommandResponse ¶
func (*Gateway) SendDeviceData ¶
func (*Gateway) SendDeviceQueryWaitResponse ¶
func (g *Gateway) SendDeviceQueryWaitResponse(deviceIdentifier string) (proto.DeviceInfo, error)
type MsgHandler ¶
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
func (*Terminal) GetConnectStatus ¶
func (*Terminal) GetSubDeviceConnectStatus ¶
func (*Terminal) OnConnected ¶
func (*Terminal) SendDeviceAddWaitResponse ¶
func (t *Terminal) SendDeviceAddWaitResponse(deviceInfo proto.DeviceInfo) (err error)
func (*Terminal) SendDeviceChangeStatusWaitResponse ¶
func (t *Terminal) SendDeviceChangeStatusWaitResponse(deviceIdentifier string, connectStatus proto.DeviceConnectStatus) (err error)
func (*Terminal) SendDeviceCommandResponse ¶
func (*Terminal) SendDeviceData ¶
func (*Terminal) SendDeviceQueryWaitResponse ¶
func (t *Terminal) SendDeviceQueryWaitResponse(deviceIdentifier string) (deviceInfo proto.DeviceInfo, err error)
Click to show internal directories.
Click to hide internal directories.