Package jssc
Class SerialPortException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- jssc.SerialPortException
-
- All Implemented Interfaces:
Serializable
public class SerialPortException extends Exception
- Author:
- scream3r
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringTYPE_CANT_REMOVE_LISTENERCan't remove event listenerstatic StringTYPE_CANT_SET_MASKCan't set maskstatic StringTYPE_INCORRECT_SERIAL_PORTstatic StringTYPE_LISTENER_ALREADY_ADDEDEvent listener already addedstatic StringTYPE_LISTENER_THREAD_INTERRUPTEDEvent listener thread interruptedstatic StringTYPE_NATIVE_EXCEPTIONException occurred in native codestatic StringTYPE_NULL_NOT_PERMITTEDstatic StringTYPE_PARAMETER_IS_NOT_CORRECTstatic StringTYPE_PERMISSION_DENIEDstatic StringTYPE_PORT_ALREADY_OPENEDPort already openedstatic StringTYPE_PORT_BUSYstatic StringTYPE_PORT_NOT_FOUNDstatic StringTYPE_PORT_NOT_OPENEDPort not opened
-
Constructor Summary
Constructors Constructor Description SerialPortException(String portName, String methodName, String exceptionType)Deprecated.SerialPortException(SerialPort port, String methodName, String exceptionType)Constructs a newSerialPortException
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetExceptionType()Getting exception typeStringgetMethodName()Gets the method name during execution of which the exception was calledSerialPortgetPort()Gets theSerialPortwhich threw the exceptionStringgetPortName()Deprecated.static SerialPortExceptionwrapNativeException(Exception ex, SerialPort port, String methodName)-
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
TYPE_PORT_ALREADY_OPENED
public static final String TYPE_PORT_ALREADY_OPENED
Port already opened- See Also:
- Constant Field Values
-
TYPE_PORT_NOT_OPENED
public static final String TYPE_PORT_NOT_OPENED
Port not opened- See Also:
- Constant Field Values
-
TYPE_CANT_SET_MASK
public static final String TYPE_CANT_SET_MASK
Can't set mask- See Also:
- Constant Field Values
-
TYPE_LISTENER_ALREADY_ADDED
public static final String TYPE_LISTENER_ALREADY_ADDED
Event listener already added- See Also:
- Constant Field Values
-
TYPE_LISTENER_THREAD_INTERRUPTED
public static final String TYPE_LISTENER_THREAD_INTERRUPTED
Event listener thread interrupted- See Also:
- Constant Field Values
-
TYPE_CANT_REMOVE_LISTENER
public static final String TYPE_CANT_REMOVE_LISTENER
Can't remove event listener- See Also:
- Constant Field Values
-
TYPE_PARAMETER_IS_NOT_CORRECT
public static final String TYPE_PARAMETER_IS_NOT_CORRECT
- Since:
- 0.8
- See Also:
- Constant Field Values
-
TYPE_NULL_NOT_PERMITTED
public static final String TYPE_NULL_NOT_PERMITTED
- Since:
- 0.8
- See Also:
- Constant Field Values
-
TYPE_PORT_BUSY
public static final String TYPE_PORT_BUSY
- Since:
- 0.9.0
- See Also:
- Constant Field Values
-
TYPE_PORT_NOT_FOUND
public static final String TYPE_PORT_NOT_FOUND
- Since:
- 0.9.0
- See Also:
- Constant Field Values
-
TYPE_PERMISSION_DENIED
public static final String TYPE_PERMISSION_DENIED
- Since:
- 2.2.0
- See Also:
- Constant Field Values
-
TYPE_INCORRECT_SERIAL_PORT
public static final String TYPE_INCORRECT_SERIAL_PORT
- Since:
- 2.3.0
- See Also:
- Constant Field Values
-
TYPE_NATIVE_EXCEPTION
public static final String TYPE_NATIVE_EXCEPTION
Exception occurred in native code- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SerialPortException
public SerialPortException(SerialPort port, String methodName, String exceptionType)
Constructs a newSerialPortException- Parameters:
port- Port which the exception occurred onmethodName- Method name which the exception occurred onexceptionType- AnySerialPortException.TYPE_*
-
SerialPortException
@Deprecated public SerialPortException(String portName, String methodName, String exceptionType)
Deprecated.Constructs a newSerialPortExceptionDeprecated: UseSerialPortTimeoutException(SerialPort, String, String)instead.- Parameters:
portName- Port which the exception occurred onmethodName- Method name which the exception occurred onexceptionType- AnySerialPortException.TYPE_*- See Also:
SerialPortException(SerialPort, String, String)
-
-
Method Detail
-
wrapNativeException
public static SerialPortException wrapNativeException(Exception ex, SerialPort port, String methodName)
-
getPortName
@Deprecated public String getPortName()
Deprecated.Getting port name during operation with which the exception was called Deprecated: UsegetPort().getName()instead.- Returns:
- Port name
-
getPort
public SerialPort getPort()
Gets theSerialPortwhich threw the exception- Returns:
SerialPortobject
-
getMethodName
public String getMethodName()
Gets the method name during execution of which the exception was called- Returns:
- Calling method name
-
getExceptionType
public String getExceptionType()
Getting exception type- Returns:
- a value from
SerialPortException.TYPE_*or a customStringvalue if provided
-
-