Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISServer ¶
type ISServer interface {
Start()
Stop()
AddSensor(Sensor)
RemoveSensor(Sensor)
Write(Sensor, []byte)
}
* * 服务器 *
type ISensor ¶
type ISensor interface {
Sn() string // 获取编号
Session() Session // 会话
Ping() []byte // PING包
OnRegister(sn string) error // 注册成功
OnLine() // 上线
OffLine() // 掉线
OnError(error) // 出错
OnData([]byte) // 来数据
}
* * 传感器接口 *
type Sensor ¶
type Sensor struct {
Authed bool
// contains filtered or unexported fields
}
func (*Sensor) OnRegister ¶
type SensorServer ¶
type SensorServer struct {
// contains filtered or unexported fields
}
func NewSensorServer ¶
func NewSensorServer() *SensorServer
func (*SensorServer) PluginMetaInfo ¶
func (hh *SensorServer) PluginMetaInfo() typex.XPluginMetaInfo
func (*SensorServer) Service ¶
func (cs *SensorServer) Service(arg typex.ServiceArg) typex.ServiceResult
* * 服务调用接口 *
func (*SensorServer) Stop ¶
func (dm *SensorServer) Stop() error
type SensorWorker ¶
type SensorWorker struct {
Ctx context.Context
Cancel context.CancelFunc
// contains filtered or unexported fields
}
* * 设备的工作进程 *
func (*SensorWorker) Run ¶
func (w *SensorWorker) Run()
Click to show internal directories.
Click to hide internal directories.