structs.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. package services
  2. type BaseArgs struct {
  3. IMEI string
  4. }
  5. type EmptyResult struct{}
  6. type GPSInfoReply struct {
  7. Lat float64
  8. Lng float64
  9. }
  10. type SetDTUModeArgs struct {
  11. BaseArgs
  12. Mode int // 模式
  13. Channel int // 通道
  14. }
  15. type DTUModeReply struct {
  16. Channel1 int // 通道1
  17. Channel2 int // 通道2
  18. Channel3 int // 通道3
  19. Channel4 int // 通道4
  20. }
  21. type ServerAddrArgs struct {
  22. BaseArgs
  23. Channel int // 通道
  24. LinkType string // 连接类型
  25. Ip string // Ip或域名
  26. Port int // 端口
  27. }
  28. type ServerAddrReply struct {
  29. Addrs []*Addr
  30. }
  31. type Addr struct {
  32. Channel int // 通道
  33. LinkType string // 连接类型
  34. Addr string // IP或域名
  35. Port int // 端口
  36. }
  37. type UARTArgs struct {
  38. BaseArgs
  39. Rate int // 波特率
  40. DBit int // 数据位
  41. CBit int // 校验位
  42. SBit int // 停止位
  43. }
  44. type UARTReply struct {
  45. Rate int // 波特率
  46. DBit int // 数据位
  47. CBit int // 校验位
  48. SBit int // 停止位
  49. }
  50. type DTUIDArgs struct {
  51. BaseArgs
  52. Mode int
  53. IdType int
  54. Format int
  55. Content string
  56. Channel int
  57. }
  58. type DTUIDReply struct {
  59. DTUIDs []*DTUID
  60. }
  61. type DTUID struct {
  62. Mode int
  63. IdType int
  64. Format int
  65. Content string
  66. Channel int
  67. }
  68. type KeepAliveArgs struct {
  69. BaseArgs
  70. Duration int // 心跳间隔
  71. Format int // 数据格式
  72. Content string // 心跳包内容
  73. Channel int // 通道
  74. }
  75. type KeepAliveReply struct {
  76. Channels []*KeepAlive
  77. }
  78. type KeepAlive struct {
  79. Duration int // 心跳间隔
  80. Format int // 数据格式
  81. Content string // 心跳包内容
  82. Channel int // 通道
  83. }
  84. type PollArgs struct {
  85. BaseArgs
  86. Sw int // 是否使能
  87. Duration int // 轮询间隔
  88. Format int // 内容格式
  89. }
  90. type PollReply struct {
  91. Sw int // 是否使能
  92. Duration int // 轮询间隔
  93. Format int // 内容格式
  94. }
  95. type PollStrArgs struct {
  96. BaseArgs
  97. Index int // 轮询字串号,取值范围 1-10
  98. Sw int // 字串轮询使能
  99. Crc int // CRC使能
  100. Content string // 轮询内容
  101. }
  102. type PollStrReply struct {
  103. Strings []*PollStr
  104. }
  105. type PollStr struct {
  106. Sw int // 字串轮询使能
  107. Crc int // CRC使能
  108. Content string // 轮询内容
  109. }