From 2c8377d42a9ebd7c399322968d2c78fb377f55b0 Mon Sep 17 00:00:00 2001 From: Frank Schmirler Date: Wed, 6 Jul 2011 09:13:50 +0200 Subject: added support for VDR 1.7.19 SignalStrength/SignalQuality --- server/connectionVTP.c | 13 +++++++++++++ server/connectionVTP.h | 1 + server/livestreamer.c | 11 +++++++++++ server/livestreamer.h | 1 + 4 files changed, 26 insertions(+) (limited to 'server') diff --git a/server/connectionVTP.c b/server/connectionVTP.c index 2719fb4..64b5f37 100644 --- a/server/connectionVTP.c +++ b/server/connectionVTP.c @@ -840,6 +840,7 @@ bool cConnectionVTP::Command(char *Cmd) else if (strcasecmp(Cmd, "TUNE") == 0) return CmdTUNE(param); else if (strcasecmp(Cmd, "PLAY") == 0) return CmdPLAY(param); else if (strcasecmp(Cmd, "PRIO") == 0) return CmdPRIO(param); + else if (strcasecmp(Cmd, "SGNL") == 0) return CmdSGNL(param); else if (strcasecmp(Cmd, "ADDP") == 0) return CmdADDP(param); else if (strcasecmp(Cmd, "DELP") == 0) return CmdDELP(param); else if (strcasecmp(Cmd, "ADDF") == 0) return CmdADDF(param); @@ -1155,6 +1156,18 @@ bool cConnectionVTP::CmdPRIO(char *Opts) return Respond(550, "Priority not applicable"); } +bool cConnectionVTP::CmdSGNL(char *Opts) +{ + if (m_LiveStreamer) { + int devnum = -1; + int signal = -1; + int quality = -1; + m_LiveStreamer->GetSignal(&devnum, &signal, &quality); + return Respond(220, "%d %d:%d", devnum, signal, quality); + } + return Respond(550, "Signal not applicable"); +} + bool cConnectionVTP::CmdADDP(char *Opts) { int pid; diff --git a/server/connectionVTP.h b/server/connectionVTP.h index ee842fe..2d683f3 100644 --- a/server/connectionVTP.h +++ b/server/connectionVTP.h @@ -65,6 +65,7 @@ public: bool CmdTUNE(char *Opts); bool CmdPLAY(char *Opts); bool CmdPRIO(char *Opts); + bool CmdSGNL(char *Opts); bool CmdADDP(char *Opts); bool CmdDELP(char *Opts); bool CmdADDF(char *Opts); diff --git a/server/livestreamer.c b/server/livestreamer.c index f17025d..144f353 100644 --- a/server/livestreamer.c +++ b/server/livestreamer.c @@ -440,6 +440,17 @@ void cStreamdevLiveStreamer::SetPriority(int Priority) StartReceiver(); } +void cStreamdevLiveStreamer::GetSignal(int *DevNum, int *Strength, int *Quality) const +{ + if (m_Device) { + *DevNum = m_Device->DeviceNumber() + 1; +#if APIVERSNUM >= 10719 + *Strength = m_Device->SignalStrength(); + *Quality = m_Device->SignalQuality(); +#endif + } +} + void cStreamdevLiveStreamer::StartReceiver(void) { if (m_NumPids > 0) { diff --git a/server/livestreamer.h b/server/livestreamer.h index 71feb4c..6203966 100644 --- a/server/livestreamer.h +++ b/server/livestreamer.h @@ -39,6 +39,7 @@ public: bool SetPids(int Pid, const int *Pids1 = NULL, const int *Pids2 = NULL, const int *Pids3 = NULL); bool SetChannel(const cChannel *Channel, eStreamType StreamType, const int* Apid = NULL, const int* Dpid = NULL); void SetPriority(int Priority); + void GetSignal(int *DevNum, int *Strength, int *Quality) const; virtual int Put(const uchar *Data, int Count); virtual uchar *Get(int &Count); -- cgit v1.2.3