devicemanager.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package rpcs
  2. import (
  3. "sparrow/pkg/deviceAlarm"
  4. "sparrow/pkg/online"
  5. "sparrow/pkg/scene"
  6. "time"
  7. )
  8. type ArgsGenerateDeviceAccessToken ArgsDeviceId
  9. type ReplyGenerateDeviceAccessToken struct {
  10. AccessToken []byte
  11. }
  12. type ArgsValidateDeviceAccessToken struct {
  13. Id string
  14. AccessToken []byte
  15. }
  16. type ReplyValidateDeviceAccessToken ReplyEmptyResult
  17. type ArgsGetOnline struct {
  18. Id string
  19. ClientIP string
  20. AccessRPCHost string
  21. HeartbeatInterval uint32
  22. }
  23. type ReplyGetOnline ReplyEmptyResult
  24. type ArgsGetOffline struct {
  25. Id string
  26. VendorId string
  27. }
  28. type ReplyGetOffline ReplyEmptyResult
  29. type ArgsHeartBeat struct {
  30. Id string
  31. }
  32. type ReplyHeartBeat ReplyEmptyResult
  33. type ArgsGetDeviceOnlineStatus ArgsDeviceId
  34. type ReplyGetDeviceOnlineStatus online.Status
  35. type ArgsOtaFile struct {
  36. FileId int
  37. FileData []byte
  38. }
  39. type ReplyOtaFile struct {
  40. File []byte
  41. }
  42. type ArgsOtaProgress struct {
  43. DeviceId string
  44. Progress int
  45. }
  46. type ReplyOtaProgress struct {
  47. Progress int
  48. }
  49. type ReplyDeviceStatus struct {
  50. Status interface{}
  51. }
  52. type ArgsAlarmInfo deviceAlarm.AlarmParams
  53. type ArgsGetAlarm struct {
  54. DeviceCode string
  55. }
  56. type ReplayAlarm struct {
  57. AlarmParams *deviceAlarm.AlarmParams
  58. }
  59. type ArgsScene struct {
  60. SceneType string
  61. Key string
  62. SceneId string
  63. Name string
  64. ConditionDesc string
  65. ActionDesc string
  66. Config string
  67. Status int
  68. Time time.Time
  69. }
  70. type ArgsGetAllScene struct {
  71. Code string
  72. Pi int
  73. Ps int
  74. }
  75. type ReplyScene struct {
  76. Config string
  77. }
  78. type ReplyScenes struct {
  79. Total int
  80. Result []*scene.InfoScene
  81. }