2 * Copyright (c) 2010-2024 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.samsungtv.internal.protocol;
15 import java.util.List;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
21 * The {@link RemoteController} is the base class for handling remote control keys for the Samsung TV.
23 * @author Arjan Mels - Initial contribution
26 public abstract class RemoteController implements AutoCloseable {
27 protected String host;
29 protected String appName;
30 protected String uniqueId;
32 public RemoteController(String host, int port, @Nullable String appName, @Nullable String uniqueId) {
35 this.appName = appName != null ? appName : "";
36 this.uniqueId = uniqueId != null ? uniqueId : "";
39 public abstract void openConnection() throws RemoteControllerException;
41 public abstract boolean isConnected();
43 public abstract void sendKey(KeyCode key) throws RemoteControllerException;
45 public abstract void sendKeys(List<KeyCode> keys) throws RemoteControllerException;
48 public abstract void close() throws RemoteControllerException;