X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4cdeb9ebe328382bb4ef6a01b67ff840adcc84ad..7606810b356e9b3fbe1fbf7c7ca6da2e15e32a0e:/lib/service/service.cpp diff --git a/lib/service/service.cpp b/lib/service/service.cpp index a490c3d7..a044c66a 100644 --- a/lib/service/service.cpp +++ b/lib/service/service.cpp @@ -1,19 +1,69 @@ #include #include +#include #include #include #include +#include + +static std::string encode(const std::string s) +{ + int len = s.size(); + std::string res; + int i; + for (i=0; i= len) + break; + char s[3] = {s[i - 1], s[i], 0}; + unsigned char r = strtoul(s, 0, 0x10); + if (r) + res += r; + } + } + return res; +} + eServiceReference::eServiceReference(const std::string &string) { const char *c=string.c_str(); int pathl=0; - if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &data[4], &data[5], &data[6], &data[7], &pathl) < 8 ) + if (!string.length()) + type = idInvalid; + else if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &data[4], &data[5], &data[6], &data[7], &pathl) < 8 ) { memset( data, 0, sizeof(data) ); eDebug("find old format eServiceReference string"); - sscanf(c, "%d:%d:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &pathl); + if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &pathl) < 2 ) + type = idInvalid; } if (pathl) @@ -30,6 +80,9 @@ eServiceReference::eServiceReference(const std::string &string) else path=pathstr; } + + path = decode(path); + name = decode(name); } std::string eServiceReference::toString() const @@ -40,12 +93,22 @@ std::string eServiceReference::toString() const ret += getNum(flags); for (unsigned int i=0; i &evt, int m_nownext) @@ -177,6 +240,11 @@ std::string iStaticServiceInformation::getInfoString(const eServiceReference &re return ""; } +PyObject *iStaticServiceInformation::getInfoObject(const eServiceReference &ref, int w) +{ + Py_RETURN_NONE; +} + int iServiceInformation::getInfo(int w) { return -1; @@ -187,4 +255,29 @@ std::string iServiceInformation::getInfoString(int w) return ""; } +PyObject* iServiceInformation::getInfoObject(int w) +{ + Py_RETURN_NONE; +} + +int iStaticServiceInformation::setInfo(const eServiceReference &ref, int w, int v) +{ + return -1; +} + +int iStaticServiceInformation::setInfoString(const eServiceReference &ref, int w, const char *v) +{ + return -1; +} + +int iServiceInformation::setInfo(int w, int v) +{ + return -1; +} + +int iServiceInformation::setInfoString(int w, const char *v) +{ + return -1; +} + eAutoInitPtr init_eServiceCenter(eAutoInitNumbers::service, "eServiceCenter");