]> git.basschouten.com Git - openhab-addons.git/blob
edcda596121f7e09a799c1098315b1703d9cf0ed
[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.pioneeravr.internal.protocol.avr;
14
15 import org.openhab.binding.pioneeravr.internal.protocol.event.AvrDisconnectionListener;
16 import org.openhab.binding.pioneeravr.internal.protocol.event.AvrUpdateListener;
17 import org.openhab.core.types.Command;
18
19 /**
20  * Represent a connection to a remote Pioneer AVR.
21  *
22  * @author Antoine Besnard - Initial contribution
23  * @author Leroy Foerster - Listening Mode, Playing Listening Mode
24  */
25 public interface AvrConnection {
26
27     /**
28      * Add an update listener. It is notified when an update is received from the AVR.
29      *
30      * @param listener
31      */
32     public void addUpdateListener(AvrUpdateListener listener);
33
34     /**
35      * Add a disconnection listener. It is notified when the AVR is disconnected.
36      *
37      * @param listener
38      */
39     public void addDisconnectionListener(AvrDisconnectionListener listener);
40
41     /**
42      * Connect to the receiver. Return true if the connection has succeeded or if already connected.
43      *
44      **/
45     public boolean connect();
46
47     /**
48      * Return true if this manager is connected to the AVR.
49      *
50      * @return
51      */
52     public boolean isConnected();
53
54     /**
55      * Closes the connection.
56      **/
57     public void close();
58
59     /**
60      * Send a power state query to the AVR
61      *
62      * @param zone
63      * @return
64      */
65     public boolean sendPowerQuery(int zone);
66
67     /**
68      * Send a volume level query to the AVR
69      *
70      * @param zone
71      * @return
72      */
73     public boolean sendVolumeQuery(int zone);
74
75     /**
76      * Send a mute state query to the AVR
77      *
78      * @param zone
79      * @return
80      */
81     public boolean sendMuteQuery(int zone);
82
83     /**
84      * Send a source input state query to the AVR
85      *
86      * @param zone
87      * @return
88      */
89     public boolean sendInputSourceQuery(int zone);
90
91     /**
92      * Send a listening mode state query to the AVR
93      *
94      * @param zone
95      * @return
96      */
97     public boolean sendListeningModeQuery(int zone);
98
99     /**
100      * Send a power command ot the AVR based on the openHAB command
101      *
102      * @param command
103      * @param zone
104      * @return
105      */
106     public boolean sendPowerCommand(Command command, int zone) throws CommandTypeNotSupportedException;
107
108     /**
109      * Send a volume command to the AVR based on the openHAB command
110      *
111      * @param command
112      * @param zone
113      * @return
114      */
115     public boolean sendVolumeCommand(Command command, int zone) throws CommandTypeNotSupportedException;
116
117     /**
118      * Send a source input selection command to the AVR based on the openHAB command
119      *
120      * @param command
121      * @param zone
122      * @return
123      */
124     public boolean sendInputSourceCommand(Command command, int zone) throws CommandTypeNotSupportedException;
125
126     /**
127      * Send a listening mode selection command to the AVR based on the openHAB command
128      *
129      * @param command
130      * @param zone
131      * @return
132      */
133     public boolean sendListeningModeCommand(Command command, int zone) throws CommandTypeNotSupportedException;
134
135     /**
136      * Send a mute command to the AVR based on the openHAB command
137      *
138      * @param command
139      * @param zone
140      * @return
141      */
142     public boolean sendMuteCommand(Command command, int zone) throws CommandTypeNotSupportedException;
143
144     /**
145      * Return the connection name
146      *
147      * @return
148      */
149     public String getConnectionName();
150 }