public enum PiGpioDerrs extends Enum<PiGpioDerrs>
errors -1..-143
hold (as their main purpose) a short
English explanation.ordinal
numbers 1..143
(respectively 0..145;
see below) are the (positive) absolute
value of the (negative with Linux and PiGpioD)
error codes. That means: Enum.ordinal()
== -
errNum()
(1)
-1..-143
are supplemented by
no error (0)
, a Python error
command interrupted (-144)
irrelevant here,
and a unknown PI_error
to be
delivered for a
wrong (<-144)
error number.(1)
: For good reasons, attaching significance
to the ordinal
associated with an enum (as we do here)
is considered error prone and, hence, bad practice. Re-sorting, deleting
or inserting enum definitions, would invalidate the fundamental assumption
(i.e. equation (1)
) and spoil everything.ordinal
our (-errnum) significance is getting in
O(1)
complexity from an error number to the enum object and thus
to the short explanation
. For a Java program running with
real time requirements on a little Pi this O(1)
feature may me
crucial. We've seen Java code therefore with O(n)
as well as with
thwow awayy objects).(1)
: This enum class as
application to be started by java de.weAut.PiGpioDdefs$ErrPI
(1)
after doing any changes.
weinert-automation.de a-weinert.de
/ / /\
/ /___ / \ |
\ /____\ /____\ | _|__
\ /\ / \ / \| |
\/ \/ \__/ \__/|_
ThePi
,
ClientPigpiod
,
PiGpioDdefs
Modifier and Type | Field and Description |
---|---|
String |
expl
The pigpiod error's short explanation.
|
Modifier and Type | Method and Description |
---|---|
StringBuilder |
append(StringBuilder dest,
int tab)
Description of the enum object.
|
static PiGpioDerrs |
byErrNum(int num)
Get explained error by error number (-) or index.
|
int |
errNum()
Get the error number (-).
|
static void |
main(String[] args)
The enum ErrPi as application.
|
String |
toString()
Description of the enum object.
|
static PiGpioDerrs |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PiGpioDerrs[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PiGpioDerrs PI_NO_ERROR
public static final PiGpioDerrs PI_INIT_FAILED
public static final PiGpioDerrs PI_BAD_USER_GPIO
public static final PiGpioDerrs PI_BAD_GPIO
public static final PiGpioDerrs PI_BAD_MODE
public static final PiGpioDerrs PI_BAD_LEVEL
public static final PiGpioDerrs PI_BAD_PUD
public static final PiGpioDerrs PI_BAD_PULSEWIDTH
public static final PiGpioDerrs PI_BAD_DUTYCYCLE
public static final PiGpioDerrs PI_BAD_TIMER
public static final PiGpioDerrs PI_BAD_MS
public static final PiGpioDerrs PI_BAD_TIMETYPE
public static final PiGpioDerrs PI_BAD_SECONDS
public static final PiGpioDerrs PI_BAD_MICROS
public static final PiGpioDerrs PI_TIMER_FAILED
public static final PiGpioDerrs PI_BAD_WDOG_TIMEOUT
public static final PiGpioDerrs PI_NO_ALERT_FUNC
public static final PiGpioDerrs PI_BAD_CLK_PERIPH
public static final PiGpioDerrs PI_BAD_CLK_SOURCE
public static final PiGpioDerrs PI_BAD_CLK_MICROS
public static final PiGpioDerrs PI_BAD_BUF_MILLIS
public static final PiGpioDerrs PI_BAD_DUTYRANGE
public static final PiGpioDerrs PI_BAD_SIGNUM
public static final PiGpioDerrs PI_BAD_PATHNAME
public static final PiGpioDerrs PI_NO_HANDLE
public static final PiGpioDerrs PI_BAD_HANDLE
public static final PiGpioDerrs PI_BAD_IF_FLAGS
public static final PiGpioDerrs PI_BAD_CHANNEL
public static final PiGpioDerrs PI_BAD_SOCKET_PORT
public static final PiGpioDerrs PI_BAD_FIFO_COMMAND
public static final PiGpioDerrs PI_BAD_SECO_CHANNEL
public static final PiGpioDerrs PI_NOT_INITIALISED
public static final PiGpioDerrs PI_INITIALISED
public static final PiGpioDerrs PI_BAD_WAVE_MODE
public static final PiGpioDerrs PI_BAD_CFG_INTERNAL
public static final PiGpioDerrs PI_BAD_WAVE_BAUD
public static final PiGpioDerrs PI_TOO_MANY_PULSES
public static final PiGpioDerrs PI_TOO_MANY_CHARS
public static final PiGpioDerrs PI_NOT_SERIAL_GPIO
public static final PiGpioDerrs PI_BAD_SERIAL_STRUC
public static final PiGpioDerrs PI_BAD_SERIAL_BUF
public static final PiGpioDerrs PI_NOT_PERMITTED
0
and
1
. * GPIO 0
and 1
on pins 27
and
28
on Pis 3, 4 & 0
may be
used on some Pi type and Raspbian combinations — sometimes
after some configuration file edits. But on some combinations they will
not work raising this error. public static final PiGpioDerrs PI_SOME_PERMITTED
public static final PiGpioDerrs PI_BAD_WVSC_COMMND
public static final PiGpioDerrs PI_BAD_WVSM_COMMND
public static final PiGpioDerrs PI_BAD_WVSP_COMMND
public static final PiGpioDerrs PI_BAD_PULSELEN
public static final PiGpioDerrs PI_BAD_SCRIPT
public static final PiGpioDerrs PI_BAD_SCRIPT_ID
public static final PiGpioDerrs PI_BAD_SER_OFFSET
public static final PiGpioDerrs PI_GPIO_IN_USE
public static final PiGpioDerrs PI_BAD_SERIAL_COUNT
public static final PiGpioDerrs PI_BAD_PARAM_NUM
public static final PiGpioDerrs PI_DUP_TAG
public static final PiGpioDerrs PI_TOO_MANY_TAGS
public static final PiGpioDerrs PI_BAD_SCRIPT_CMD
public static final PiGpioDerrs PI_BAD_VAR_NUM
public static final PiGpioDerrs PI_NO_SCRIPT_ROOM
public static final PiGpioDerrs PI_NO_MEMORY
public static final PiGpioDerrs PI_SOCK_READ_FAILED
public static final PiGpioDerrs PI_SOCK_WRIT_FAILED
public static final PiGpioDerrs PI_TOO_MANY_PARAM
public static final PiGpioDerrs PI_SCRIPT_NOT_READY
public static final PiGpioDerrs PI_BAD_TAG
public static final PiGpioDerrs PI_BAD_MICS_DELAY
public static final PiGpioDerrs PI_BAD_MILS_DELAY
public static final PiGpioDerrs PI_BAD_WAVE_ID
public static final PiGpioDerrs PI_TOO_MANY_CBS
public static final PiGpioDerrs PI_TOO_MANY_OOL
public static final PiGpioDerrs PI_EMPTY_WAVEFORM
public static final PiGpioDerrs PI_NO_WAVEFORM_ID
public static final PiGpioDerrs PI_I2C_OPEN_FAILED
public static final PiGpioDerrs PI_SER_OPEN_FAILED
public static final PiGpioDerrs PI_SPI_OPEN_FAILED
public static final PiGpioDerrs PI_BAD_I2C_BUS
public static final PiGpioDerrs PI_BAD_I2C_ADDR
public static final PiGpioDerrs PI_BAD_SPI_CHANNEL
public static final PiGpioDerrs PI_BAD_FLAGS
public static final PiGpioDerrs PI_BAD_SPI_SPEED
public static final PiGpioDerrs PI_BAD_SER_DEVICE
public static final PiGpioDerrs PI_BAD_SER_SPEED
public static final PiGpioDerrs PI_BAD_PARAM
public static final PiGpioDerrs PI_I2C_WRITE_FAILED
public static final PiGpioDerrs PI_I2C_READ_FAILED
public static final PiGpioDerrs PI_BAD_SPI_COUNT
public static final PiGpioDerrs PI_SER_WRITE_FAILED
public static final PiGpioDerrs PI_SER_READ_FAILED
public static final PiGpioDerrs PI_SER_READ_NO_DATA
public static final PiGpioDerrs PI_UNKNOWN_COMMAND
public static final PiGpioDerrs PI_SPI_XFER_FAILED
public static final PiGpioDerrs PI_BAD_POINTER
public static final PiGpioDerrs PI_NO_AUX_SPI
public static final PiGpioDerrs PI_NOT_PWM_GPIO
public static final PiGpioDerrs PI_NOT_SERVO_GPIO
public static final PiGpioDerrs PI_NOT_HCLK_GPIO
public static final PiGpioDerrs PI_NOT_HPWM_GPIO
public static final PiGpioDerrs PI_BAD_HPWM_FREQ
public static final PiGpioDerrs PI_BAD_HPWM_DUTY
public static final PiGpioDerrs PI_BAD_HCLK_FREQ
public static final PiGpioDerrs PI_BAD_HCLK_PASS
public static final PiGpioDerrs PI_HPWM_ILLEGAL
public static final PiGpioDerrs PI_BAD_DATABITS
public static final PiGpioDerrs PI_BAD_STOPBITS
public static final PiGpioDerrs PI_MSG_TOOBIG
public static final PiGpioDerrs PI_BAD_MALLOC_MODE
public static final PiGpioDerrs PI_TOO_MANY_SEGS
public static final PiGpioDerrs PI_BAD_I2C_SEG
public static final PiGpioDerrs PI_BAD_SMBUS_CMD
public static final PiGpioDerrs PI_NOT_I2C_GPIO
public static final PiGpioDerrs PI_BAD_I2C_WLEN
public static final PiGpioDerrs PI_BAD_I2C_RLEN
public static final PiGpioDerrs PI_BAD_I2C_CMD
public static final PiGpioDerrs PI_BAD_I2C_BAUD
public static final PiGpioDerrs PI_CHAIN_LOOP_CNT
public static final PiGpioDerrs PI_BAD_CHAIN_LOOP
public static final PiGpioDerrs PI_CHAIN_COUNTER
public static final PiGpioDerrs PI_BAD_CHAIN_CMD
public static final PiGpioDerrs PI_BAD_CHAIN_DELAY
public static final PiGpioDerrs PI_CHAIN_NESTING
public static final PiGpioDerrs PI_CHAIN_TOO_BIG
public static final PiGpioDerrs PI_DEPRECATED
public static final PiGpioDerrs PI_BAD_SER_INVERT
public static final PiGpioDerrs PI_BAD_EDGE
public static final PiGpioDerrs PI_BAD_ISR_INIT
public static final PiGpioDerrs PI_BAD_FOREVER
public static final PiGpioDerrs PI_BAD_FILTER
public static final PiGpioDerrs PI_BAD_PAD
public static final PiGpioDerrs PI_BAD_STRENGTH
public static final PiGpioDerrs PI_FIL_OPEN_FAILED
public static final PiGpioDerrs PI_BAD_FILE_MODE
public static final PiGpioDerrs PI_BAD_FILE_FLAG
public static final PiGpioDerrs PI_BAD_FILE_READ
public static final PiGpioDerrs PI_BAD_FILE_WRITE
public static final PiGpioDerrs PI_FILE_NOT_ROPEN
public static final PiGpioDerrs PI_FILE_NOT_WOPEN
public static final PiGpioDerrs PI_BAD_FILE_SEEK
public static final PiGpioDerrs PI_NO_FILE_MATCH
public static final PiGpioDerrs PI_NO_FILE_ACCESS
public static final PiGpioDerrs PI_FILE_IS_A_DIR
public static final PiGpioDerrs PI_BAD_SHELL_STATUS
public static final PiGpioDerrs PI_BAD_SCRIPT_NAME
public static final PiGpioDerrs PI_BAD_SPI_BAUD
public static final PiGpioDerrs PI_NOT_SPI_GPIO
public static final PiGpioDerrs PI_BAD_EVENT_ID
public static final PiGpioDerrs PI_CMD_INTERRUPTED
public static final PiGpioDerrs PI_UNKNOWN_ERROR
public final String expl
-1..-144
is what this
enum class was made for.public static PiGpioDerrs[] values()
for (PiGpioDerrs c : PiGpioDerrs.values()) System.out.println(c);
public static PiGpioDerrs valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static final PiGpioDerrs byErrNum(int num)
num
- the negative error number or its absolute (positive) valuePI_UNKNOWN_ERROR
; PI_NO_ERROR
public final int errNum()
Enum.ordinal()
)public final StringBuilder append(StringBuilder dest, int tab)
ErrPI.NOT_PERMITTED -41: GPIO operation not permitted
dest
.dest
- destination to append to; if null dest is made as
StringBuilder with initial capacity of 89tab
- the minimal length of (name + blanks) before the error
number (-41
in the example
relative to the beginning of the enum
(-41
in the example name)public final String toString()
ErrPI.NOT_PERMITTED -41: GPIO operation not permitted
append(null, 8)
toString
in class Enum<PiGpioDerrs>
public static void main(String[] args)
Enum.ordinal()
== -
errNum()
java de.weAut.PiGpioDerrs
args
- start parameters, first parameter if present ignored
will be the tab
valueappend(null, tab)