]> git.basschouten.com Git - openhab-addons.git/blob
f565f2082a58f922d05554045c8fff3db77c6eed
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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 connectTimeoutMillis = 10_000;
34     private boolean enableDiscovery;
35     private boolean rtuEncoded;
36
37     public boolean getRtuEncoded() {
38         return rtuEncoded;
39     }
40
41     public @Nullable String getHost() {
42         return host;
43     }
44
45     public void setHost(String host) {
46         this.host = host;
47     }
48
49     public int getPort() {
50         return port;
51     }
52
53     public void setPort(int port) {
54         this.port = port;
55     }
56
57     public int getId() {
58         return id;
59     }
60
61     public void setId(int id) {
62         this.id = id;
63     }
64
65     public int getTimeBetweenTransactionsMillis() {
66         return timeBetweenTransactionsMillis;
67     }
68
69     public void setTimeBetweenTransactionsMillis(int timeBetweenTransactionsMillis) {
70         this.timeBetweenTransactionsMillis = timeBetweenTransactionsMillis;
71     }
72
73     public int getTimeBetweenReconnectMillis() {
74         return timeBetweenReconnectMillis;
75     }
76
77     public void setTimeBetweenReconnectMillis(int timeBetweenReconnectMillis) {
78         this.timeBetweenReconnectMillis = timeBetweenReconnectMillis;
79     }
80
81     public int getConnectMaxTries() {
82         return connectMaxTries;
83     }
84
85     public void setConnectMaxTries(int connectMaxTries) {
86         this.connectMaxTries = connectMaxTries;
87     }
88
89     public int getReconnectAfterMillis() {
90         return reconnectAfterMillis;
91     }
92
93     public void setReconnectAfterMillis(int reconnectAfterMillis) {
94         this.reconnectAfterMillis = reconnectAfterMillis;
95     }
96
97     public int getConnectTimeoutMillis() {
98         return connectTimeoutMillis;
99     }
100
101     public void setConnectTimeoutMillis(int connectTimeoutMillis) {
102         this.connectTimeoutMillis = connectTimeoutMillis;
103     }
104
105     public boolean isDiscoveryEnabled() {
106         return enableDiscovery;
107     }
108
109     public void setDiscoveryEnabled(boolean enableDiscovery) {
110         this.enableDiscovery = enableDiscovery;
111     }
112 }