12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package protocal
- type Protocol string
- // MQTT mqtt接入协议
- const MQTT Protocol = "mqtt"
- type DevReport struct {
- Action string `json:"action"`
- MsgId int64 `json:"msgId"`
- SubDeviceId string `json:"subDeviceId"`
- DeviceCode string `json:"deviceCode"`
- TimeStamp int64 `json:"timeStamp"`
- Data *Data `json:"data"`
- }
- type Data struct {
- Cmd string `json:"cmd"`
- Params interface{} `json:"params"`
- }
- type CloudSend struct {
- Action string `json:"action"`
- DeviceCode string `json:"deviceCode"`
- SubDeviceId string `json:"subDeviceId"`
- MsgId int `json:"msgId"`
- Timestamp int `json:"timestamp"`
- Data *Data `json:"data"`
- }
- // DevLogin 子设备上线
- type DevLogin struct {
- Action string `json:"action"`
- MsgId int `json:"msgId"`
- DeviceCode string `json:"deviceCode"`
- SubDeviceId string `json:"subDeviceId"`
- Timestamp int64 `json:"timestamp"`
- }
- // DevLogout 子设备下线
- type DevLogout struct {
- Action string `json:"action"`
- MsgId int `json:"msgId"`
- DeviceCode string `json:"deviceCode"`
- SubDeviceId string `json:"subDeviceId"`
- Timestamp int64 `json:"timestamp"`
- }
|