Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public class HardwareException

  1. Object
  2. Throwable
  3. Exception
  4. IOException
  5. 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.

Constructors

public HardwareException(String message)Creates an exception with a message and no operating system error.
public HardwareException(String message, int errno)Creates an exception with a message and the operating system error number that caused it.

Methods

public int getErrno()The operating system error number behind this failure, or 0 when the port did not report one.

Inherited methods

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.