dtu_client.go 422 B

123456789101112131415161718192021222324
  1. package iotStruct
  2. import (
  3. "IotAdmin/core/logger"
  4. "IotAdmin/core/tcpserver"
  5. "sync"
  6. "time"
  7. )
  8. type DtuClient struct {
  9. FD *tcpserver.Client
  10. Config *DtuConfig
  11. Times int64 //心跳计时器
  12. Online bool //在线状态
  13. TmOnline string
  14. TmOffline string
  15. Logger *logger.Helper
  16. MLock sync.Mutex
  17. }
  18. // UpdateTime 更新时间
  19. func (cm *DtuClient) UpdateTime() {
  20. cm.Times = time.Now().Unix()
  21. }