]> git.basschouten.com Git - openhab-addons.git/blob
9cf3241622fa16ecf42d855084b3c55098c61b39
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.powermax.internal.connector;
14
15 import java.io.IOException;
16
17 import org.openhab.binding.powermax.internal.message.PowermaxMessageEventListener;
18
19 /**
20  * Interface for communication with the Visonic alarm panel
21  *
22  * @author Laurent Garnier - Initial contribution
23  */
24 public interface PowermaxConnectorInterface {
25
26     /**
27      * Method for opening a connection to the Visonic alarm panel.
28      */
29     public void open() throws Exception;
30
31     /**
32      * Method for closing a connection to the Visonic alarm panel.
33      */
34     public void close();
35
36     /**
37      * Returns connection status
38      *
39      * @return: true if connected or false if not
40      **/
41     public boolean isConnected();
42
43     /**
44      * Method for sending a message to the Visonic alarm panel
45      *
46      * @param data the message as a table of bytes
47      **/
48     public void sendMessage(byte[] data);
49
50     /**
51      * Method for reading data from the Visonic alarm panel
52      *
53      * @param buffer the buffer into which the data is read
54      **/
55     public int read(byte[] buffer) throws IOException;
56
57     /**
58      * Method for registering an event listener
59      *
60      * @param listener the listener to be registered
61      */
62     public void addEventListener(PowermaxMessageEventListener listener);
63
64     /**
65      * Method for removing an event listener
66      *
67      * @param listener the listener to be removed
68      */
69     public void removeEventListener(PowermaxMessageEventListener listener);
70 }