| | |
| | | |
| | | var ( |
| | | mapCameraInfo = make(map[string]CameraInfo) |
| | | |
| | | tcp = `tcp://192.168.1.124:` |
| | | port = 7001 |
| | | ) |
| | | |
| | | func recvCameraInfoFromIPC(ctx context.Context, url string, ch chan<- CameraInfo) { |
| | |
| | | |
| | | ch <- c |
| | | |
| | | msgIpc := MsgIPC{"new decoder", port} |
| | | msgIpc := MsgIPC{"new decoder", 0} |
| | | if b, err := json.Marshal(msgIpc); err == nil { |
| | | ipc.Send(b) |
| | | } |
| | |
| | | ctx, cancel := context.WithCancel(context.Background()) |
| | | |
| | | ch := make(chan CameraInfo) |
| | | // tcpURL := tcp + strconv.Itoa(port) |
| | | // port++ |
| | | |
| | | tcp := `` |
| | | port := 7001 |
| | | |
| | | if strings.Index(ipcURL, "tcp://") == 0 { |
| | | i := strings.LastIndex(ipcURL, ":") |
| | | tcp = ipcURL[0 : i+1] |
| | | |
| | | strPort := ipcURL[i+1:] |
| | | port, _ = strconv.Atoi(strPort) |
| | | port++ |
| | | } |
| | | |
| | | go recvCameraInfoFromIPC(ctx, ipcURL, ch) |
| | | |
| | | for { |