sagooProtocol

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: LGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//平台服务调用请求topic /sys/${productKey}/${devicekey}/thing/service/${tsl.service.identifier}
	ServiceCallRegisterSubRequestTopic = "/sys/+/+/thing/service/+"
	//平台服务调用响应求topic /sys/${productKey}/${devicekey}/thing/service/${tsl.service.identifier}_reply
	//这里的请求和响应是不相同的,响应是最后的后缀reply结尾,需要注意
	ServiceCallRegisterSubResponseTopic = "/sys/+/+/thing/service/+"

	//平台设置属性请求topic /sys/${productKey}/${deviceKey}/thing/service/property/set
	PropertySetRegisterSubRequestTopic = "/sys/+/+/thing/service/property/set"
	//平台设置属性响应topic(设备端响应) /sys/${productKey}/thing/service/property/set_reply
	PropertySetRegisterSubResponseTopic = "/sys/+/+/thing/service/property/set_reply"

	//平台下发配置请求topic /sys/${productKey}/${deviceKey}/thing/config/push
	ConfigPushRegisterSubRequestTopic = "/sys/+/+/thing/config/push"
	//平台下发配置响应topic /sys/${productKey}/${deviceKey}/thing/config/push/reply
	ConfigPushRegisterSubResponseTopic = "/sys/+/+/thing/config/push/reply"
)

平台下发topic

View Source
const (
	//设备上报属性请求topic /sys/${productKey}/${deviceKey}/thing/event/property/post
	PropertyRegisterSubRequestTopic = "/sys/+/+/thing/event/property/post"
	//设备上报属性响应topic(平台响应) /sys/${productKey}/${deviceKey}/thing/event/property/post_reply
	PropertyRegisterPubResponseTopic = "/sys/+/+/thing/event/property/post_reply"

	//设备上报事件请求topic /sys/${productKey}/${deviceKey}/thing/event/${tsl.event.identifier}/post
	EventRegisterSubRequestTopic = "/sys/+/+/thing/event/+/post"
	//设备上报事件响应topic(平台响应) /sys/${productKey}/${deviceKey}/thing/event/${tsl.event.identifier}_reply
	EventRegisterPubResponseTopic = "/sys/+/+/thing/event/+/post_reply"

	// 设备上报批量属性请求topic /sys/${productKey}/${deviceKey}/thing/event/property/pack/post
	BatchRegisterSubRequestTopic = "/sys/+/+/thing/event/property/pack/post"
	// 设备上报批量属性响应topic(平台响应) /sys/${productKey}/${deviceKey}/thing/event/property/pack/post_reply
	BatchRegisterPubResponseTopic = "/sys/+/+/thing/event/property/pack/post_reply"

	//设备主动请求配置信息(设备端发起) /sys/${productKey}/${deviceKey}/thing/config/get
	ConfigGetRequestTopic = "/sys/+/+/thing/config/get"
	//设备主动请求配置信息(平台响应) /sys/${productKey}/${deviceKey}/thing/config/get_reply
	ConfigGetResponseTopic = "/sys/+/+/thing/config/get_reply"
)
View Source
const (
	//设备上报版本信息topic(设备端发起) /ota/device/inform/${productKey}/${deviceKey}
	OtaDeviceInformVersionInfoTopic = "/ota/device/inform/+/+"
	//上报ota升级进度(设备端发起) /ota/device/progress/${productKey}/${deviceKey}
	OtaUpgradeProgressTopic = "/ota/device/progress/+/+"

	//设备请求OTA升级包信息(设备端发起) /sys/${productKey}/${deviceKey}/thing/ota/firmware/get
	OtaDeviceRequestUpgradePackageRequestTopic  = "/sys/+/+/thing/ota/firmware/get"
	OtaDeviceRequestUpgradePackageResponseTopic = "/sys/+/+/thing/ota/firmware/get_reply"

	//设备请求下载文件分片(设备端发起) /sys/${productKey}/${deviceKey}/thing/file/download
	OtaDeviceRequestDownloadFileRequestTopic  = "/sys/+/+/thing/file/download"
	OtaDeviceRequestDownloadFileResponseTopic = "/sys/+/+/thing/file/download_reply"
)

设备上报

View Source
const (
	NeedAck = 1
)
View Source
const (
	//推送ota升级包(平台侧发起)/ota/device/upgrade/${productKey}/${deviceKey}
	OtaUpgradeCommandTopic = "/ota/device/upgrade/+/+"
)

平台下发

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigGetRequest

type ConfigGetRequest struct {
	Id      string `json:"id"`
	Version string `json:"version"`
	Sys     struct {
		Ack int `json:"ack"`
	} `json:"sys"`
	Params struct {
		ConfigScope string `json:"configScope"`
		GetType     string `json:"getType"`
	} `json:"params"`
	Method string `json:"method"`
}

配置获取

type ConfigGetResponse

type ConfigGetResponse struct {
	Id      string                `json:"id"`
	Version string                `json:"version"`
	Code    int                   `json:"code"`
	Data    ConfigGetResponseData `json:"data"`
}

type ConfigGetResponseData

type ConfigGetResponseData struct {
	ConfigId      string `json:"configId"`
	ConfigSize    int    `json:"configSize"`
	Sign          string `json:"sign"`
	SignMethod    string `json:"signMethod"`
	Url           string `json:"url"`
	GetType       string `json:"getType"`
	ConfigContent string `json:"configContent"`
}

type ConfigPushRequest

type ConfigPushRequest struct {
	Id      string                `json:"id"`
	Version string                `json:"version"`
	Params  ConfigPushRequestData `json:"params"`
	Method  string                `json:"method"`
}

配置下发报文

type ConfigPushRequestData

type ConfigPushRequestData struct {
	ConfigId      string `json:"configId"`
	ConfigSize    int    `json:"configSize"`
	ConfigContent string `json:"configContent"`
	Sign          string `json:"sign"`
	SignMethod    string `json:"signMethod"`
	Url           string `json:"url"`
	GetType       string `json:"getType"`
}

type ConfigPushResponse

type ConfigPushResponse struct {
	Code int                    `json:"code"`
	Data map[string]interface{} `json:"data"`
	Id   string                 `json:"id"`
}

配置下发报文响应

type EventNode

type EventNode struct {
	Value      map[string]interface{} `json:"value"`
	CreateTime int64                  `json:"time"`
}

网关批量上报结构体

type GatewayBatchReply

type GatewayBatchReply struct {
	Code int `json:"code"`
	Data struct {
	} `json:"data"`
	Id      string `json:"id"`
	Message string `json:"message"`
	Method  string `json:"method"`
	Version string `json:"version"`
}

网关批量上报响应报文

type GatewayBatchReq

type GatewayBatchReq struct {
	Id      string       `json:"id"`
	Version string       `json:"version"`
	Sys     SysInfo      `json:"sys"`
	Params  PropertyInfo `json:"params"`
	Method  string       `json:"method"`
}

网关批量上报请求报文

type Identity

type Identity struct {
	ProductKey string `json:"productKey"`
	DeviceKey  string `json:"deviceKey"`
}

网关批量上报结构体

type InformRequest

type InformRequest struct {
	Id     string `json:"id"`
	Params struct {
		Version string `json:"version"`
		Module  string `json:"module"`
	} `json:"params"`
}

type ProProgress

type ProProgress struct {
	Id     string            `json:"id"`
	Params ProProgressParams `json:"params"`
}

type ProProgressParams

type ProProgressParams struct {
	Step   string `json:"step"`
	Desc   string `json:"desc"`
	Module string `json:"module"`
}

type PropertyInfo

type PropertyInfo struct {
	Properties map[string]interface{} `json:"properties"`
	Events     map[string]EventNode   `json:"events"`
	SubDevices []Sub                  `json:"subDevices"`
}

网关批量上报结构体

type PropertyNode

type PropertyNode struct {
	Value      interface{} `json:"value"`
	CreateTime int64       `json:"time"`
}

属性节点,包含属性值和时间

type PropertySetRequest

type PropertySetRequest struct {
	Id      string                 `json:"id"`
	Version string                 `json:"version"`
	Params  map[string]interface{} `json:"params"`
	Method  string                 `json:"method"`
}

属性下发平台请求报文

type PropertySetRes

type PropertySetRes struct {
	Code    int                    `json:"code"`
	Data    map[string]interface{} `json:"data"`
	Id      string                 `json:"id"`
	Message string                 `json:"message"`
	Version string                 `json:"version"`
}

属性下发设备响应报文

type ReportEventParams

type ReportEventParams struct {
	Value    map[string]string `json:"value"`
	CreateAt int64             `json:"time"`
}

事件上报结构体

type ReportEventReply

type ReportEventReply struct {
	Code int `json:"code"`
	Data struct {
	} `json:"data"`
	Id      string `json:"id"`
	Message string `json:"message"`
	Method  string `json:"method"`
	Version string `json:"version"`
}

事件上报响应报文

type ReportEventReq

type ReportEventReq struct {
	Id      string            `json:"id"`
	Version string            `json:"version"`
	Sys     SysInfo           `json:"sys"`
	Params  ReportEventParams `json:"params"`
}

事件上报请求报文

type ReportPropertyReply

type ReportPropertyReply struct {
	Code int `json:"code"`
	Data struct {
	} `json:"data"`
	Id      string `json:"id"`
	Message string `json:"message"`
	Method  string `json:"method"`
	Version string `json:"version"`
}

属性上报响应报文

type ReportPropertyReq

type ReportPropertyReq struct {
	Id      string                 `json:"id"`
	Version string                 `json:"version"`
	Sys     SysInfo                `json:"sys"`
	Params  map[string]interface{} `json:"params"`
	Method  string                 `json:"method"`
}

属性上报请求报文

type ServiceCallOutputRes

type ServiceCallOutputRes struct {
	Code    int                    `json:"code"`
	Data    map[string]interface{} `json:"data"`
	Id      string                 `json:"id"`
	Message string                 `json:"message"`
	Version string                 `json:"version"`
}

服务下发响应报文

type ServiceCallRequest

type ServiceCallRequest struct {
	Id      string                 `json:"id"`
	Version string                 `json:"version"`
	Params  map[string]interface{} `json:"params"`
	Method  string                 `json:"method"`
}

服务下发请求报文

type Sub

type Sub struct {
	Identity   Identity               `json:"identity"`
	Properties map[string]interface{} `json:"properties"`
	Events     map[string]EventNode   `json:"events"`
}

网关批量上报结构体

type SysInfo

type SysInfo struct {
	Ack int `json:"ack"`
}

ack 标记是否需要回复,1需要回复,0不需要回复

type UpgradeCommandRequest

type UpgradeCommandRequest struct {
	Code    string                    `json:"code"`
	Data    UpgradeCommandRequestData `json:"data"`
	Id      int                       `json:"id"`
	Message string                    `json:"message"`
}

type UpgradeCommandRequestData

type UpgradeCommandRequestData struct {
	Size       int               `json:"size"`
	Version    string            `json:"version"`
	SignMethod string            `json:"signMethod"`
	DProtocol  string            `json:"dProtocol"`
	Url        string            `json:"url"`
	Sign       string            `json:"sign"`
	Module     string            `json:"module"`
	ExtData    map[string]string `json:"extData"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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