Package nl.basjes.modbus.device.api
Object FunctionCode.Companion
-
- All Implemented Interfaces:
public class FunctionCode.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static FunctionCode.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final static FunctionCodeof(Integer code)Retrieve the FunctionCode instance by its numerical code final static FunctionCodeforReading(AddressClass addressClass)Retrieve the read FunctionCode instance which can handle the provided AddressClass final static FunctionCodeforWritingSingle(AddressClass addressClass)Retrieve the writing FunctionCode instance which can handle the provided AddressClass final static FunctionCodeforWritingMultiple(AddressClass addressClass)Retrieve the writing FunctionCode instance which can handle the provided AddressClass -
-
Method Detail
-
of
final static FunctionCode of(Integer code)
Retrieve the FunctionCode instance by its numerical code
- Parameters:
code- The numerical modbus function code.- Returns:
The requested FunctionCode or null if not found
-
forReading
final static FunctionCode forReading(AddressClass addressClass)
Retrieve the read FunctionCode instance which can handle the provided AddressClass
- Parameters:
addressClass- The class of the address for which to retrieve the FunctionCode.- Returns:
The FunctionCode(s) that can be used for reading
-
forWritingSingle
final static FunctionCode forWritingSingle(AddressClass addressClass)
Retrieve the writing FunctionCode instance which can handle the provided AddressClass
- Parameters:
addressClass- The class of the address for which to retrieve the FunctionCode.- Returns:
The FunctionCode that can be used for writing a single register
-
forWritingMultiple
final static FunctionCode forWritingMultiple(AddressClass addressClass)
Retrieve the writing FunctionCode instance which can handle the provided AddressClass
- Parameters:
addressClass- The class of the address for which to retrieve the FunctionCode.- Returns:
The FunctionCode that can be used for writing a single register
-
-
-
-