]> git.basschouten.com Git - openhab-addons.git/blob
0c4ba43600019fb2935bc02d456da8fc34078ad2
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.rfxcom.internal.connector;
14
15 import java.io.IOException;
16
17 import org.openhab.binding.rfxcom.internal.config.RFXComBridgeConfiguration;
18
19 /**
20  * This interface defines interface to communicate RFXCOM controller.
21  *
22  * @author Pauli Anttila - Initial contribution
23  */
24 public interface RFXComConnectorInterface {
25
26     /**
27      * Procedure for connecting to RFXCOM controller.
28      *
29      * @param device Controller connection parameters (e.g. serial port name or IP address).
30      */
31     void connect(RFXComBridgeConfiguration device) throws Exception;
32
33     /**
34      * Procedure for disconnecting to RFXCOM controller.
35      *
36      */
37     void disconnect();
38
39     /**
40      * Procedure for send raw data to RFXCOM controller.
41      *
42      * @param data raw bytes.
43      */
44     void sendMessage(byte[] data) throws IOException;
45
46     /**
47      * Procedure for register event listener.
48      *
49      * @param listener Event listener instance to handle events.
50      */
51     void addEventListener(RFXComEventListener listener);
52
53     /**
54      * Procedure for remove event listener.
55      *
56      * @param listener Event listener instance to remove.
57      */
58     void removeEventListener(RFXComEventListener listener);
59 }