2000-07-23 15:01:31 +02:00
|
|
|
/*
|
|
|
|
* svdrp.h: Simple Video Disk Recorder Protocol
|
|
|
|
*
|
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
|
|
* how to reach the author.
|
|
|
|
*
|
2018-03-17 10:07:19 +01:00
|
|
|
* $Id: svdrp.h 4.11 2018/03/15 16:30:29 kls Exp $
|
2000-07-23 15:01:31 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SVDRP_H
|
|
|
|
#define __SVDRP_H
|
|
|
|
|
2018-03-04 14:15:07 +01:00
|
|
|
#include "thread.h"
|
2015-05-22 13:44:43 +02:00
|
|
|
#include "tools.h"
|
|
|
|
|
2017-06-30 09:50:44 +02:00
|
|
|
enum eSvdrpPeerModes {
|
|
|
|
spmOff = 0,
|
|
|
|
spmAny = 1,
|
|
|
|
spmOnly = 2,
|
|
|
|
};
|
|
|
|
|
2018-03-04 14:15:07 +01:00
|
|
|
extern cStateKey StateKeySVDRPRemoteTimersPoll;
|
|
|
|
///< Controls whether a change to the local list of timers needs to result in
|
|
|
|
///< sending a POLL to the remote clients.
|
|
|
|
|
2015-09-08 11:08:06 +02:00
|
|
|
void SetSVDRPPorts(int TcpPort, int UdpPort);
|
2015-04-29 13:10:06 +02:00
|
|
|
void SetSVDRPGrabImageDir(const char *GrabImageDir);
|
2018-02-25 13:57:21 +01:00
|
|
|
void StartSVDRPHandler(void);
|
|
|
|
void StopSVDRPHandler(void);
|
2018-03-17 10:07:19 +01:00
|
|
|
bool GetSVDRPServerNames(cStringList *ServerNames);
|
2015-05-22 13:44:43 +02:00
|
|
|
///< Gets a list of all available VDRs this VDR is connected to via SVDRP,
|
|
|
|
///< and stores it in the given ServerNames list. The list is cleared
|
|
|
|
///< before getting the server names.
|
|
|
|
///< Returns true if the resulting list is not empty.
|
2015-09-10 10:39:45 +02:00
|
|
|
bool ExecSVDRPCommand(const char *ServerName, const char *Command, cStringList *Response = NULL);
|
|
|
|
///< Sends the given SVDRP Command string to the remote VDR identified
|
|
|
|
///< by ServerName and collects all of the response strings in Response.
|
|
|
|
///< If no Response parameter is given, the response from command execution
|
|
|
|
///< is ignored.
|
|
|
|
///< Returns true if the data exchange was successful. Whether or
|
|
|
|
///< not the actual SVDRP command was successful depends on the
|
|
|
|
///< resulting strings from the remote VDR, which can be accessed
|
|
|
|
///< through Response. If Response is given, it will be cleared before
|
|
|
|
///< the command is actually executed.
|
2017-06-25 12:43:09 +02:00
|
|
|
void BroadcastSVDRPCommand(const char *Command);
|
|
|
|
///< Sends the given SVDRP Command string to all remote VDRs.
|
2015-09-10 10:39:45 +02:00
|
|
|
inline int SVDRPCode(const char *s) { return s ? atoi(s) : 0; }
|
|
|
|
///< Returns the value of the three digit reply code of the given
|
|
|
|
///< SVDRP response string.
|
|
|
|
inline const char *SVDRPValue(const char *s) { return s && s[0] && s[1] && s[2] && s[3] ? s + 4 : NULL; }
|
|
|
|
///< Returns the actual value of the given SVDRP response string, skipping
|
|
|
|
///< the three digit reply code and possible continuation line indicator.
|
2000-07-23 15:01:31 +02:00
|
|
|
|
|
|
|
#endif //__SVDRP_H
|