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.powermax.internal.connector;
15 import java.io.IOException;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.powermax.internal.message.PowermaxMessageEventListener;
21 * Interface for communication with the Visonic alarm panel
23 * @author Laurent Garnier - Initial contribution
26 public interface PowermaxConnectorInterface {
29 * Method for opening a connection to the Visonic alarm panel.
31 void open() throws Exception;
34 * Method for closing a connection to the Visonic alarm panel.
39 * Returns connection status
41 * @return: true if connected or false if not
43 boolean isConnected();
46 * Method for sending a message to the Visonic alarm panel
48 * @param data the message as a table of bytes
50 void sendMessage(byte[] data);
53 * Method for reading data from the Visonic alarm panel
55 * @param buffer the buffer into which the data is read
57 int read(byte[] buffer) throws IOException;
60 * Method for registering an event listener
62 * @param listener the listener to be registered
64 void addEventListener(PowermaxMessageEventListener listener);
67 * Method for removing an event listener
69 * @param listener the listener to be removed
71 void removeEventListener(PowermaxMessageEventListener listener);