From 59ca850ecc4d67b5e2dc4176cdea44b210841256 Mon Sep 17 00:00:00 2001 From: Christian Schuett Date: Sun, 2 Nov 2014 20:53:20 +0100 Subject: [PATCH] nhttpd controlapi: allow zapping to subchannels based on idea by Moritz Venn Signed-off-by: Christian Schuett --- src/nhttpd/doc/nhttpd_controlapi.html | 14 ++++++++++++++ src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 17 ++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 7eae99bb2..89adf2763 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -797,6 +797,20 @@ ok
>>>http://dbox/control/setmode?record=stop
ok
+
+Parameter: subchannel=<channel_id> (64 bit, hexidecimal value)
+Rueckgabe:
+
+Zappt auf den angegebenen Unterkanal.
+Als Rueckgabe ist im Erfolgsfall ok zu erwarten.
+
+Rueckgabe-Format: ok / error
+
+Beispiel:
+
+>>>http://dbox/control/zapto?subchannel=1008500d4
+ok
+
8. Radio/TV Mode Abfrage
diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 99971d5ef..9b2dd8171 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -1653,7 +1653,9 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) CSectionsdClient::LinkageDescriptorList desc; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); - if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) + + if (currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors && + CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey, desc)) { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(current_channel); t_satellite_position satellitePosition = channel->getSatellitePosition(); @@ -1669,6 +1671,19 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) } } } + else if (!hh->ParamList["subchannel"].empty()) + { + t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); + CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); + if (currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors) + { + NeutrinoAPI->ZapToSubService(hh->ParamList["subchannel"].c_str()); + hh->SendOk(); + } + else + hh->SendError(); + } else if (hh->ParamList["name"] != "") { t_channel_id channel_id;