Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 保活时间 KEEPALIVE = 10 // S3 Endpoint S3ENDPOINT = "https://ossnucloud.nuctech.com" // 证书内容 CERT = `` /* 1382-byte string literal not displayed */ )
定义常量
Variables ¶
This section is empty.
Functions ¶
func NewIotClient ¶
func NewIotClient(DeviceReg m.DeviceRegistrationReq, DeviceStg m.DeviceStorage, MqttInfo m.MqttBrokerInfo) *nucIotClient
@title NewIotClient @description 初始化nucIotClient @param DeviceReg m.DeviceRegistrationReq 设备注册信息 @param DeviceStg m.DeviceStorage 存储相关信息 @param MqttInfo m.MqttBrokerInfo Mqtt相关信息 @return NucIotClient NucIotClient实例
Types ¶
type NucIotClient ¶
type NucIotClient interface { // 配置初始化 Configure() // 设备注册 SendRegistration() int // 设备运行信息 SendDeviceData(dataItems []m.DataItem) // 设备状态 SendDeviceStat(status int) // 文件信息 SendFileInfo(fileName, filePath string, fileSize int, fileType m.EnumFileType) // 上传文件到S3 UploadFileToS3(filePath string, fileType m.EnumFileType) // 注册事件 RegisterEvent(name m.EnumEvent, callback func(args ...interface{})) // 上报属性 SendProperty(body interface{}) // 上报属性透传 SendPropertyRaw(raw string) // 上报事件 SendEvent(identifier string, body interface{}) // 上报事件透传 SendEventRaw(identifier string, raw string) // 参数设置回复 SendPropertySetReply(code int, msg string, sessionId string) // 服务调用响应 SendServiceCallReply(identifier string, code int, msg string, body interface{}, sessionId string) }
NucIotClient IoT客户端接口
Click to show internal directories.
Click to hide internal directories.