bluetooth_sensing.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package common
  2. // 下发指令
  3. type PublishCmd struct {
  4. Code int `json:"code"`
  5. DeviceName string `json:"deviceName"`
  6. Area string `json:"area"`
  7. Address string `json:"address"`
  8. Action string `json:"action"`
  9. Params string `json:"params"`
  10. Identity string `json:"identity"`
  11. }
  12. // 上报消息外层结构
  13. type UpMsg struct {
  14. ID string `json:"id"`
  15. Method string `json:"method"`
  16. Params UpParam `json:"params"`
  17. Version string `json:"version"`
  18. }
  19. type UpParam struct {
  20. Time int64 `json:"time"`
  21. Value interface{} `json:"value"` // 动态内容,按需解析
  22. }
  23. // 心跳上报 value 结构
  24. type HeartBeatValue struct {
  25. DeviceName string `json:"device_name"`
  26. Area string `json:"area"`
  27. Number string `json:"number"`
  28. UUID string `json:"uuid"`
  29. UpdatedTime string `json:"updated_time"`
  30. Cluster string `json:"cluster"`
  31. }
  32. // 照度上报 value 结构
  33. type AlsValue struct {
  34. DeviceName string `json:"device_name"`
  35. Area string `json:"area"`
  36. Number string `json:"number"`
  37. UUID string `json:"uuid"`
  38. Lux int `json:"lux"`
  39. UpdatedTime string `json:"updated_time"`
  40. }