public class GPIOException
extends java.lang.Exception
The exception stores information of which GPIO caused it and the type of exception thrown.
Modifier and Type | Field and Description |
---|---|
static int |
GPIO_IN_USE
Timeout while waiting for interrupt event on the GPIO.
|
static int |
INTERRUPT_TIMEOUT
Timeout while waiting for interrupt event on the GPIO.
|
static int |
INVALID_GPIO
The provided GPIO number is not valid.
|
static int |
READING_ERROR
Error reading from GPIO files.
|
static long |
serialVersionUID |
static int |
UNSPECIFIED_EXCEPTION
Any exception that does not specify a specific issue.
|
static int |
WRITING_ERROR
Error writing to GPIO files.
|
Constructor and Description |
---|
GPIOException(int gpioNumber)
Constructs a GPIOException for the given GPIO number.
|
GPIOException(int gpioNumber,
int exceptionType)
Constructs a GPIOException for the given GPIO number and with the given cause.
|
GPIOException(int gpioNumber,
int exceptionType,
java.lang.String message)
Constructs a GPIOException for the given GPIO number, exception cause
and detailed exception message.
|
GPIOException(int gpioNumber,
int exceptionType,
java.lang.String message,
java.lang.Throwable throwable)
Constructs a GPIOException for the given GPIO number, exception cause,
detailed message and darent exception.
|
GPIOException(int gpioNumber,
int exceptionType,
java.lang.Throwable throwable)
Constructs a GPIOException for the given GPIO number, exception cause
and parent exception.
|
Modifier and Type | Method and Description |
---|---|
int |
getGPIONumber()
Retrieves the GPIO kernel number associated to this exception.
|
int |
getType()
Retrieves the exception type.
|
public static final long serialVersionUID
public static final int UNSPECIFIED_EXCEPTION
public static final int INVALID_GPIO
public static final int GPIO_IN_USE
public static final int READING_ERROR
public static final int WRITING_ERROR
public static final int INTERRUPT_TIMEOUT
public GPIOException(int gpioNumber)
gpioNumber
- Number of GPIO that threw the exception.public GPIOException(int gpioNumber, int exceptionType)
gpioNumber
- Number of GPIO that threw the exception.exceptionType
- Type of exception.GPIO_IN_USE
,
INTERRUPT_TIMEOUT
,
INVALID_GPIO
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR
public GPIOException(int gpioNumber, int exceptionType, java.lang.String message)
gpioNumber
- Number of GPIO that threw the exception.exceptionType
- Type of exception.message
- Additional message for the exception.GPIO_IN_USE
,
INTERRUPT_TIMEOUT
,
INVALID_GPIO
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR
public GPIOException(int gpioNumber, int exceptionType, java.lang.Throwable throwable)
gpioNumber
- Number of GPIO that threw the exception.exceptionType
- Type of exception.throwable
- Parent exception.GPIO_IN_USE
,
INTERRUPT_TIMEOUT
,
INVALID_GPIO
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR
public GPIOException(int gpioNumber, int exceptionType, java.lang.String message, java.lang.Throwable throwable)
gpioNumber
- Number of GPIO that threw the exception.exceptionType
- Type of exception.message
- Additional message for the exception.throwable
- Parent exception.GPIO_IN_USE
,
INTERRUPT_TIMEOUT
,
INVALID_GPIO
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR
public int getGPIONumber()
public int getType()
UNSPECIFIED_EXCEPTION
if
not explicitly set.GPIO_IN_USE
,
INTERRUPT_TIMEOUT
,
INVALID_GPIO
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR