Merge remote-tracking branch 'cmaglie/fix-read-close-deadlock' into v1

This commit is contained in:
Cristian Maglie
2016-11-27 21:30:58 +01:00
5 changed files with 243 additions and 7 deletions

View File

@@ -119,6 +119,8 @@ const (
InvalidStopBits
// ErrorEnumeratingPorts an error occurred while listing serial port
ErrorEnumeratingPorts
// PortClosed the port has been closed while the operation is in progress
PortClosed
)
// EncodedErrorString returns a string explaining the error code
@@ -142,6 +144,8 @@ func (e PortError) EncodedErrorString() string {
return "Port stop bits invalid or not supported"
case ErrorEnumeratingPorts:
return "Could not enumerate serial ports"
case PortClosed:
return "Port has been closed"
default:
return "Other error"
}