devicemanager.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package rpcs
  2. import (
  3. "sparrow/pkg/deviceAlarm"
  4. "sparrow/pkg/online"
  5. )
  6. type ArgsGenerateDeviceAccessToken ArgsDeviceId
  7. type ReplyGenerateDeviceAccessToken struct {
  8. AccessToken []byte
  9. }
  10. type ArgsValidateDeviceAccessToken struct {
  11. Id string
  12. AccessToken []byte
  13. }
  14. type ReplyValidateDeviceAccessToken ReplyEmptyResult
  15. type ArgsGetOnline struct {
  16. Id string
  17. ClientIP string
  18. AccessRPCHost string
  19. HeartbeatInterval uint32
  20. }
  21. type ReplyGetOnline ReplyEmptyResult
  22. type ArgsGetOffline struct {
  23. Id string
  24. VendorId string
  25. }
  26. type ReplyGetOffline ReplyEmptyResult
  27. type ArgsHeartBeat struct {
  28. Id string
  29. }
  30. type ReplyHeartBeat ReplyEmptyResult
  31. type ArgsGetDeviceOnlineStatus ArgsDeviceId
  32. type ReplyGetDeviceOnlineStatus online.Status
  33. type ArgsOtaFile struct {
  34. FileId int
  35. FileData []byte
  36. }
  37. type ReplyOtaFile struct {
  38. File []byte
  39. }
  40. type ArgsOtaProgress struct {
  41. DeviceId string
  42. Progress int
  43. }
  44. type ReplyOtaProgress struct {
  45. Progress int
  46. }
  47. type ReplyDeviceStatus struct {
  48. Status interface{}
  49. }
  50. type ArgsAlarmInfo deviceAlarm.AlarmParams
  51. type ArgsGetAlarm struct {
  52. DeviceCode string
  53. }
  54. type ReplayAlarm struct {
  55. AlarmParams *deviceAlarm.AlarmParams
  56. }