Improved error reporting for parity settings

This commit is contained in:
Cristian Maglie
2016-10-22 15:48:43 +02:00
parent a3909960d3
commit c534e6fb45
2 changed files with 12 additions and 0 deletions

View File

@@ -94,6 +94,8 @@ const (
InvalidSpeed
// InvalidDataBits the number of data bits is not valid or not supported
InvalidDataBits
// InvalidParity the selected parity is not valid or not supported
InvalidParity
// ErrorEnumeratingPorts an error occurred while listing serial port
ErrorEnumeratingPorts
)
@@ -113,6 +115,8 @@ func (e PortError) EncodedErrorString() string {
return "Invalid port speed"
case InvalidDataBits:
return "Invalid port data bits"
case InvalidParity:
return "Port parity invalid or not supported"
case ErrorEnumeratingPorts:
return "Could not enumerate serial ports"
default: