diff --git a/serialport.go b/serialport.go index ccfb160..fb9d5cf 100755 --- a/serialport.go +++ b/serialport.go @@ -437,7 +437,8 @@ func spHandlerOpen(portname string, baud int, buftype string, isSecondary bool) log.Print("Error opening port " + err.Error()) //h.broadcastSys <- []byte("Error opening port. " + err.Error()) h.broadcastSys <- []byte("{\"Cmd\":\"OpenFail\",\"Desc\":\"Error opening port. " + err.Error() + "\",\"Port\":\"" + conf.Name + "\",\"Baud\":" + strconv.Itoa(conf.Baud) + "}") - + spIsOpening = false + spmutex.Unlock() return } log.Print("Opened port successfully")