]> git.basschouten.com Git - openhab-addons.git/blob
8909c7bb26eba66de9bb89e6bda91e7ac84aa1c8
[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.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     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     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     boolean connect();
46
47     /**
48      * Return true if this manager is connected to the AVR.
49      *
50      * @return
51      */
52     boolean isConnected();
53
54     /**
55      * Closes the connection.
56      **/
57     void close();
58
59     /**
60      * Send a power state query to the AVR
61      *
62      * @param zone
63      * @return
64      */
65     boolean sendPowerQuery(int zone);
66
67     /**
68      * Send a volume level query to the AVR
69      *
70      * @param zone
71      * @return
72      */
73     boolean sendVolumeQuery(int zone);
74
75     /**
76      * Send a mute state query to the AVR
77      *
78      * @param zone
79      * @return
80      */
81     boolean sendMuteQuery(int zone);
82
83     /**
84      * Send a source input state query to the AVR
85      *
86      * @param zone
87      * @return
88      */
89     boolean sendInputSourceQuery(int zone);
90
91     /**
92      * Send a listening mode state query to the AVR
93      *
94      * @param zone
95      * @return
96      */
97     boolean sendListeningModeQuery(int zone);
98
99     /**
100      * Send an MCACC Memory query to the AVR
101      *
102      * @return
103      */
104     boolean sendMCACCMemoryQuery();
105
106     /**
107      * Send a power command ot the AVR based on the openHAB command
108      *
109      * @param command
110      * @param zone
111      * @return
112      */
113     boolean sendPowerCommand(Command command, int zone) throws CommandTypeNotSupportedException;
114
115     /**
116      * Send a volume command to the AVR based on the openHAB command
117      *
118      * @param command
119      * @param zone
120      * @return
121      */
122     boolean sendVolumeCommand(Command command, int zone) throws CommandTypeNotSupportedException;
123
124     /**
125      * Send a source input selection command to the AVR based on the openHAB command
126      *
127      * @param command
128      * @param zone
129      * @return
130      */
131     boolean sendInputSourceCommand(Command command, int zone) throws CommandTypeNotSupportedException;
132
133     /**
134      * Send a listening mode selection command to the AVR based on the openHAB command
135      *
136      * @param command
137      * @param zone
138      * @return
139      */
140     boolean sendListeningModeCommand(Command command, int zone) throws CommandTypeNotSupportedException;
141
142     /**
143      * Send a mute command to the AVR based on the openHAB command
144      *
145      * @param command
146      * @param zone
147      * @return
148      */
149     boolean sendMuteCommand(Command command, int zone) throws CommandTypeNotSupportedException;
150
151     /**
152      * Send an MCACC Memory selection command to the AVR based on the openHAB command
153      *
154      * @param command
155      * @param zone
156      * @return
157      */
158     boolean sendMCACCMemoryCommand(Command command) throws CommandTypeNotSupportedException;
159
160     /**
161      * Return the connection name
162      *
163      * @return
164      */
165     String getConnectionName();
166 }