Documentation
¶
Index ¶
- func CheckIsSetting(ctx *transport.Context, deviceCode string) map[string]interface{}
- func CheckIsUpgradePatch(ctx *transport.Context, deviceCode string) *managev1.UpgradePatch
- func ReplyMqttDevice(ctx *transport.Context, deviceConfig *managev1.DeviceConfig, needReply bool, ...)
- func ResolvePicData(ctx *transport.Context, msg *vulcanus.DeviceMsg, deviceData *gjson.Result, ...) bool
- func ResolveSetting(ctx *transport.Context, msg *vulcanus.DeviceMsg, deviceData *gjson.Result)
- func ResolveState(deviceConfig *managev1.DeviceConfig, deviceData *gjson.Result, time string)
- func ResolveUpgradeReply(ctx *transport.Context, msg *vulcanus.DeviceMsg, deviceData *gjson.Result)
- func SendSettingInfo(ctx *transport.Context, deviceConfig *managev1.DeviceConfig, ...)
- func SendUpgradePatch(ctx *transport.Context, msg *vulcanus.DeviceMsg, ...)
- type MqttReplyContent
- type ReplyContent
- type Server
- type ServerOption
- type SettingReply
- type UpgradeReplyContent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIsSetting ¶
CheckIsSetting 检查是否有需要下发的配置
func CheckIsUpgradePatch ¶
func CheckIsUpgradePatch(ctx *transport.Context, deviceCode string) *managev1.UpgradePatch
CheckIsUpgradePatch 检查是否有升级任务
func ReplyMqttDevice ¶
func ReplyMqttDevice(ctx *transport.Context, deviceConfig *managev1.DeviceConfig, needReply bool, c interface{})
ReplyMqttDevice 回复MQTT连接的设备
func ResolvePicData ¶
func ResolvePicData(ctx *transport.Context, msg *vulcanus.DeviceMsg, deviceData *gjson.Result, picData []byte) bool
ResolvePicData 解析图片数据
func ResolveSetting ¶
ResolveSetting 解析设备状态回复
func ResolveState ¶
func ResolveState(deviceConfig *managev1.DeviceConfig, deviceData *gjson.Result, time string)
ResolveState 解析设备状态数据
func ResolveUpgradeReply ¶
ResolveUpgradeReply 解析设备升级回复
func SendSettingInfo ¶
func SendSettingInfo(ctx *transport.Context, deviceConfig *managev1.DeviceConfig, settingInfo map[string]interface{})
SendSettingInfo 发送配置数据包 param: settingInfo 包含 type 和 synInf 字段
func SendUpgradePatch ¶
func SendUpgradePatch(ctx *transport.Context, msg *vulcanus.DeviceMsg, upgradePatch *managev1.UpgradePatch)
SendUpgradePatch 发送设备升级包
Types ¶
type MqttReplyContent ¶
type MqttReplyContent struct {
Data interface{} `json:"data"`
}
type ReplyContent ¶
type ReplyContent struct {
Id string `mapstructure:"id" json:"id"` // 设备码
Time string `mapstructure:"time" json:"time"` // 回复时间
Type int `mapstructure:"type" json:"type"` // 类型
SynInf int64 `mapstructure:"synInf" json:"synInf"` // 同步码
Err int `mapstructure:"err" json:"err"` // 没有错误 0 数据错误 1
Connect int `mapstructure:"connect" json:"connect"` // 是否继续通信 0 结束通信 1继续通信
}
func NewReplyContent ¶
func NewReplyContentSimple ¶
func NewReplyContentSimple(id string, _type int) *ReplyContent
type Server ¶
Server is an MQTT Consumer wrapper.
func NewServer ¶
func NewServer(ctx *transport.Context, cs []vulcanus.MqttCodec, hs []vulcanus.DataHandler, opts ...ServerOption) *Server
NewServer creates a MQTT consumer by options.
type ServerOption ¶
type ServerOption func(*Server)
type SettingReply ¶
type UpgradeReplyContent ¶
Click to show internal directories.
Click to hide internal directories.