trunk 20080912
[gitenigma.git] / src / enigma_dyn_xml.cpp
blob3a13b5b442d034222fcbd7ec3b17130ec4789c83
1 /*
2 * $Id: enigma_dyn_xml.cpp,v 1.39 2007/04/14 07:29:26 gaxelsson Exp $
4 * (C) 2005 by digi_casi <digi_casi@tuxbox.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <map>
23 #include <time.h>
24 #include <fcntl.h>
25 #include <unistd.h>
26 #include <stdio.h>
27 #include <dirent.h>
28 #include <sys/types.h>
29 #include <sys/stat.h>
31 #include <sys/socket.h>
32 #include <sys/ioctl.h>
33 #include <net/if.h>
34 #include <arpa/inet.h>
35 #include <linux/if_ether.h>
36 #include <iomanip>
37 #include <iostream>
38 #include <fstream>
40 #include <enigma.h>
41 #include <enigma_main.h>
42 #include <enigma_standby.h>
43 #include <timer.h>
44 #include <lib/driver/eavswitch.h>
45 #include <lib/dvb/dvb.h>
46 #include <lib/dvb/edvb.h>
47 #include <lib/dvb/epgcache.h>
48 #include <lib/dvb/servicestructure.h>
49 #include <lib/dvb/decoder.h>
50 #include <lib/dvb/dvbservice.h>
51 #include <lib/dvb/service.h>
52 #include <lib/dvb/record.h>
53 #include <lib/dvb/serviceplaylist.h>
54 #include <lib/dvb/frontend.h>
56 #include <lib/system/info.h>
57 #include <lib/system/http_dyn.h>
58 #include <lib/system/econfig.h>
59 #include <enigma_dyn.h>
60 #include <enigma_dyn_utils.h>
61 #include <enigma_dyn_xml.h>
62 #include <enigma_dyn_epg.h>
63 #include <enigma_dyn_timer.h>
64 #include <streaminfo.h>
66 using namespace std;
68 extern eString zap[5][5];
69 extern bool onSameTP(const eServiceReferenceDVB& ref1, const eServiceReferenceDVB &ref2); // implemented in timer.cpp
70 extern eString getIP(void);
71 extern eString getBoxInfo(eString, eString);
72 extern eString getBoxStatus(eString);
74 static eString getXMLBoxInfo(eString request, eString dirpath, eString opts, eHTTPConnection *content)
76 content->local_header["Content-Type"]="text/xml; charset=utf-8";
77 return getBoxInfo("BoxInfo", "XML");
80 static eString getXMLBoxStatus(eString request, eString dirpath, eString opt, eHTTPConnection *content)
82 content->local_header["Content-Type"]="text/xml; charset=utf-8";
83 return getBoxStatus("XML");
86 extern eString getCurrentSubChannel(eString);
88 eString XMLify(eString s, eString format)
90 if (format == "XML")
91 s.strReplace("&", "&amp;");
92 return s;
95 static eString getXMLCurrentServiceData(eString request, eString dirpath, eString opt, eHTTPConnection *content)
97 eString now_start, now_date, now_time, now_duration, now_text, now_longtext,
98 next_start, next_date, next_time, next_duration, next_text, next_longtext;
100 eString result = readFile(TEMPLATE_DIR + "XMLCurrentServiceData.tmp");
102 content->local_header["Content-Type"]="text/xml; charset=utf-8";
104 eDVBServiceController *sapi=eDVB::getInstance()->getServiceAPI();
105 if (sapi)
107 eService *current = eDVB::getInstance()->settings->getTransponders()->searchService(sapi->service);
108 if (current)
110 eString curService = current->service_name;
111 eString curSubService = getCurrentSubChannel(ref2string(sapi->service));
112 if (curSubService)
114 if (curService)
115 curService += ": " + curSubService;
116 else
117 curService = curSubService;
119 result.strReplace("#NAME#", XMLify(curService, "XML"));
120 result.strReplace("#REFERENCE#", ref2string(sapi->service));
122 else
124 result.strReplace("#NAME#", "");
125 result.strReplace("#REFERENCE#", "");
129 result = getEITC(result, "XML");
131 std::stringstream tmp;
132 if (sapi)
134 std::list<eDVBServiceController::audioStream> &astreams(sapi->audioStreams);
135 for (std::list<eDVBServiceController::audioStream>::iterator it(astreams.begin())
136 ;it != astreams.end(); ++it)
138 tmp << "<channel>"
139 << "<pid>"
140 << eString().sprintf("0x%04x", it->pmtentry->elementary_PID)
141 << "</pid>"
142 << "<selected>";
143 if (it->pmtentry->elementary_PID == Decoder::current.apid)
144 tmp << "1";
145 else
146 tmp << "0";
147 tmp << "</selected><name>" << it->text << "</name>";
148 tmp << "</channel>";
151 result.strReplace("#AUDIOCHANNELS#", tmp.str());
153 switch (eAVSwitch::getInstance()->getAudioChannel())
155 case 0: result.strReplace("#AUDIOTRACK#", "LEFT"); break;
156 case 1: result.strReplace("#AUDIOTRACK#", "STEREO"); break;
157 case 2: result.strReplace("#AUDIOTRACK#", "RIGHT"); break;
158 default: result.strReplace("#AUDIOTRACK#", ""); break;
161 tmp.clear();
162 tmp.str("");
163 eString curServiceRef = ref2string(eServiceInterface::getInstance()->service);
164 if (curServiceRef)
166 eString s1 = curServiceRef; int pos; eString nspace;
167 for (int i = 0; i < 7 && s1.find(":") != eString::npos; i++)
169 pos = s1.find(":");
170 nspace = s1.substr(0, pos);
171 s1 = s1.substr(pos + 1);
173 EIT *eit = eDVB::getInstance()->getEIT();
174 if (eit)
176 int p = 0;
177 for (ePtrList<EITEvent>::iterator i(eit->events); i != eit->events.end(); ++i)
179 EITEvent *event = *i;
180 if ((event->running_status >= 2) || ((!p) && (!event->running_status)))
182 for (ePtrList<Descriptor>::iterator d(event->descriptor); d != event->descriptor.end(); ++d)
184 if (d->Tag() == DESCR_LINKAGE)
186 LinkageDescriptor *ld = (LinkageDescriptor *)*d;
187 if (ld->linkage_type == 0xB0) //subchannel
189 eString subService((char *)ld->private_data, ld->priv_len);
190 eString subServiceRef = "1:0:7:" + eString().sprintf("%x", ld->service_id) + ":" + eString().sprintf("%x", ld->transport_stream_id) + ":" + eString().sprintf("%x", ld->original_network_id) + ":"
191 + eString(nspace) + ":0:0:0:";
192 tmp << "<service>";
193 tmp << "<reference>" << subServiceRef << "</reference>";
194 tmp << "<name>" << XMLify(subService, "XML") << "</name>";
195 if (subServiceRef == curServiceRef)
196 tmp << "<selected>1</selected>";
197 else
198 tmp << "<selected>0</selected>";
199 tmp << "</service>";
204 ++p;
206 eit->unlock();
209 result.strReplace("#VIDEOCHANNELS#", tmp.str());
211 return result;
214 static eString getXMLServiceEPG(eString request, eString dirpath, eString opts, eHTTPConnection *content)
216 content->local_header["Content-Type"]="text/html; charset=utf-8";
217 return getServiceEPG("XML", opts);
220 eString getTag(int mode, int submode)
222 eString tag;
223 switch(mode)
225 case 3:
226 tag = "movie";
227 break;
228 case 4:
229 tag = "file";
230 break;
231 default:
232 switch(submode)
234 case 2: tag = "satellite"; break;
235 case 3: tag = "provider"; break;
236 case 4: tag = "bouquet"; break;
237 default: tag = "unknown"; break;
240 return tag;
243 struct getContent: public Object
245 int mode;
246 int subm;
247 eString &result;
248 eServiceInterface *iface;
249 bool listCont;
250 getContent(int mode, int subm, const eServiceReference &service, eString &result, bool listCont)
251 :mode(mode), subm(subm), result(result), iface(eServiceInterface::getInstance()), listCont(listCont)
253 Signal1<void, const eServiceReference&> cbSignal;
254 CONNECT(cbSignal, getContent::addToString);
255 iface->enterDirectory(service, cbSignal);
256 iface->leaveDirectory(service);
258 void addToString(const eServiceReference& ref)
260 // sorry.. at moment we dont show any directory.. or locked service in webif
261 if (ref.isLocked() && eConfig::getInstance()->pLockActive())
262 return;
264 eService *service = iface ? iface->addRef(ref) : 0;
265 if (!(ref.data[0] == -1 && ref.data[2] != (int)0xFFFFFFFF))
268 if (ref.flags & eServiceReference::isDirectory)
269 result += "\n<" + getTag(mode, subm) + ">";
270 else
271 result += "\n<service>";
273 result += "<reference>" + ref.toString() + "</reference>";
275 if (ref.descr)
276 result += "<name>" + XMLify(filter_string(ref.descr), "XML") + "</name>";
277 else
278 if (service)
280 result += "<name>" + XMLify(filter_string(service->service_name), "XML") + "</name>";
281 if (ref.type == eServiceReference::idDVB && !(ref.flags & eServiceReference::isDirectory))
282 result += "<provider>" + XMLify(filter_string(((eServiceDVB*)service)->service_provider), "XML") + "</provider>";
285 if (ref.type == eServiceReference::idDVB && !(ref.flags & eServiceReference::isDirectory))
287 const eServiceReferenceDVB& dvb_ref = (const eServiceReferenceDVB&)ref;
288 eTransponder *tp = eTransponderList::getInstance()->searchTS(
289 dvb_ref.getDVBNamespace(),
290 dvb_ref.getTransportStreamID(),
291 dvb_ref.getOriginalNetworkID());
292 if (tp && tp->satellite.isValid())
293 result += "<orbital_position>" + eString().setNum(tp->satellite.orbital_position) + "</orbital_position>";
296 if (service)
297 iface->removeRef(ref);
299 if (listCont && ref.flags & eServiceReference::isDirectory)
301 getContent(mode, subm, ref, result, false);
302 result += "\n</" + getTag(mode, subm) + ">";
304 else
305 result += "</service>";
310 static eString getXMLServices(eString request, eString dirpath, eString opt, eHTTPConnection *content)
312 /* MODE: 0 = TV, 1 = Radio, 2 = Data, 3 = Movies, 4 = Root */
313 /* SUBMODE: 0 = n/a, 1 = All, 2 = Satellites, 2 = Providers, 4 = Bouquets */
315 content->local_header["Content-Type"] = "text/xml; charset=utf-8";
316 std::map<eString,eString> opts = getRequestOptions(opt, '&');
318 eString mode = "0";
319 if (opts["mode"])
320 mode = opts["mode"];
321 int mod = atoi(mode.c_str());
323 eString submode = "2";
324 if (opts["submode"])
325 submode = opts["submode"];
326 int subm = atoi(submode.c_str());
328 eString sref = zap[mod][subm];
329 eServiceReference ref(sref);
331 eString result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
332 result += "<" + getTag(mod, subm) + "s>";
333 getContent t(mod, subm, ref, result, true);
334 result += "\n</" + getTag(mod, subm) + "s>";
335 result.strReplace("&", "&amp;");
336 // result.strReplace("<", "&lt;");
337 // result.strReplace(">", "&gt;");
338 // result.strReplace("\'", "&apos;");
339 // result.strReplace("\"", "&quot;");
340 return result;
343 static eString getXSLStreamInfo(eString request, eString dirpath, eString opt, eHTTPConnection *content)
345 eString result;
347 content->local_header["Content-Type"] = "text/xml; charset=utf-8";
348 switch(eSystemInfo::getInstance()->getFEType())
350 case eSystemInfo::feSatellite:
351 result = readFile(TEMPLATE_DIR + "streaminfo_satellite.xsl");
352 break;
353 case eSystemInfo::feCable:
354 result = readFile(TEMPLATE_DIR + "streaminfo_cable.xsl");
355 break;
356 case eSystemInfo::feTerrestrial:
357 result = readFile(TEMPLATE_DIR + "streaminfo_terrestrial.xsl");
358 break;
359 default:
360 result = readFile(TEMPLATE_DIR + "streaminfo_unknown.xsl");
363 return result;
366 static eString getXSLServiceEPG(eString request, eString dirpath, eString opt, eHTTPConnection *content)
368 eString result;
370 content->local_header["Content-Type"] = "text/xml; charset=utf-8";
371 result = readFile(TEMPLATE_DIR + "serviceepg.xsl");
373 return result;
376 static eString getXMLStreamInfo(eString request, eString dirpath, eString opt, eHTTPConnection *content)
378 eString result = readFile(TEMPLATE_DIR + "XMLStreaminfo.tmp");
380 eDVBServiceController *sapi = eDVB::getInstance()->getServiceAPI();
381 if (!sapi)
382 return "not available";
384 eServiceDVB *service=eDVB::getInstance()->settings->getTransponders()->searchService(sapi->service);
385 if (service)
387 result.strReplace("#SERVICENAME#", XMLify(filter_string(service->service_name), "XML"));
388 result.strReplace("#PROVIDER#", XMLify(filter_string(service->service_provider), "XML"));
390 else
392 result.strReplace("#SERVICENAME#", "n/a");
393 result.strReplace("#PROVIDER#", "n/a");
395 result.strReplace("#VPID#", eString().sprintf("%04xh (%dd)", Decoder::current.vpid, Decoder::current.vpid));
396 result.strReplace("#APID#", eString().sprintf("%04xh (%dd)", Decoder::current.apid, Decoder::current.apid));
397 result.strReplace("#PCRPID#", eString().sprintf("%04xh (%dd)", Decoder::current.pcrpid, Decoder::current.pcrpid));
398 result.strReplace("#TPID#", eString().sprintf("%04xh (%dd)", Decoder::current.tpid, Decoder::current.tpid));
399 result.strReplace("#TSID#", eString().sprintf("%04xh", sapi->service.getTransportStreamID().get()));
400 result.strReplace("#ONID#", eString().sprintf("%04xh", sapi->service.getOriginalNetworkID().get()));
401 result.strReplace("#SID#", eString().sprintf("%04xh", sapi->service.getServiceID().get()));
402 result.strReplace("#PMT#", eString().sprintf("%04xh", Decoder::current.pmtpid));
403 result.strReplace("#NAMESPACE#", eString().sprintf("%04xh", sapi->service.getDVBNamespace().get()));
405 eString sRef;
407 if (eServiceInterface::getInstance()->service)
408 sRef = eServiceInterface::getInstance()->service.toString();
409 result.strReplace("#SERVICEREFERENCE#", sRef);
410 result.strReplace("#VIDEOFORMAT#", getVidFormat());
412 extern struct caids_t caids[];
413 extern unsigned int caids_cnt;
415 clearCA();
416 eString cryptSystems;
417 // singleLock s(eDVBServiceController::availCALock);
418 std::set<int>& availCA = sapi->availableCASystems;
419 for (std::set<int>::iterator i(availCA.begin()); i != availCA.end(); ++i)
421 eString caname = eStreaminfo::getInstance()->getCAName(*i, 0);
422 if (caname)
424 if (cryptSystems)
425 cryptSystems += ", ";
426 cryptSystems += caname;
429 result.strReplace("#SUPPORTEDCRYPTSYSTEMS#", cryptSystems);
431 int foundone = 0;
432 cryptSystems = "";
433 std::set<int>& calist = sapi->usedCASystems;
434 for (std::set<int>::iterator i(calist.begin()); i != calist.end(); ++i)
436 eString caname = eStreaminfo::getInstance()->getCAName(*i, 1);
437 eString codesys = eString().sprintf("%04xh: ", *i) + caname;
438 if (cryptSystems)
439 cryptSystems += ", ";
440 cryptSystems += codesys;
441 foundone++;
443 if (!foundone)
444 cryptSystems = "None";
445 result.strReplace("#USEDCRYPTSYSTEMS#", cryptSystems);
447 int tpData = 0;
448 eTransponder *tp = sapi->transponder;
449 if (tp)
451 switch(eSystemInfo::getInstance()->getFEType())
453 case eSystemInfo::feSatellite:
455 result.strReplace("#FRONTEND#", "DVB-S");
456 for (std::list<eLNB>::iterator it( eTransponderList::getInstance()->getLNBs().begin());
457 tpData == 0 && it != eTransponderList::getInstance()->getLNBs().end(); it++)
458 for (ePtrList<eSatellite>::iterator s ( it->getSatelliteList().begin());
459 s != it->getSatelliteList().end(); s++)
460 if (s->getOrbitalPosition() == tp->satellite.orbital_position)
462 result.strReplace("#SATELLITE#", XMLify(s->getDescription(), "XML"));
463 tpData = 1;
464 break;
466 if (tpData == 1)
468 result.strReplace("#FREQUENCY#", eString().sprintf("%d", tp->satellite.frequency / 1000));
469 result.strReplace("#SYMBOLRATE#", eString().sprintf("%d", tp->satellite.symbol_rate / 1000));
470 result.strReplace("#POLARISATION#", tp->satellite.polarisation ? "Vertical" : "Horizontal");
472 switch(tp->satellite.inversion)
474 case 0: result.strReplace("#INVERSION#", "No"); break;
475 case 1: result.strReplace("#INVERSION#", "Yes"); break;
476 default: result.strReplace("#INVERSION#", "Auto"); break;
479 switch (tp->satellite.fec)
481 case 0: result.strReplace("#FEC#", "Auto"); break;
482 case 1: result.strReplace("#FEC#", "1/2"); break;
483 case 2: result.strReplace("#FEC#", "2/3"); break;
484 case 3: result.strReplace("#FEC#", "3/4"); break;
485 case 4: result.strReplace("#FEC#", "5/6"); break;
486 case 5: result.strReplace("#FEC#", "7/8"); break;
487 case 6: result.strReplace("#FEC#", "8/9"); break;
490 eFrontend *fe = eFrontend::getInstance();
491 int status = fe->Status();
492 bool lock = status & FE_HAS_LOCK;
493 bool sync = status & FE_HAS_SYNC;
494 result.strReplace("#SNR#", eString().sprintf("%d%%", fe->SNR() * 100/65535));
495 result.strReplace("#AGC#", eString().sprintf("%d%%", fe->SignalStrength() * 100/65535));
496 result.strReplace("#BER#", eString().sprintf("%u", fe->BER()));
497 result.strReplace("#LOCK#", (lock ? "Yes" : "No"));
498 result.strReplace("#SYNC#", (sync ? "Yes" : "No"));
500 break;
502 case eSystemInfo::feCable:
504 result.strReplace("#FRONTEND#", "DVB-C");
505 result.strReplace("#FREQUENCY#", eString().sprintf("%d", tp->cable.frequency / 1000));
506 result.strReplace("#SYMBOLRATE#", eString().sprintf("%d", tp->cable.symbol_rate / 1000));
508 switch(tp->cable.inversion)
510 case 0: result.strReplace("#INVERSION#", "No"); break;
511 case 1: result.strReplace("#INVERSION#", "Yes"); break;
512 default: result.strReplace("#INVERSION#", "Auto"); break;
515 switch (tp->cable.modulation)
517 case 0: result.strReplace("#MODULATION#", "Auto"); break;
518 case 1: result.strReplace("#MODULATION#", "16-QAM"); break;
519 case 2: result.strReplace("#MODULATION#", "32-QAM"); break;
520 case 3: result.strReplace("#MODULATION#", "64-QAM"); break;
521 case 4: result.strReplace("#MODULATION#", "128-QAM"); break;
522 case 5: result.strReplace("#MODULATION#", "256-QAM"); break;
525 switch (tp->cable.fec_inner)
527 case 0: result.strReplace("#FEC#", "Auto"); break;
528 case 1: result.strReplace("#FEC#", "1/2"); break;
529 case 2: result.strReplace("#FEC#", "2/3"); break;
530 case 3: result.strReplace("#FEC#", "3/4"); break;
531 case 4: result.strReplace("#FEC#", "5/6"); break;
532 case 5: result.strReplace("#FEC#", "7/8"); break;
533 case 6: result.strReplace("#FEC#", "8/9"); break;
535 break;
537 case eSystemInfo::feTerrestrial:
539 result.strReplace("#FRONTEND#", "DVB-T");
540 result.strReplace("#FREQUENCY#", eString().sprintf("%d", tp->terrestrial.centre_frequency / 1000));
542 switch(tp->terrestrial.inversion)
544 case 0: result.strReplace("#INVERSION#", "No"); break;
545 case 1: result.strReplace("#INVERSION#", "Yes"); break;
546 default: result.strReplace("#INVERSION#", "Auto"); break;
549 switch (tp->terrestrial.hierarchy_information)
551 case 0: result.strReplace("#HIERARCHYINFO#", "None"); break;
552 case 1: result.strReplace("#HIERARCHYINFO#", "1"); break;
553 case 2: result.strReplace("#HIERARCHYINFO#", "2"); break;
554 case 3: result.strReplace("#HIERARCHYINFO#", "4"); break;
555 default: result.strReplace("#HIERARCHYINFO#", "Auto"); break;
558 switch (tp->terrestrial.bandwidth)
560 case 0: result.strReplace("#BANDWIDTH#", "8 Mhz"); break;
561 case 1: result.strReplace("#BANDWIDTH#", "7 Mhz"); break;
562 case 2: result.strReplace("#BANDWIDTH#", "6 Mhz"); break;
563 default:result.strReplace("#BANDWIDTH#", "Auto"); break;
566 switch (tp->terrestrial.constellation)
568 case 0: result.strReplace("#CONSTELLATION#", "QPSK"); break;
569 case 1: result.strReplace("#CONSTELLATION#", "16-QAM"); break;
570 case 2: result.strReplace("#CONSTELLATION#", "64-QAM"); break;
571 default: result.strReplace("#CONSTELLATION#", "Auto"); break;
574 switch (tp->terrestrial.guard_interval)
576 case 0: result.strReplace("#GUARDINTERVAL#", "1/32"); break;
577 case 1: result.strReplace("#GUARDINTERVAL#", "1/16"); break;
578 case 2: result.strReplace("#GUARDINTERVAL#", "1/8"); break;
579 case 3: result.strReplace("#GUARDINTERVAL#", "1/4"); break;
580 default: result.strReplace("#GUARDINTERVAL#", "Auto"); break;
583 switch (tp->terrestrial.transmission_mode)
585 case 0: result.strReplace("#TRANSMISSION#", "2k"); break;
586 case 1: result.strReplace("#TRANSMISSION#", "8k"); break;
587 default: result.strReplace("#TRANSMISSION#", "Auto"); break;
590 switch (tp->terrestrial.code_rate_lp)
592 case 0: result.strReplace("#CODERATELP#", "1/2"); break;
593 case 1: result.strReplace("#CODERATELP#", "2/3"); break;
594 case 2: result.strReplace("#CODERATELP#", "3/4"); break;
595 case 3: result.strReplace("#CODERATELP#", "5/6"); break;
596 case 4: result.strReplace("#CODERATELP#", "7/8"); break;
597 default: result.strReplace("#CODERATELP#", "Auto"); break;
600 switch (tp->terrestrial.code_rate_hp)
602 case 0: result.strReplace("#CODERATEHP#", "1/2"); break;
603 case 1: result.strReplace("#CODERATEHP#", "2/3"); break;
604 case 2: result.strReplace("#CODERATEHP#", "3/4"); break;
605 case 3: result.strReplace("#CODERATEHP#", "5/6"); break;
606 case 4: result.strReplace("#CODERATEHP#", "7/8"); break;
607 default: result.strReplace("#CODERATEHP#", "Auto"); break;
610 break;
612 default:
613 result.strReplace("#FRONTEND#", "Unknown");
614 break;
618 if (tpData == 0)
620 result.strReplace("#SATELLITE#", "n/a");
621 result.strReplace("#FREQUENCY#", "n/a");
622 result.strReplace("#SYMBOLRATE#", "n/a");
623 result.strReplace("#POLARISATION#", "n/a");
624 result.strReplace("#INVERSION#", "n/a");
625 result.strReplace("#FEC#", "n/a");
626 result.strReplace("#SNR#", "n/a");
627 result.strReplace("#AGC#", "n/a");
628 result.strReplace("#BER#", "n/a");
629 result.strReplace("#LOCK#", "n/a");
630 result.strReplace("#SYNC#", "n/a");
633 return result;
636 static eString getXMLTimers(eString request, eString dirpath, eString opt, eHTTPConnection *content)
638 eString result = readFile(TEMPLATE_DIR + "XMLTimerList.tmp");
639 result.strReplace("#BODY#", getTimerList("XML"));
640 return result;
643 void ezapXMLInitializeDyn(eHTTPDynPathResolver *dyn_resolver, bool lockWeb)
646 dyn_resolver->addDyn("GET", "/xml/boxinfo", getXMLBoxInfo, lockWeb);
647 dyn_resolver->addDyn("GET", "/xml/boxstatus", getXMLBoxStatus, lockWeb);
648 dyn_resolver->addDyn("GET", "/xml/currentservicedata", getXMLCurrentServiceData, lockWeb);
649 dyn_resolver->addDyn("GET", "/xml/serviceepg", getXMLServiceEPG, lockWeb);
650 dyn_resolver->addDyn("GET", "/xml/serviceepg.xsl", getXSLServiceEPG, lockWeb);
651 dyn_resolver->addDyn("GET", "/xml/services", getXMLServices, lockWeb);
652 dyn_resolver->addDyn("GET", "/xml/streaminfo", getXMLStreamInfo, lockWeb);
653 dyn_resolver->addDyn("GET", "/xml/streaminfo.xsl", getXSLStreamInfo, lockWeb);
654 dyn_resolver->addDyn("GET", "/xml/timers", getXMLTimers, lockWeb);