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.vdr.internal.svdrp;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * The {@link SVDRPClient} encapsulates all calls to the SVDRP interface of a VDR
20 * @author Matthias Klocke - Initial contribution
23 public interface SVDRPClient {
27 * Open VDR Socket Connection
29 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
30 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
32 public void openConnection() throws SVDRPConnectionException, SVDRPParseResponseException;
35 * Close VDR Socket Connection
37 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
38 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
40 public void closeConnection() throws SVDRPConnectionException, SVDRPParseResponseException;
43 * Retrieve Disk Status from SVDRP Client
45 * @return SVDRP Disk Status
46 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
47 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
49 public SVDRPDiskStatus getDiskStatus() throws SVDRPConnectionException, SVDRPParseResponseException;
52 * Retrieve EPG Event from SVDRPClient
54 * @param type Type of EPG Event (now, next)
55 * @return SVDRP EPG Event
56 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
57 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
59 public SVDRPEpgEvent getEpgEvent(SVDRPEpgEvent.TYPE type)
60 throws SVDRPConnectionException, SVDRPParseResponseException;
63 * Retrieve current volume from SVDRP Client
65 * @return SVDRP Volume Object
66 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
67 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
69 public SVDRPVolume getSVDRPVolume() throws SVDRPConnectionException, SVDRPParseResponseException;
72 * Set volume on SVDRP Client
74 * @param newVolume Volume in Percent
75 * @return SVDRP Volume Object
76 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
77 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
79 public SVDRPVolume setSVDRPVolume(int newVolume) throws SVDRPConnectionException, SVDRPParseResponseException;
82 * Send Key command to SVDRP Client
84 * @param key Key Command to send
85 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
86 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
88 public void sendSVDRPKey(String key) throws SVDRPConnectionException, SVDRPParseResponseException;
91 * Send Message to SVDRP Client
93 * @param message Message to send
94 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
95 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
97 public void sendSVDRPMessage(String message) throws SVDRPConnectionException, SVDRPParseResponseException;
100 * Retrieve current Channel from SVDRP Client
102 * @return SVDRPChannel object
103 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
104 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
106 public SVDRPChannel getCurrentSVDRPChannel() throws SVDRPConnectionException, SVDRPParseResponseException;
109 * Change current Channel on SVDRP Client
111 * @param number Channel to be set
112 * @return SVDRPChannel object
113 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
114 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
116 public SVDRPChannel setSVDRPChannel(int number) throws SVDRPConnectionException, SVDRPParseResponseException;
119 * Retrieve from SVDRP Client if a recording is currently active
121 * @return is currently a recording active
122 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
123 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
125 public boolean isRecordingActive() throws SVDRPConnectionException, SVDRPParseResponseException;
128 * Retrieve VDR Version from SVDRP Client
130 * @return VDR Version
131 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
132 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
134 public String getSVDRPVersion();