代码拉取完成,页面将自动刷新
package subDev
import (
"context"
"fmt"
"gitee.com/unitedrhino/share/conf"
"gitee.com/unitedrhino/share/devices"
)
type (
SubDev interface {
SubDevMsg(handle Handle) error
}
Handle func(ctx context.Context) DevSubHandle
DevSubHandle interface {
ExtMsg(topic string, payload []byte) error
Msg(topic string, payload []byte) error
Connected(out *devices.DevConn) error
Disconnected(out *devices.DevConn) error
}
)
func Check(conf conf.DevLinkConf) error {
if conf.Mqtt == nil {
return fmt.Errorf("DevLinkConf need")
}
return nil
}
func NewSubDev(conf conf.DevLinkConf) (SubDev, error) {
if err := Check(conf); err != nil {
return nil, err
}
return newEmqClient(conf.Mqtt)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。