Skip to content

Commit 52259d8

Browse files
authored
Merge pull request #8 from paulorb/fixPresetHRresponse
fix(ISSUE-7): fix issue on preset single register request
2 parents 9843952 + 3854cab commit 52259d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/ModbusPresetSingleRegisterResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ModbusPresetSingleRegisterResponse : ModbusPacket {
3030

3131

3232
override fun encode() {
33-
functionCode = ModbusPacket.FunctionCode.FORCE_SINGLE_COIL.value.toByte()
33+
functionCode = ModbusPacket.FunctionCode.PRESET_SINGLE_REGISTER.value.toByte()
3434
protocolIdentifier = DEFAULT_PROTOCOL_IDENTIFIER.toShort()
3535
val addressBytes = DataConverter.toBytes(currentAddress.toShort())
3636
byteVector = ByteArray(LEN_BYTES_METADATA_SIZE)

0 commit comments

Comments
 (0)