2 * Copyright (c) 2010-2021 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.openhab.binding.powermax.internal.message.PowermaxMessageEventListener;
20 * Interface for communication with the Visonic alarm panel
22 * @author Laurent Garnier - Initial contribution
24 public interface PowermaxConnectorInterface {
27 * Method for opening a connection to the Visonic alarm panel.
32 * Method for closing a connection to the Visonic alarm panel.
37 * Returns connection status
39 * @return: true if connected or false if not
41 public boolean isConnected();
44 * Method for sending a message to the Visonic alarm panel
46 * @param data the message as a table of bytes
48 public void sendMessage(byte[] data);
51 * Method for reading data from the Visonic alarm panel
53 * @param buffer the buffer into which the data is read
55 public int read(byte[] buffer) throws IOException;
58 * Method for registering an event listener
60 * @param listener the listener to be registered
62 public void addEventListener(PowermaxMessageEventListener listener);
65 * Method for removing an event listener
67 * @param listener the listener to be removed
69 public void removeEventListener(PowermaxMessageEventListener listener);