zhangzengfei
2024-05-17 9e8d8b630affc4a4be428c775264ef4b0e5104b3
service/nvcs.go
@@ -36,7 +36,7 @@
}
// 对接网络视频字符叠加器,接收udp发送的楼层信息, 更新device地址
func NVCSServer() {
func NVCSA1UDPServer() {
   // 指定监听的端口
   port := config.ServeConf.Port
@@ -91,9 +91,13 @@
      }
      elevator := data.Elevator[0]
      elevator.Name = strings.Trim(elevator.Name, " ")
      if elevator.Name == "" {
         continue
      // 程序部署在设备端, 字符叠加器上报的名称允许为空. 在云端, 名称必须与摄像机相同
      if config.ServeConf.Role != "agent" {
         elevator.Name = strings.Trim(elevator.Name, " ")
         if elevator.Name == "" {
            continue
         }
      }
      var d = models.Device{
@@ -112,3 +116,9 @@
      logger.Debug("Received %d bytes from %s, %+v", numBytes, clientAddr, data)
   }
}
func StartNVCSServer() {
   if config.NVCSConf.Model == "A1" {
      go NVCSA1UDPServer()
   }
}