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.nibeheatpump.internal.connection;
15 import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException;
16 import org.openhab.binding.nibeheatpump.internal.config.NibeHeatPumpConfiguration;
17 import org.openhab.binding.nibeheatpump.internal.message.NibeHeatPumpMessage;
20 * Define interface to communicate Nibe heat pumps.
22 * @author Pauli Anttila - Initial contribution
24 public interface NibeHeatPumpConnector {
27 * Procedure for connect to heat pump.
29 * @param configuration
30 * Configuration parameters for connector.
32 * @throws NibeHeatPumpException
34 void connect(NibeHeatPumpConfiguration configuration) throws NibeHeatPumpException;
37 * Procedure for disconnect from heat pump.
42 * Procedure for register event listener.
45 * Event listener instance to handle events.
47 void addEventListener(NibeHeatPumpEventListener listener);
50 * Procedure for remove event listener.
53 * Event listener instance to remove.
55 void removeEventListener(NibeHeatPumpEventListener listener);
58 * Procedure for sending datagram to heat pump.
60 * @throws NibeHeatPumpException
62 void sendDatagram(NibeHeatPumpMessage msg) throws NibeHeatPumpException;
65 * Procedure to check if connector is currently connected to heat pump.
67 * @return true, if connected
69 boolean isConnected();