]> git.basschouten.com Git - openhab-addons.git/blob
8e81973a0ec5201c9f40e7b42cad5408bdfd2067
[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 serial thing
20  *
21  * @author Sami Salonen - Initial contribution
22  *
23  */
24 @NonNullByDefault
25 public class ModbusSerialConfiguration {
26     private @Nullable String port;
27     private int id = 1;
28     private int baud;
29     private @Nullable String stopBits;
30     private @Nullable String parity;
31     private int dataBits;
32     private String encoding = "rtu";
33     private boolean echo;
34     private int receiveTimeoutMillis = 1500;
35     private String flowControlIn = "none";
36     private String flowControlOut = "none";
37     private int timeBetweenTransactionsMillis = 35;
38     private int connectMaxTries = 1;
39     private int connectTimeoutMillis = 10_000;
40     private boolean enableDiscovery;
41
42     public @Nullable String getPort() {
43         return port;
44     }
45
46     public void setPort(String port) {
47         this.port = port;
48     }
49
50     public int getId() {
51         return id;
52     }
53
54     public void setId(int id) {
55         this.id = id;
56     }
57
58     public int getBaud() {
59         return baud;
60     }
61
62     public void setBaud(int baud) {
63         this.baud = baud;
64     }
65
66     public @Nullable String getStopBits() {
67         return stopBits;
68     }
69
70     public void setStopBits(String stopBits) {
71         this.stopBits = stopBits;
72     }
73
74     public @Nullable String getParity() {
75         return parity;
76     }
77
78     public void setParity(String parity) {
79         this.parity = parity;
80     }
81
82     public int getDataBits() {
83         return dataBits;
84     }
85
86     public void setDataBits(int dataBits) {
87         this.dataBits = dataBits;
88     }
89
90     public @Nullable String getEncoding() {
91         return encoding;
92     }
93
94     public void setEncoding(String encoding) {
95         this.encoding = encoding;
96     }
97
98     public boolean isEcho() {
99         return echo;
100     }
101
102     public void setEcho(boolean echo) {
103         this.echo = echo;
104     }
105
106     public int getReceiveTimeoutMillis() {
107         return receiveTimeoutMillis;
108     }
109
110     public void setReceiveTimeoutMillis(int receiveTimeoutMillis) {
111         this.receiveTimeoutMillis = receiveTimeoutMillis;
112     }
113
114     public @Nullable String getFlowControlIn() {
115         return flowControlIn;
116     }
117
118     public void setFlowControlIn(String flowControlIn) {
119         this.flowControlIn = flowControlIn;
120     }
121
122     public @Nullable String getFlowControlOut() {
123         return flowControlOut;
124     }
125
126     public void setFlowControlOut(String flowControlOut) {
127         this.flowControlOut = flowControlOut;
128     }
129
130     public int getTimeBetweenTransactionsMillis() {
131         return timeBetweenTransactionsMillis;
132     }
133
134     public void setTimeBetweenTransactionsMillis(int timeBetweenTransactionsMillis) {
135         this.timeBetweenTransactionsMillis = timeBetweenTransactionsMillis;
136     }
137
138     public int getConnectMaxTries() {
139         return connectMaxTries;
140     }
141
142     public void setConnectMaxTries(int connectMaxTries) {
143         this.connectMaxTries = connectMaxTries;
144     }
145
146     public int getConnectTimeoutMillis() {
147         return connectTimeoutMillis;
148     }
149
150     public void setConnectTimeoutMillis(int connectTimeoutMillis) {
151         this.connectTimeoutMillis = connectTimeoutMillis;
152     }
153
154     public boolean isDiscoveryEnabled() {
155         return enableDiscovery;
156     }
157
158     public void setDiscoveryEnabled(boolean enableDiscovery) {
159         this.enableDiscovery = enableDiscovery;
160     }
161 }