2 * Copyright (c) 2010-2023 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.openhab.binding.dsmr.internal.DSMRBindingConstants;
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 {
28 public String serialPort;
31 * Serial port baud rate
36 * Serial port data bits
46 * Serial port stop bits
48 public String stopbits;
51 * The Luxembourgish/Austria smart meter decryption key
53 public String decryptionKey;
56 * Austria smart meter additional decryption key
58 public String additionalKey = DSMRBindingConstants.CONFIGURATION_ADDITIONAL_KEY_DEFAULT;
61 * When no message was received after the configured number of seconds action will be taken.
63 public int receivedTimeout;
66 * @return true if serial port settings are all set.
68 public boolean isSerialFixedSettings() {
69 return baudrate > 0 && databits > 0 && !(parity != null && parity.isBlank())
70 && !(stopbits != null && stopbits.isBlank());
74 public String toString() {
75 return "DSMRDeviceConfiguration [serialPort=" + serialPort + ", Baudrate=" + baudrate + ", Databits=" + databits
76 + ", Parity=" + parity + ", Stopbits=" + stopbits + ", decryptionKey=" + decryptionKey
77 + ", additionalKey=" + additionalKey + ", receivedTimeout=" + receivedTimeout + "]";