Package net.solarnetwork.node.io.modbus
Enum Class ModbusWriteFunction
- All Implemented Interfaces:
Serializable,Comparable<ModbusWriteFunction>,Constable,ModbusFunction
Modbus write functions.
These functions are separated from the read functions to help API methods be explicit about requiring write versus read functions.
- Since:
- 2.5
- Version:
- 2.1
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWrite a coil register.Write a holding register.Write multiple coils.Write multiple holding. -
Method Summary
Modifier and TypeMethodDescriptionGet the register block type related to this function.static ModbusWriteFunctionforCode(int code) Get an enum instance for a code value.intgetCode()Get the function code.booleanReturn true if this function represents a read operation.Get an "opposite" function from this function.Get a friendly display string for this function.static ModbusWriteFunctionReturns the enum constant of this class with the specified name.static ModbusWriteFunction[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WriteCoil
Write a coil register. -
WriteHoldingRegister
Write a holding register. -
WriteMultipleCoils
Write multiple coils. -
WriteMultipleHoldingRegisters
Write multiple holding.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getCode
public int getCode()Description copied from interface:ModbusFunctionGet the function code.- Specified by:
getCodein interfaceModbusFunction- Returns:
- the code
-
toDisplayString
Description copied from interface:ModbusFunctionGet a friendly display string for this function.- Specified by:
toDisplayStringin interfaceModbusFunction- Returns:
- a display string
-
forCode
Get an enum instance for a code value.- Parameters:
code- the code- Returns:
- the enum
- Throws:
IllegalArgumentException- ifcodeis not a valid value
-
isReadFunction
public boolean isReadFunction()Description copied from interface:ModbusFunctionReturn true if this function represents a read operation.- Specified by:
isReadFunctionin interfaceModbusFunction- Returns:
- true if this function represents a read operation, false if a write operation
-
oppositeFunction
Description copied from interface:ModbusFunctionGet an "opposite" function from this function.This method is used to get a read function for a given write function, and a write function for a given read function.
- Specified by:
oppositeFunctionin interfaceModbusFunction- Returns:
- the function, or null if not applicable
-
blockType
Description copied from interface:ModbusFunctionGet the register block type related to this function.- Specified by:
blockTypein interfaceModbusFunction- Returns:
- the block type
-