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;
15 import org.apache.commons.lang.StringUtils;
18 * Class describing the DSMR bridge user configuration
20 * @author M. Volaart - Initial contribution
21 * @author Hilbrand Bouwkamp - added receivedTimeout configuration
23 public class DSMRDeviceConfiguration {
27 public String serialPort;
30 * Serial port baud rate
35 * Serial port data bits
45 * Serial port stop bits
47 public String stopbits;
50 * The Luxembourgish smart meter decryption key
52 public String decryptionKey;
55 * When no message was received after the configured number of seconds action will be taken.
57 public int receivedTimeout;
60 * @return true if serial port settings are all set.
62 public boolean isSerialFixedSettings() {
63 return baudrate > 0 && databits > 0 && !StringUtils.isBlank(parity) && !StringUtils.isBlank(stopbits);
67 public String toString() {
68 return "DSMRDeviceConfiguration [serialPort=" + serialPort + ", Baudrate=" + baudrate + ", Databits=" + databits
69 + ", Parity=" + parity + ", Stopbits=" + stopbits + ", decryptionKey=" + decryptionKey
70 + ", receivedTimeout=" + receivedTimeout + "]";