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