devicemanager.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. Desc string
  64. Config string
  65. Time time.Time
  66. }
  67. type ArgsGetAllScene struct {
  68. Code string
  69. Pi int
  70. Ps int
  71. }
  72. type ReplyScene struct {
  73. Config string
  74. }
  75. type ReplyScenes struct {
  76. Total int
  77. Result []*scene.InfoScene
  78. }