2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.modbus.internal.config;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * Configuration for data thing
21 * @author Sami Salonen - Initial contribution
25 public class ModbusDataConfiguration {
27 private @Nullable String readStart;
28 private @Nullable String readTransform;
29 private @Nullable String readValueType;
30 private @Nullable String writeStart;
31 private @Nullable String writeType;
32 private @Nullable String writeTransform;
33 private @Nullable String writeValueType;
34 private boolean writeMultipleEvenWithSingleRegisterOrCoil;
35 private int writeMaxTries = 3; // backwards compatibility and tests
36 private long updateUnchangedValuesEveryMillis = 1000L;
38 public @Nullable String getReadStart() {
42 public void setReadStart(String readStart) {
43 this.readStart = readStart;
46 public @Nullable String getReadTransform() {
50 public void setReadTransform(String readTransform) {
51 this.readTransform = readTransform;
54 public @Nullable String getReadValueType() {
58 public void setReadValueType(String readValueType) {
59 this.readValueType = readValueType;
62 public @Nullable String getWriteStart() {
66 public void setWriteStart(String writeStart) {
67 this.writeStart = writeStart;
70 public @Nullable String getWriteType() {
74 public void setWriteType(String writeType) {
75 this.writeType = writeType;
78 public @Nullable String getWriteTransform() {
79 return writeTransform;
82 public void setWriteTransform(String writeTransform) {
83 this.writeTransform = writeTransform;
86 public @Nullable String getWriteValueType() {
87 return writeValueType;
90 public void setWriteValueType(String writeValueType) {
91 this.writeValueType = writeValueType;
94 public boolean isWriteMultipleEvenWithSingleRegisterOrCoil() {
95 return writeMultipleEvenWithSingleRegisterOrCoil;
98 public void setWriteMultipleEvenWithSingleRegisterOrCoil(boolean writeMultipleEvenWithSingleRegisterOrCoil) {
99 this.writeMultipleEvenWithSingleRegisterOrCoil = writeMultipleEvenWithSingleRegisterOrCoil;
102 public int getWriteMaxTries() {
103 return writeMaxTries;
106 public void setWriteMaxTries(int writeMaxTries) {
107 this.writeMaxTries = writeMaxTries;
110 public long getUpdateUnchangedValuesEveryMillis() {
111 return updateUnchangedValuesEveryMillis;
114 public void setUpdateUnchangedValuesEveryMillis(long updateUnchangedValuesEveryMillis) {
115 this.updateUnchangedValuesEveryMillis = updateUnchangedValuesEveryMillis;