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.BridgeCommunicationProtocol;
17 import org.openhab.binding.velux.internal.things.VeluxKLFAPI.CommandNumber;
20 * Protocol specific bridge communication supported by the Velux bridge:
21 * <B>Authentication</B>
23 * Common Message semantic: Communication with the bridge and (optionally) storing returned information within the class
26 * As 2nd level interface it defines the methods to help in sending a query and
27 * processing the received answer.
29 * (Additional) Methods in this interface for the appropriate interaction:
31 * <LI>{@link getRequestCommand} to return the intended command to be sent.</LI>
32 * <LI>{@link getRequestDataAsArrayOfBytes} to return the intended data part to be sent.</LI>
33 * <LI>{@link setResponse} to store the response already separated into response command and data part.</LI>
34 * <LI>{@link isCommunicationFinished} to signal the completeness of the interaction (only available
35 * after storing the response).</LI>
38 * Other mandatory methods are inherited from {@link BridgeCommunicationProtocol}.
40 * @author Guenther Schreiner - Initial contribution.
43 interface SlipBridgeCommunicationProtocol extends BridgeCommunicationProtocol {
46 * Provides an empty array of bytes.
49 public static final byte[] EMPTYDATA = new byte[0];
52 * Returning the command part of the request object for further SLIP serialization.
54 * @return <b>commandNumber</b>
55 * is of type {@link CommandNumber}.
57 public CommandNumber getRequestCommand();
60 * Returning the data part of the request object for further SLIP serialization.
62 * @return <b>dataAsArrayOfBytes</b>
63 * is an Array of byte.
65 public byte[] getRequestDataAsArrayOfBytes();
68 * Storing the command and the data part of the response object for further checks.
70 * @param thisResponseCommand of type short: command part of the response packet.
71 * @param thisResponseData of type Array of bytes: data part of response packet to be processed.
72 * @param isSequentialEnforced of type boolean: enforces the strict handshake sequence even for long duration
75 public void setResponse(short thisResponseCommand, byte[] thisResponseData, boolean isSequentialEnforced);
78 * Returning the communication status included within the response message..
80 * @return <b>isFinished</b>
81 * is a boolean signaling the end of this transaction.
83 public boolean isCommunicationFinished();