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.velux.internal.bridge.slip;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.velux.internal.bridge.common.Logout;
17 import org.openhab.binding.velux.internal.bridge.slip.utils.KLF200Response;
18 import org.openhab.binding.velux.internal.things.VeluxKLFAPI.Command;
19 import org.openhab.binding.velux.internal.things.VeluxKLFAPI.CommandNumber;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 * Protocol specific bridge communication supported by the Velux bridge:
25 * <B>Retrieve LAN configuration</B>
27 * Common Message semantic: Communication with the bridge and (optionally) storing returned information within the class
30 * As 3rd level class it defines informations how to send query and receive answer through the
31 * {@link org.openhab.binding.velux.internal.bridge.VeluxBridgeProvider VeluxBridgeProvider}
32 * as described by the interface {@link org.openhab.binding.velux.internal.bridge.slip.SlipBridgeCommunicationProtocol
33 * SlipBridgeCommunicationProtocol}.
35 * There are no methods in addition to the mentioned interface.
38 * @see SlipBridgeCommunicationProtocol
40 * @author Guenther Schreiner - Initial contribution.
43 class SClogout extends Logout implements SlipBridgeCommunicationProtocol {
44 private final Logger logger = LoggerFactory.getLogger(SClogout.class);
46 private static final String DESCRIPTION = "Deauthenticate / logout";
47 private static final Command COMMAND = Command.GW_OPENHAB_CLOSE;
50 * ===========================================================
54 private final byte[] emptyPacket = new byte[0];
57 * ===========================================================
61 private boolean success = false;
62 private boolean finished = false;
65 * ===========================================================
66 * Methods required for interface {@link SlipBridgeCommunicationProtocol}.
70 public String name() {
75 public CommandNumber getRequestCommand() {
76 return COMMAND.getCommand();
80 public byte[] getRequestDataAsArrayOfBytes() {
85 public void setResponse(short responseCommand, byte[] thisResponseData, boolean isSequentialEnforced) {
86 KLF200Response.introLogging(logger, responseCommand, thisResponseData);
89 KLF200Response.outroLogging(logger, success, finished);
93 public boolean isCommunicationFinished() {
98 public boolean isCommunicationSuccessful() {