devicemanager.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. Key string
  61. SceneId string
  62. Name string
  63. ConditionDesc string
  64. ActionDesc string
  65. Config string
  66. Time time.Time
  67. }
  68. type ArgsGetAllScene struct {
  69. Code string
  70. Pi int
  71. Ps int
  72. }
  73. type ReplyScene struct {
  74. Config string
  75. }
  76. type ReplyScenes struct {
  77. Total int
  78. Result []*scene.InfoScene
  79. }