IOTMQTT

package
v5.1.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//MQTTClient mqtt对象
	MQTTClient CoreMQTTSimple.MQTTSimple
	//MQTTIsConnect mqtt初始化和连接标记
	MQTTIsConnect = false

	//OpenBaseMission 是否启动任务广播环节
	OpenBaseMission = true
)

Functions

func AppendSubFunc

func AppendSubFunc(sF func())

AppendSubFunc 写入等待订阅函数包

func CheckDeviceAndOrg

func CheckDeviceAndOrg(message mqtt.Message, resultData interface{}) (b bool)

CheckDeviceAndOrg 组织专用检查程序 * 1. 解析数据 2. 检查设备key是否正确 3. 检查设备授权给组织情况

func DeletePushWait

func DeletePushWait(mark string)

DeletePushWait 删除等待数据

func DeleteSearchPushWait

func DeleteSearchPushWait(mark string)

func PushAppUpdate

func PushAppUpdate(groupMark, deviceCode string, appMark string, data ToolsAppUpdate.FieldsUpdate) (err error)

PushAppUpdate 推送设备更新数据

func PushDeviceBind

func PushDeviceBind(deviceID int64) (err error)

PushDeviceBind 推送设备所有绑定关系

func PushDeviceNeedGroup

func PushDeviceNeedGroup(groupMark string, args ArgsPushDeviceNeedGroup) (err error)

PushDeviceNeedGroup 主动更新设备组信息

func PushDeviceNeedInfo

func PushDeviceNeedInfo(groupMark, deviceCode string, args ArgsPushDeviceNeedInfo) (err error)

PushDeviceNeedInfo 主动更新设备信息

func PushDeviceNeedInfoByID

func PushDeviceNeedInfoByID(deviceID int64) error

PushDeviceNeedInfoByID 使用设备ID推送设备更新

func PushDeviceRest

func PushDeviceRest(deviceID int64)

PushDeviceRest 请求重启设备

func PushDeviceUpdateOnline

func PushDeviceUpdateOnline(groupMark, deviceCode string) (err error)

PushDeviceUpdateOnline 要求设备更新设备在线状态

func PushMissionToDevice

func PushMissionToDevice(args *ArgsPushMissionToDevice) (err error)

PushMissionToDevice 推送新的任务 device/mission

func PushMissionToGroup

func PushMissionToGroup(args ArgsPushMissionToGroup) (err error)

PushMissionToGroup 推送新的任务到分组

func PushOperate

func PushOperate(groupMark, deviceCode string, deviceID int64) (err error)

func PushUpdateData

func PushUpdateData(orgID int64, action string, updateID int64) (err error)

PushUpdateData 全局通知业务层面的更新处理 * 1. 根据组织ID来进行通告 2. 业务设备收到信息后,根据ID或进行业务层面的强制更新数据

func PushWait

func PushWait(mark string, topic string, qos byte, data []byte)

PushWait 推送新的MQTT到列队

func PushWeather

func PushWeather(groupMark, deviceCode string, country int, city int, dataCount int) (err error)

PushWeather 推送给设备天气预报信息

func Run

func Run()

func SubBefore

func SubBefore(keys IOTDevice.ArgsCheckDeviceKey, orgID int64, logAppend interface{}) (deviceID int64, operateData IOTDevice.FieldsOperate, b bool)

SubBefore 检查商户的所有权等一揽子前缀处理

Types

type ArgsPushDeviceNeedGroup

type ArgsPushDeviceNeedGroup struct {
	GroupData IOTDevice.FieldsGroup `json:"groupData"`
}

ArgsPushDeviceNeedGroup 主动更新设备组信息参数

type ArgsPushDeviceNeedInfo

type ArgsPushDeviceNeedInfo struct {
	DeviceData IOTDevice.FieldsDevice `json:"deviceData"`
}

ArgsPushDeviceNeedInfo 主动更新设备信息参数

type ArgsPushMissionToDevice

type ArgsPushMissionToDevice struct {
	//设备ID
	ID int64 `json:"id"`
	//任务ID
	MissionID int64 `json:"missionID"`
	//过期时间
	ExpireAt time.Time `json:"expireAt"`
	//任务动作
	Action string `json:"action"`
	//发送请求数据集合
	ParamsData []byte `json:"paramsData"`
}

ArgsPushMissionToDevice 推送新的任务参数

type ArgsPushMissionToGroup

type ArgsPushMissionToGroup struct {
	//设备ID
	ID int64 `json:"id"`
	//任务ID
	MissionID int64 `json:"missionID"`
	//分组ID
	GroupID int64 `json:"groupID"`
	//过期时间
	ExpireAt time.Time `json:"expireAt"`
	//任务动作
	Action string `json:"action"`
	//发送请求数据集合
	ParamsData []byte `json:"paramsData"`
}

ArgsPushMissionToGroup 推送新的任务到分组参数

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL