mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Tweaked internals and log messages to match SVDRP interface.
This commit is contained in:
parent
7110cee7a9
commit
45d0227d2b
12
discover.c
12
discover.c
@ -38,7 +38,7 @@ bool cSatipDiscover::Initialize(cSatipDiscoverServers *serversP)
|
||||
if (instanceS) {
|
||||
if (serversP) {
|
||||
for (cSatipDiscoverServer *s = serversP->First(); s; s = serversP->Next(s))
|
||||
instanceS->AddServer(s->IpAddress(), s->Description(), s->Model());
|
||||
instanceS->AddServer(s->IpAddress(), s->Model(), s->Description());
|
||||
}
|
||||
else
|
||||
instanceS->Activate();
|
||||
@ -88,7 +88,7 @@ size_t cSatipDiscover::WriteCallback(char *ptrP, size_t sizeP, size_t nmembP, vo
|
||||
}
|
||||
#endif
|
||||
SATIP_CURL_EASY_GETINFO(obj->handleM, CURLINFO_PRIMARY_IP, &addr);
|
||||
obj->AddServer(addr, desc, model);
|
||||
obj->AddServer(addr, model, desc);
|
||||
}
|
||||
|
||||
return len;
|
||||
@ -282,15 +282,15 @@ void cSatipDiscover::Read(void)
|
||||
}
|
||||
}
|
||||
|
||||
void cSatipDiscover::AddServer(const char *addrP, const char *descP, const char * modelP)
|
||||
void cSatipDiscover::AddServer(const char *addrP, const char *modelP, const char * descP)
|
||||
{
|
||||
debug("cSatipDiscover::%s(%s, %s, %s)", __FUNCTION__, addrP, descP, modelP);
|
||||
debug("cSatipDiscover::%s(%s, %s, %s)", __FUNCTION__, addrP, modelP, descP);
|
||||
cMutexLock MutexLock(&mutexM);
|
||||
if (serversM) {
|
||||
cSatipServer *tmp = new cSatipServer(addrP, descP, modelP);
|
||||
cSatipServer *tmp = new cSatipServer(addrP, modelP, descP);
|
||||
// Validate against existing servers
|
||||
if (!serversM->Update(tmp)) {
|
||||
info("Adding device %s (%s %s)", tmp->Description(), tmp->Address(), tmp->Model());
|
||||
info("Adding device '%s|%s|%s'", tmp->Address(), tmp->Model(), tmp->Description());
|
||||
serversM->Add(tmp);
|
||||
}
|
||||
else
|
||||
|
@ -22,13 +22,13 @@ private:
|
||||
cString descriptionM;
|
||||
cString modelM;
|
||||
public:
|
||||
cSatipDiscoverServer(const char *ipAddressP, const char *descriptionP, const char *modelP)
|
||||
cSatipDiscoverServer(const char *ipAddressP, const char *modelP, const char *descriptionP)
|
||||
{
|
||||
ipAddressM = ipAddressP; descriptionM = descriptionP; modelM = modelP;
|
||||
ipAddressM = ipAddressP; modelM = modelP; descriptionM = descriptionP;
|
||||
}
|
||||
const char *IpAddress(void) { return *ipAddressM; }
|
||||
const char *Description(void) { return *descriptionM; }
|
||||
const char *Model(void) { return *modelM; }
|
||||
const char *Description(void) { return *descriptionM; }
|
||||
};
|
||||
|
||||
class cSatipDiscoverServers : public cList<cSatipDiscoverServer> {
|
||||
@ -59,7 +59,7 @@ private:
|
||||
void Janitor(void);
|
||||
void Probe(void);
|
||||
void Read(void);
|
||||
void AddServer(const char *addrP, const char *descP, const char *modelP);
|
||||
void AddServer(const char *addrP, const char *modelP, const char *descP);
|
||||
// constructor
|
||||
cSatipDiscover();
|
||||
// to prevent copy constructor and assignment
|
||||
|
2
satip.c
2
satip.c
@ -219,7 +219,7 @@ void cPluginSatip::ParseServer(const char *paramP)
|
||||
debug("cPluginSatip::%s(): ipaddr=%s model=%s desc=%s", __FUNCTION__, *serverAddr, *serverModel, *serverDescription);
|
||||
if (!serversM)
|
||||
serversM = new cSatipDiscoverServers();
|
||||
serversM->Add(new cSatipDiscoverServer(*serverAddr, *serverDescription, *serverModel));
|
||||
serversM->Add(new cSatipDiscoverServer(*serverAddr, *serverModel, *serverDescription));
|
||||
}
|
||||
++n;
|
||||
r = strtok_r(NULL, ";", &s);
|
||||
|
4
server.c
4
server.c
@ -12,10 +12,10 @@
|
||||
|
||||
// --- cSatipServer -----------------------------------------------------------
|
||||
|
||||
cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const char *modelP)
|
||||
cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char *descriptionP)
|
||||
: addressM(addressP),
|
||||
descriptionM(descriptionP),
|
||||
modelM(modelP),
|
||||
descriptionM(descriptionP),
|
||||
modelTypeM(eSatipModelTypeNone),
|
||||
quirkM(eSatipQuirkNone),
|
||||
useCountM(0),
|
||||
|
8
server.h
8
server.h
@ -20,8 +20,8 @@ private:
|
||||
eSatipModuleCount
|
||||
};
|
||||
cString addressM;
|
||||
cString descriptionM;
|
||||
cString modelM;
|
||||
cString descriptionM;
|
||||
int modelCountM[eSatipModuleCount];
|
||||
int modelTypeM;
|
||||
int quirkM;
|
||||
@ -46,16 +46,16 @@ public:
|
||||
eSatipModelTypeDVBC = 0x08,
|
||||
eSatipModelTypeMask = 0x0F
|
||||
};
|
||||
cSatipServer(const char *addressP, const char *descriptionP, const char *modelP);
|
||||
cSatipServer(const char *addressP, const char *modelP, const char *descriptionP);
|
||||
virtual ~cSatipServer();
|
||||
virtual int Compare(const cListObject &listObjectP) const;
|
||||
void Use(bool onOffP);
|
||||
void SetTransponder(const int transponderP) { transponderM = transponderP; }
|
||||
int Transponder(void) { return transponderM; }
|
||||
bool Used(void) { return !!useCountM; }
|
||||
const char *Description() { return *descriptionM; }
|
||||
const char *Address() { return *addressM; }
|
||||
const char *Model(void) { return modelM; }
|
||||
const char *Model(void) { return *modelM; }
|
||||
const char *Description() { return *descriptionM; }
|
||||
bool Quirk(int quirkP) { return ((quirkP & eSatipQuirkMask) & quirkM); }
|
||||
int ModelType(void) { return modelTypeM; }
|
||||
bool Match(int modelP) { return ((modelP & eSatipModelTypeMask) & modelTypeM); }
|
||||
|
Loading…
Reference in New Issue
Block a user