2 * Copyright (c) 2010-2023 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 poller thing
21 * @author Sami Salonen - Initial contribution
25 public class ModbusPollerConfiguration {
29 private @Nullable String type;
30 private int maxTries = 3;// backwards compatibility and tests
31 private long cacheMillis = 50L;
34 * Gets refresh period in milliseconds
36 public long getRefresh() {
41 * Sets refresh period in milliseconds
44 public void setRefresh(long refresh) {
45 this.refresh = refresh;
49 * Get address of the first register, coil, or discrete input to poll. Input as zero-based index number.
52 public int getStart() {
57 * Sets address of the first register, coil, or discrete input to poll. Input as zero-based index number.
60 public void setStart(int start) {
65 * Gets number of registers, coils or discrete inputs to read.
67 public int getLength() {
72 * Sets number of registers, coils or discrete inputs to read.
74 public void setLength(int length) {
79 * Gets type of modbus items to poll
82 public @Nullable String getType() {
87 * Sets type of modbus items to poll
90 public void setType(String type) {
94 public int getMaxTries() {
98 public void setMaxTries(int maxTries) {
99 this.maxTries = maxTries;
103 * Gets time to cache data.
105 * This is used for reusing cached data with explicit refresh calls.
107 public long getCacheMillis() {
112 * Sets time to cache data, in milliseconds
115 public void setCacheMillis(long cacheMillis) {
116 this.cacheMillis = cacheMillis;