Example #1
0
        private string GetSerialErrText(SerialErrorCode code)
        {
            switch (code)
            {
            case SerialErrorCode.None: return(this.GetText(MsgCode.None));

            case SerialErrorCode.NotFound: return(this.GetText(MsgCode.NotFound));

            case SerialErrorCode.NotConnected: return(this.GetText(MsgCode.NotConnected));

            case SerialErrorCode.ReadFailure: return(this.GetText(MsgCode.ReadFailure));

            case SerialErrorCode.WriteFailure: return(this.GetText(MsgCode.WriteFailue));

            case SerialErrorCode.Unknown: return(this.GetText(MsgCode.UnknownError));

            //case SerialErrorCode.RetrieveFailed: return this.GetText(MsgCode.);
            default:
                return(code.ToString().CamelCaseToSpaces());
            }
        }
 public SerialUsbError(SerialErrorCode code)
 {
     this.Code = code;
 }
 public SerialUsbError(string portName, SerialErrorCode code)
 {
     this.PortName = portName;
     this.Code     = code;
 }