]> git.basschouten.com Git - openhab-addons.git/blob
23dce8ff004c1c20c7557e559d0f51d995100d78
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.modbus.internal.config;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Configuration for tcp thing
20  *
21  * @author Sami Salonen - Initial contribution
22  *
23  */
24 @NonNullByDefault
25 public class ModbusTcpConfiguration {
26     private @Nullable String host;
27     private int port;
28     private int id = 1;
29     private int timeBetweenTransactionsMillis = 60;
30     private int timeBetweenReconnectMillis;
31     private int connectMaxTries = 1;
32     private int reconnectAfterMillis;
33     private int afterConnectionDelayMillis;
34     private int connectTimeoutMillis = 10_000;
35     private boolean enableDiscovery;
36     private boolean rtuEncoded;
37
38     public boolean getRtuEncoded() {
39         return rtuEncoded;
40     }
41
42     public @Nullable String getHost() {
43         return host;
44     }
45
46     public void setHost(String host) {
47         this.host = host;
48     }
49
50     public int getPort() {
51         return port;
52     }
53
54     public void setPort(int port) {
55         this.port = port;
56     }
57
58     public int getId() {
59         return id;
60     }
61
62     public void setId(int id) {
63         this.id = id;
64     }
65
66     public int getTimeBetweenTransactionsMillis() {
67         return timeBetweenTransactionsMillis;
68     }
69
70     public void setTimeBetweenTransactionsMillis(int timeBetweenTransactionsMillis) {
71         this.timeBetweenTransactionsMillis = timeBetweenTransactionsMillis;
72     }
73
74     public int getTimeBetweenReconnectMillis() {
75         return timeBetweenReconnectMillis;
76     }
77
78     public void setTimeBetweenReconnectMillis(int timeBetweenReconnectMillis) {
79         this.timeBetweenReconnectMillis = timeBetweenReconnectMillis;
80     }
81
82     public int getConnectMaxTries() {
83         return connectMaxTries;
84     }
85
86     public void setConnectMaxTries(int connectMaxTries) {
87         this.connectMaxTries = connectMaxTries;
88     }
89
90     public int getReconnectAfterMillis() {
91         return reconnectAfterMillis;
92     }
93
94     public void setReconnectAfterMillis(int reconnectAfterMillis) {
95         this.reconnectAfterMillis = reconnectAfterMillis;
96     }
97
98     public int getAfterConnectionDelayMillis() {
99         return afterConnectionDelayMillis;
100     }
101
102     public void setAfterConnectionDelayMillis(int afterConnectionDelayMillis) {
103         this.afterConnectionDelayMillis = afterConnectionDelayMillis;
104     }
105
106     public int getConnectTimeoutMillis() {
107         return connectTimeoutMillis;
108     }
109
110     public void setConnectTimeoutMillis(int connectTimeoutMillis) {
111         this.connectTimeoutMillis = connectTimeoutMillis;
112     }
113
114     public boolean isDiscoveryEnabled() {
115         return enableDiscovery;
116     }
117
118     public void setDiscoveryEnabled(boolean enableDiscovery) {
119         this.enableDiscovery = enableDiscovery;
120     }
121 }