Documentation ¶
Index ¶
Constants ¶
View Source
const ( ActionConnected = "connected" ActionDisconnected = "disconnected" )
View Source
const ( // TopicConnectStatus emqx 客户端上下线通知 参考: https://docs.emqx.com/zh/enterprise/v4.4/advanced/system-topic.html#客户端上下线事件 TopicConnectStatus = ShareSubTopicPrefix + "$SYS/brokers/+/clients/#" TopicThing = ShareSubTopicPrefix + devices.TopicHeadThing + "/#" TopicOta = ShareSubTopicPrefix + devices.TopicHeadOta + "/#" TopicConfig = ShareSubTopicPrefix + devices.TopicHeadConfig + "/#" TopicSDKLog = ShareSubTopicPrefix + devices.TopicHeadLog + "/#" TopicShadow = ShareSubTopicPrefix + devices.TopicHeadShadow + "/#" TopicGateway = ShareSubTopicPrefix + devices.TopicHeadGateway + "/#" )ShareSubTopicPrefix = "$share/dd.rpc/"
Variables ¶
This section is empty.
Functions ¶
func Check ¶
func Check(conf conf.DevLinkConf) error
Types ¶
type ConnectMsg ¶
type ConnectMsg struct { UserName string `json:"username"` Ts int64 `json:"ts"` Address string `json:"ipaddress"` ClientID string `json:"clientid"` Reason string `json:"reason"` }
登录登出消息
type DevSubHandle ¶
type DevSubHandle interface { // Ota ota远程升级 Ota(topic string, payload []byte) error // Config 设备远程配置 Config(topic string, payload []byte) error // Shadow 设备影子 Shadow(topic string, payload []byte) error // Log 设备调试日志 SDKLog(topic string, payload []byte) error // Gateway 网关子设备 Gateway(topic string, payload []byte) error // Thing 物模型消息 Thing(topic string, payload []byte) error Connected(out *devices.DevConn) error Disconnected(out *devices.DevConn) error }
type Handle ¶
type Handle func(ctx context.Context) DevSubHandle
type MqttClient ¶
type MqttClient struct {
// contains filtered or unexported fields
}
func (*MqttClient) SubDevMsg ¶
func (d *MqttClient) SubDevMsg(handle Handle) error
Click to show internal directories.
Click to hide internal directories.