devicemanager.go 1.5 KB

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