2 * Copyright (c) 2010-2023 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.pioneeravr.internal.protocol.avr;
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;
20 * Represent a connection to a remote Pioneer AVR.
22 * @author Antoine Besnard - Initial contribution
23 * @author Leroy Foerster - Listening Mode, Playing Listening Mode
25 public interface AvrConnection {
28 * Add an update listener. It is notified when an update is received from the AVR.
32 void addUpdateListener(AvrUpdateListener listener);
35 * Add a disconnection listener. It is notified when the AVR is disconnected.
39 void addDisconnectionListener(AvrDisconnectionListener listener);
42 * Connect to the receiver. Return true if the connection has succeeded or if already connected.
48 * Return true if this manager is connected to the AVR.
52 boolean isConnected();
55 * Closes the connection.
60 * Send a power state query to the AVR
65 boolean sendPowerQuery(int zone);
68 * Send a volume level query to the AVR
73 boolean sendVolumeQuery(int zone);
76 * Send a mute state query to the AVR
81 boolean sendMuteQuery(int zone);
84 * Send a source input state query to the AVR
89 boolean sendInputSourceQuery(int zone);
92 * Send a listening mode state query to the AVR
97 boolean sendListeningModeQuery(int zone);
100 * Send an MCACC Memory query to the AVR
104 boolean sendMCACCMemoryQuery();
107 * Send a power command ot the AVR based on the openHAB command
113 boolean sendPowerCommand(Command command, int zone) throws CommandTypeNotSupportedException;
116 * Send a volume command to the AVR based on the openHAB command
122 boolean sendVolumeCommand(Command command, int zone) throws CommandTypeNotSupportedException;
125 * Send a source input selection command to the AVR based on the openHAB command
131 boolean sendInputSourceCommand(Command command, int zone) throws CommandTypeNotSupportedException;
134 * Send a listening mode selection command to the AVR based on the openHAB command
140 boolean sendListeningModeCommand(Command command, int zone) throws CommandTypeNotSupportedException;
143 * Send a mute command to the AVR based on the openHAB command
149 boolean sendMuteCommand(Command command, int zone) throws CommandTypeNotSupportedException;
152 * Send an MCACC Memory selection command to the AVR based on the openHAB command
157 boolean sendMCACCMemoryCommand(Command command) throws CommandTypeNotSupportedException;
160 * Return the connection name
164 String getConnectionName();