Class HardwareException


public class HardwareException extends IOException

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 Details

    • HardwareException

      public HardwareException(String message)
      Creates an exception with a message and no operating system error.
    • HardwareException

      public HardwareException(String message, int errno)
      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, or 0 when the port did not report one.