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 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 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 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 SVDRPEpgEvent getEpgEvent(SVDRPEpgEvent.TYPE type) throws SVDRPConnectionException, SVDRPParseResponseException;
62 * Retrieve current volume from SVDRP Client
64 * @return SVDRP Volume Object
65 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
66 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
68 SVDRPVolume getSVDRPVolume() throws SVDRPConnectionException, SVDRPParseResponseException;
71 * Set volume on SVDRP Client
73 * @param newVolume Volume in Percent
74 * @return SVDRP Volume Object
75 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
76 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
78 SVDRPVolume setSVDRPVolume(int newVolume) throws SVDRPConnectionException, SVDRPParseResponseException;
81 * Send Key command to SVDRP Client
83 * @param key Key Command to send
84 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
85 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
87 void sendSVDRPKey(String key) throws SVDRPConnectionException, SVDRPParseResponseException;
90 * Send Message to SVDRP Client
92 * @param message Message to send
93 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
94 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
96 void sendSVDRPMessage(String message) throws SVDRPConnectionException, SVDRPParseResponseException;
99 * Retrieve current Channel from SVDRP Client
101 * @return SVDRPChannel object
102 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
103 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
105 SVDRPChannel getCurrentSVDRPChannel() throws SVDRPConnectionException, SVDRPParseResponseException;
108 * Change current Channel on SVDRP Client
110 * @param number Channel to be set
111 * @return SVDRPChannel object
112 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
113 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
115 SVDRPChannel setSVDRPChannel(int number) throws SVDRPConnectionException, SVDRPParseResponseException;
118 * Retrieve from SVDRP Client if a recording is currently active
120 * @return is currently a recording active
121 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
122 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
124 boolean isRecordingActive() throws SVDRPConnectionException, SVDRPParseResponseException;
127 * Retrieve VDR Version from SVDRP Client
129 * @return VDR Version
130 * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
131 * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
133 String getSVDRPVersion();