2 * Copyright (c) 2010-2022 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.knx.internal.handler;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.knx.internal.client.AbstractKNXClient;
17 import org.openhab.binding.knx.internal.client.SerialClient;
18 import org.openhab.binding.knx.internal.config.SerialBridgeConfiguration;
19 import org.openhab.core.thing.Bridge;
20 import org.openhab.core.thing.ThingStatus;
23 * The {@link IPBridgeThingHandler} is responsible for handling commands, which are
24 * sent to one of the channels. It implements a KNX Serial/USB Gateway, that either acts a a
25 * conduit for other {@link DeviceThingHandler}s, or for Channels that are
26 * directly defined on the bridge
28 * @author Karel Goderis - Initial contribution
29 * @author Simon Kaufmann - Refactoring & cleanup
32 public class SerialBridgeThingHandler extends KNXBridgeBaseThingHandler {
34 private final SerialClient client;
36 public SerialBridgeThingHandler(Bridge bridge) {
38 SerialBridgeConfiguration config = getConfigAs(SerialBridgeConfiguration.class);
39 client = new SerialClient(config.getAutoReconnectPeriod(), thing.getUID(),
40 config.getResponseTimeout().intValue(), config.getReadingPause().intValue(),
41 config.getReadRetriesLimit().intValue(), getScheduler(), config.getSerialPort(), config.useCemi(),
46 public void initialize() {
47 updateStatus(ThingStatus.UNKNOWN);
52 public void dispose() {
58 protected AbstractKNXClient getClient() {