2 * Copyright (c) 2010-2021 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.dsmr.internal.device;
16 * Class describing the DSMR bridge user configuration
18 * @author M. Volaart - Initial contribution
19 * @author Hilbrand Bouwkamp - added receivedTimeout configuration
21 public class DSMRDeviceConfiguration {
25 public String serialPort;
28 * Serial port baud rate
33 * Serial port data bits
43 * Serial port stop bits
45 public String stopbits;
48 * The Luxembourgish smart meter decryption key
50 public String decryptionKey;
53 * When no message was received after the configured number of seconds action will be taken.
55 public int receivedTimeout;
58 * @return true if serial port settings are all set.
60 public boolean isSerialFixedSettings() {
61 return baudrate > 0 && databits > 0 && !(parity != null && parity.isBlank())
62 && !(stopbits != null && stopbits.isBlank());
66 public String toString() {
67 return "DSMRDeviceConfiguration [serialPort=" + serialPort + ", Baudrate=" + baudrate + ", Databits=" + databits
68 + ", Parity=" + parity + ", Stopbits=" + stopbits + ", decryptionKey=" + decryptionKey
69 + ", receivedTimeout=" + receivedTimeout + "]";