Class HardwareException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.codename1.hardware.HardwareException
Thrown when a hardware bus or pin cannot be opened or an I/O operation on it fails: the device node is absent, the process lacks permission for it, the line is already claimed, or the peripheral did not acknowledge.
getErrno() carries the operating system error number when the port has
one (Linux errno), and 0 otherwise, so code can tell "no such device"
from "permission denied" without parsing the message.
-
Constructor Summary
ConstructorsConstructorDescriptionHardwareException(String message) Creates an exception with a message and no operating system error.HardwareException(String message, int errno) Creates an exception with a message and the operating system error number that caused it. -
Method Summary
Modifier and TypeMethodDescriptionintgetErrno()The operating system error number behind this failure, or0when the port did not report one.Methods inherited from class Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HardwareException
Creates an exception with a message and no operating system error. -
HardwareException
Creates an exception with a message and the operating system error number that caused it.
-
-
Method Details
-
getErrno
public int getErrno()The operating system error number behind this failure, or0when the port did not report one.
-