mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Refactored the frontend attaching/detaching signaling.
This commit is contained in:
parent
653d9d659b
commit
84dfc6701e
2
device.c
2
device.c
@ -328,7 +328,7 @@ bool cSatipDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
cString address;
|
cString address;
|
||||||
cSatipServer *server = cSatipDiscover::GetInstance()->AssignServer(channelP->Source(), channelP->Transponder(), dtp.System());
|
cSatipServer *server = cSatipDiscover::GetInstance()->AssignServer(deviceIndexM, channelP->Source(), channelP->Transponder(), dtp.System());
|
||||||
if (!server) {
|
if (!server) {
|
||||||
debug9("%s No suitable server found [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
|
debug9("%s No suitable server found [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
|
||||||
return false;
|
return false;
|
||||||
|
19
discover.c
19
discover.c
@ -269,11 +269,11 @@ int cSatipDiscover::GetServerCount(void)
|
|||||||
return serversM.Count();
|
return serversM.Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
cSatipServer *cSatipDiscover::AssignServer(int sourceP, int transponderP, int systemP)
|
cSatipServer *cSatipDiscover::AssignServer(int deviceIdP, int sourceP, int transponderP, int systemP)
|
||||||
{
|
{
|
||||||
debug16("%s (%d, %d, %d)", __PRETTY_FUNCTION__, sourceP, transponderP, systemP);
|
debug16("%s (%d, %d, %d, %d)", __PRETTY_FUNCTION__, deviceIdP, sourceP, transponderP, systemP);
|
||||||
cMutexLock MutexLock(&mutexM);
|
cMutexLock MutexLock(&mutexM);
|
||||||
return serversM.Assign(sourceP, transponderP, systemP);
|
return serversM.Assign(deviceIdP, sourceP, transponderP, systemP);
|
||||||
}
|
}
|
||||||
|
|
||||||
cSatipServer *cSatipDiscover::GetServer(int sourceP)
|
cSatipServer *cSatipDiscover::GetServer(int sourceP)
|
||||||
@ -311,11 +311,18 @@ cString cSatipDiscover::GetServerList(void)
|
|||||||
return serversM.List();
|
return serversM.List();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSatipDiscover::UseServer(cSatipServer *serverP, int transponderP, bool onOffP)
|
void cSatipDiscover::AttachServer(cSatipServer *serverP, int deviceIdP, int transponderP)
|
||||||
{
|
{
|
||||||
debug16("%s (, %d, %d)", __PRETTY_FUNCTION__, transponderP, onOffP);
|
debug16("%s (, %d, %d)", __PRETTY_FUNCTION__, deviceIdP, transponderP);
|
||||||
cMutexLock MutexLock(&mutexM);
|
cMutexLock MutexLock(&mutexM);
|
||||||
serversM.Use(serverP, transponderP, onOffP);
|
serversM.Attach(serverP, deviceIdP, transponderP);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cSatipDiscover::DetachServer(cSatipServer *serverP, int deviceIdP, int transponderP)
|
||||||
|
{
|
||||||
|
debug16("%s (, %d, %d)", __PRETTY_FUNCTION__, deviceIdP, transponderP);
|
||||||
|
cMutexLock MutexLock(&mutexM);
|
||||||
|
serversM.Detach(serverP, deviceIdP, transponderP);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipDiscover::IsServerQuirk(cSatipServer *serverP, int quirkP)
|
bool cSatipDiscover::IsServerQuirk(cSatipServer *serverP, int quirkP)
|
||||||
|
@ -74,12 +74,13 @@ public:
|
|||||||
virtual ~cSatipDiscover();
|
virtual ~cSatipDiscover();
|
||||||
void TriggerScan(void) { probeIntervalM.Set(0); }
|
void TriggerScan(void) { probeIntervalM.Set(0); }
|
||||||
int GetServerCount(void);
|
int GetServerCount(void);
|
||||||
cSatipServer *AssignServer(int sourceP, int transponderP, int systemP);
|
cSatipServer *AssignServer(int deviceIdP, int sourceP, int transponderP, int systemP);
|
||||||
cSatipServer *GetServer(int sourceP);
|
cSatipServer *GetServer(int sourceP);
|
||||||
cSatipServer *GetServer(cSatipServer *serverP);
|
cSatipServer *GetServer(cSatipServer *serverP);
|
||||||
cSatipServers *GetServers(void);
|
cSatipServers *GetServers(void);
|
||||||
cString GetServerString(cSatipServer *serverP);
|
cString GetServerString(cSatipServer *serverP);
|
||||||
void UseServer(cSatipServer *serverP, int transponderP, bool onOffP);
|
void AttachServer(cSatipServer *serverP, int deviceIdP, int transponderP);
|
||||||
|
void DetachServer(cSatipServer *serverP, int deviceIdP, int transponderP);
|
||||||
bool IsServerQuirk(cSatipServer *serverP, int quirkP);
|
bool IsServerQuirk(cSatipServer *serverP, int quirkP);
|
||||||
bool HasServerCI(cSatipServer *serverP);
|
bool HasServerCI(cSatipServer *serverP);
|
||||||
cString GetServerAddress(cSatipServer *serverP);
|
cString GetServerAddress(cSatipServer *serverP);
|
||||||
|
86
server.c
86
server.c
@ -17,8 +17,8 @@
|
|||||||
cSatipFrontend::cSatipFrontend(const int indexP, const char *descriptionP)
|
cSatipFrontend::cSatipFrontend(const int indexP, const char *descriptionP)
|
||||||
: indexM(indexP),
|
: indexM(indexP),
|
||||||
transponderM(0),
|
transponderM(0),
|
||||||
descriptionM(descriptionP),
|
deviceIdM(-1),
|
||||||
usedM(false)
|
descriptionM(descriptionP)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,21 +28,21 @@ cSatipFrontend::~cSatipFrontend()
|
|||||||
|
|
||||||
// --- cSatipFrontends --------------------------------------------------------
|
// --- cSatipFrontends --------------------------------------------------------
|
||||||
|
|
||||||
bool cSatipFrontends::Matches(int transponderP)
|
bool cSatipFrontends::Matches(int deviceIdP, int transponderP)
|
||||||
{
|
{
|
||||||
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
||||||
if (f->IsUsed() && (f->Transponder() == transponderP))
|
if (f->Attached() && (f->Transponder() == transponderP))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipFrontends::Assign(int transponderP)
|
bool cSatipFrontends::Assign(int deviceIdP, int transponderP)
|
||||||
{
|
{
|
||||||
cSatipFrontend *tmp = First();
|
cSatipFrontend *tmp = First();
|
||||||
// Prefer any unused one
|
// Prefer any unused one
|
||||||
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
||||||
if (!f->IsUsed()) {
|
if (!f->Attached()) {
|
||||||
tmp = f;
|
tmp = f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -54,12 +54,24 @@ bool cSatipFrontends::Assign(int transponderP)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipFrontends::Use(int transponderP, bool onOffP)
|
bool cSatipFrontends::Attach(int deviceIdP, int transponderP)
|
||||||
{
|
{
|
||||||
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
||||||
if (f->Transponder() == transponderP) {
|
if (f->Transponder() == transponderP) {
|
||||||
f->Use(onOffP);
|
f->Attach(deviceIdP);
|
||||||
debug9("%s (%d, %d) %s/#%d", __PRETTY_FUNCTION__, transponderP, onOffP, *f->Description(), f->Index());
|
debug9("%s (%d, %d) %s/#%d", __PRETTY_FUNCTION__, deviceIdP, transponderP, *f->Description(), f->Index());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cSatipFrontends::Detach(int deviceIdP, int transponderP)
|
||||||
|
{
|
||||||
|
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
||||||
|
if (f->Transponder() == transponderP) {
|
||||||
|
f->Detach(deviceIdP);
|
||||||
|
debug9("%s (%d, %d) %s/#%d", __PRETTY_FUNCTION__, deviceIdP, transponderP, *f->Description(), f->Index());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,22 +168,22 @@ int cSatipServer::Compare(const cListObject &listObjectP) const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipServer::Assign(int sourceP, int systemP, int transponderP)
|
bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transponderP)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (cSource::IsType(sourceP, 'S'))
|
if (cSource::IsType(sourceP, 'S'))
|
||||||
result = frontendsM[eSatipFrontendDVBS2].Assign(transponderP);
|
result = frontendsM[eSatipFrontendDVBS2].Assign(deviceIdP, transponderP);
|
||||||
else if (cSource::IsType(sourceP, 'T')) {
|
else if (cSource::IsType(sourceP, 'T')) {
|
||||||
if (systemP)
|
if (systemP)
|
||||||
result = frontendsM[eSatipFrontendDVBT2].Assign(transponderP);
|
result = frontendsM[eSatipFrontendDVBT2].Assign(deviceIdP, transponderP);
|
||||||
else
|
else
|
||||||
result = frontendsM[eSatipFrontendDVBT].Assign(transponderP) || frontendsM[eSatipFrontendDVBT2].Assign(transponderP);
|
result = frontendsM[eSatipFrontendDVBT].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBT2].Assign(deviceIdP, transponderP);
|
||||||
}
|
}
|
||||||
else if (cSource::IsType(sourceP, 'C')) {
|
else if (cSource::IsType(sourceP, 'C')) {
|
||||||
if (systemP)
|
if (systemP)
|
||||||
result = frontendsM[eSatipFrontendDVBC2].Assign(transponderP);
|
result = frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
||||||
else
|
else
|
||||||
result = frontendsM[eSatipFrontendDVBC].Assign(transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(transponderP);
|
result = frontendsM[eSatipFrontendDVBC].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -187,30 +199,38 @@ bool cSatipServer::Matches(int sourceP)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipServer::Matches(int sourceP, int systemP, int transponderP)
|
bool cSatipServer::Matches(int deviceIdP, int sourceP, int systemP, int transponderP)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (cSource::IsType(sourceP, 'S'))
|
if (cSource::IsType(sourceP, 'S'))
|
||||||
result = frontendsM[eSatipFrontendDVBS2].Matches(transponderP);
|
result = frontendsM[eSatipFrontendDVBS2].Matches(deviceIdP, transponderP);
|
||||||
else if (cSource::IsType(sourceP, 'T')) {
|
else if (cSource::IsType(sourceP, 'T')) {
|
||||||
if (systemP)
|
if (systemP)
|
||||||
result = frontendsM[eSatipFrontendDVBT2].Matches(transponderP);
|
result = frontendsM[eSatipFrontendDVBT2].Matches(deviceIdP, transponderP);
|
||||||
else
|
else
|
||||||
result = frontendsM[eSatipFrontendDVBT].Matches(transponderP) || frontendsM[eSatipFrontendDVBT2].Matches(transponderP);
|
result = frontendsM[eSatipFrontendDVBT].Matches(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBT2].Matches(deviceIdP, transponderP);
|
||||||
}
|
}
|
||||||
else if (cSource::IsType(sourceP, 'C')) {
|
else if (cSource::IsType(sourceP, 'C')) {
|
||||||
if (systemP)
|
if (systemP)
|
||||||
result = frontendsM[eSatipFrontendDVBC2].Matches(transponderP);
|
result = frontendsM[eSatipFrontendDVBC2].Matches(deviceIdP, transponderP);
|
||||||
else
|
else
|
||||||
result = frontendsM[eSatipFrontendDVBC].Matches(transponderP) || frontendsM[eSatipFrontendDVBC2].Matches(transponderP);
|
result = frontendsM[eSatipFrontendDVBC].Matches(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Matches(deviceIdP, transponderP);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSatipServer::Use(int transponderP, bool onOffP)
|
void cSatipServer::Attach(int deviceIdP, int transponderP)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < eSatipFrontendCount; ++i) {
|
for (int i = 0; i < eSatipFrontendCount; ++i) {
|
||||||
if (frontendsM[i].Use(transponderP, onOffP))
|
if (frontendsM[i].Attach(deviceIdP, transponderP))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cSatipServer::Detach(int deviceIdP, int transponderP)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < eSatipFrontendCount; ++i) {
|
||||||
|
if (frontendsM[i].Detach(deviceIdP, transponderP))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,14 +280,14 @@ cSatipServer *cSatipServers::Find(int sourceP)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cSatipServer *cSatipServers::Assign(int sourceP, int transponderP, int systemP)
|
cSatipServer *cSatipServers::Assign(int deviceIdP, int sourceP, int transponderP, int systemP)
|
||||||
{
|
{
|
||||||
for (cSatipServer *s = First(); s; s = Next(s)) {
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
if (s->Matches(sourceP, systemP, transponderP))
|
if (s->Matches(deviceIdP, sourceP, systemP, transponderP))
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
for (cSatipServer *s = First(); s; s = Next(s)) {
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
if (s->Assign(sourceP, systemP, transponderP))
|
if (s->Assign(deviceIdP, sourceP, systemP, transponderP))
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -284,11 +304,21 @@ cSatipServer *cSatipServers::Update(cSatipServer *serverP)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSatipServers::Use(cSatipServer *serverP, int transponderP, bool onOffP)
|
void cSatipServers::Attach(cSatipServer *serverP, int deviceIdP, int transponderP)
|
||||||
{
|
{
|
||||||
for (cSatipServer *s = First(); s; s = Next(s)) {
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
if (s == serverP) {
|
if (s == serverP) {
|
||||||
s->Use(transponderP, onOffP);
|
s->Attach(deviceIdP, transponderP);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cSatipServers::Detach(cSatipServer *serverP, int deviceIdP, int transponderP)
|
||||||
|
{
|
||||||
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||||
|
if (s == serverP) {
|
||||||
|
s->Detach(deviceIdP, transponderP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
server.h
26
server.h
@ -16,15 +16,16 @@ class cSatipFrontend : public cListObject {
|
|||||||
private:
|
private:
|
||||||
int indexM;
|
int indexM;
|
||||||
int transponderM;
|
int transponderM;
|
||||||
|
int deviceIdM;
|
||||||
cString descriptionM;
|
cString descriptionM;
|
||||||
bool usedM;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cSatipFrontend(const int indexP, const char *descriptionP);
|
cSatipFrontend(const int indexP, const char *descriptionP);
|
||||||
virtual ~cSatipFrontend();
|
virtual ~cSatipFrontend();
|
||||||
void Use(bool onOffP) { usedM = onOffP; }
|
void Attach(int deviceIdP) { deviceIdM = deviceIdP; }
|
||||||
|
void Detach(int deviceIdP) { if (deviceIdP == deviceIdM) deviceIdM = -1; }
|
||||||
cString Description(void) { return descriptionM; }
|
cString Description(void) { return descriptionM; }
|
||||||
bool IsUsed(void) { return usedM; }
|
bool Attached(void) { return (deviceIdM >= 0); }
|
||||||
int Index(void) { return indexM; }
|
int Index(void) { return indexM; }
|
||||||
int Transponder(void) { return transponderM; }
|
int Transponder(void) { return transponderM; }
|
||||||
void SetTransponder(int transponderP) { transponderM = transponderP; }
|
void SetTransponder(int transponderP) { transponderM = transponderP; }
|
||||||
@ -34,9 +35,10 @@ public:
|
|||||||
|
|
||||||
class cSatipFrontends : public cList<cSatipFrontend> {
|
class cSatipFrontends : public cList<cSatipFrontend> {
|
||||||
public:
|
public:
|
||||||
bool Matches(int transponderP);
|
bool Matches(int deviceIdP, int transponderP);
|
||||||
bool Assign(int transponderP);
|
bool Assign(int deviceIdP, int transponderP);
|
||||||
bool Use(int transponderP, bool onOffP);
|
bool Attach(int deviceIdP, int transponderP);
|
||||||
|
bool Detach(int deviceIdP, int transponderP);
|
||||||
};
|
};
|
||||||
|
|
||||||
// --- cSatipServer -----------------------------------------------------------
|
// --- cSatipServer -----------------------------------------------------------
|
||||||
@ -72,10 +74,11 @@ public:
|
|||||||
cSatipServer(const char *addressP, const char *modelP, const char *descriptionP);
|
cSatipServer(const char *addressP, const char *modelP, const char *descriptionP);
|
||||||
virtual ~cSatipServer();
|
virtual ~cSatipServer();
|
||||||
virtual int Compare(const cListObject &listObjectP) const;
|
virtual int Compare(const cListObject &listObjectP) const;
|
||||||
bool Assign(int sourceP, int systemP, int transponderP);
|
bool Assign(int deviceIdP, int sourceP, int systemP, int transponderP);
|
||||||
bool Matches(int sourceP);
|
bool Matches(int sourceP);
|
||||||
bool Matches(int sourceP, int systemP, int transponderP);
|
bool Matches(int deviceIdP, int sourceP, int systemP, int transponderP);
|
||||||
void Use(int transponderP, bool onOffP);
|
void Attach(int deviceIdP, int transponderP);
|
||||||
|
void Detach(int deviceIdP, int transponderP);
|
||||||
int GetModulesDVBS2(void);
|
int GetModulesDVBS2(void);
|
||||||
int GetModulesDVBT(void);
|
int GetModulesDVBT(void);
|
||||||
int GetModulesDVBT2(void);
|
int GetModulesDVBT2(void);
|
||||||
@ -99,9 +102,10 @@ class cSatipServers : public cList<cSatipServer> {
|
|||||||
public:
|
public:
|
||||||
cSatipServer *Find(cSatipServer *serverP);
|
cSatipServer *Find(cSatipServer *serverP);
|
||||||
cSatipServer *Find(int sourceP);
|
cSatipServer *Find(int sourceP);
|
||||||
cSatipServer *Assign(int sourceP, int transponderP, int systemP);
|
cSatipServer *Assign(int deviceIdP, int sourceP, int transponderP, int systemP);
|
||||||
cSatipServer *Update(cSatipServer *serverP);
|
cSatipServer *Update(cSatipServer *serverP);
|
||||||
void Use(cSatipServer *serverP, int transponderP, bool onOffP);
|
void Attach(cSatipServer *serverP, int deviceIdP, int transponderP);
|
||||||
|
void Detach(cSatipServer *serverP, int deviceIdP, int transponderP);
|
||||||
bool IsQuirk(cSatipServer *serverP, int quirkP);
|
bool IsQuirk(cSatipServer *serverP, int quirkP);
|
||||||
bool HasCI(cSatipServer *serverP);
|
bool HasCI(cSatipServer *serverP);
|
||||||
void Cleanup(uint64_t intervalMsP = 0);
|
void Cleanup(uint64_t intervalMsP = 0);
|
||||||
|
8
tuner.c
8
tuner.c
@ -25,8 +25,8 @@ cSatipTuner::cSatipTuner(cSatipDeviceIf &deviceP, unsigned int packetLenP)
|
|||||||
rtcpM(*this),
|
rtcpM(*this),
|
||||||
streamAddrM(""),
|
streamAddrM(""),
|
||||||
streamParamM(""),
|
streamParamM(""),
|
||||||
currentServerM(NULL, 0),
|
currentServerM(NULL, deviceP.GetId(), 0),
|
||||||
nextServerM(NULL, 0),
|
nextServerM(NULL, deviceP.GetId(), 0),
|
||||||
mutexM(),
|
mutexM(),
|
||||||
reConnectM(),
|
reConnectM(),
|
||||||
keepAliveM(),
|
keepAliveM(),
|
||||||
@ -205,7 +205,7 @@ bool cSatipTuner::Connect(void)
|
|||||||
currentServerM = nextServerM;
|
currentServerM = nextServerM;
|
||||||
nextServerM.Reset();
|
nextServerM.Reset();
|
||||||
}
|
}
|
||||||
currentServerM.Use(true);
|
currentServerM.Attach();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ bool cSatipTuner::Disconnect(void)
|
|||||||
signalQualityM = -1;
|
signalQualityM = -1;
|
||||||
frontendIdM = -1;
|
frontendIdM = -1;
|
||||||
|
|
||||||
currentServerM.Use(false);
|
currentServerM.Detach();
|
||||||
statusUpdateM.Set(0);
|
statusUpdateM.Set(0);
|
||||||
timeoutM = eMinKeepAliveIntervalMs;
|
timeoutM = eMinKeepAliveIntervalMs;
|
||||||
pmtPidM = -1;
|
pmtPidM = -1;
|
||||||
|
12
tuner.h
12
tuner.h
@ -53,21 +53,23 @@ class cSatipTunerServer
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
cSatipServer *serverM;
|
cSatipServer *serverM;
|
||||||
|
int deviceIdM;
|
||||||
int transponderM;
|
int transponderM;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cSatipTunerServer(cSatipServer *serverP, const int transponderP) : serverM(serverP), transponderM(transponderP) {}
|
cSatipTunerServer(cSatipServer *serverP, const int deviceIdP, const int transponderP) : serverM(serverP), deviceIdM(deviceIdP), transponderM(transponderP) {}
|
||||||
~cSatipTunerServer() {}
|
~cSatipTunerServer() {}
|
||||||
cSatipTunerServer(const cSatipTunerServer &objP) { serverM = NULL; transponderM = 0; }
|
cSatipTunerServer(const cSatipTunerServer &objP) { serverM = NULL; deviceIdM = -1; transponderM = 0; }
|
||||||
cSatipTunerServer& operator= (const cSatipTunerServer &objP) { serverM = objP.serverM; transponderM = objP.transponderM; return *this; }
|
cSatipTunerServer& operator= (const cSatipTunerServer &objP) { serverM = objP.serverM; deviceIdM = objP.deviceIdM; transponderM = objP.transponderM; return *this; }
|
||||||
bool IsValid(void) { return !!serverM; }
|
bool IsValid(void) { return !!serverM; }
|
||||||
bool IsQuirk(int quirkP) { return (serverM && cSatipDiscover::GetInstance()->IsServerQuirk(serverM, quirkP)); }
|
bool IsQuirk(int quirkP) { return (serverM && cSatipDiscover::GetInstance()->IsServerQuirk(serverM, quirkP)); }
|
||||||
bool HasCI(void) { return (serverM && cSatipDiscover::GetInstance()->HasServerCI(serverM)); }
|
bool HasCI(void) { return (serverM && cSatipDiscover::GetInstance()->HasServerCI(serverM)); }
|
||||||
void Use(bool onOffP) { if (serverM) cSatipDiscover::GetInstance()->UseServer(serverM, transponderM, onOffP); }
|
void Attach(void) { if (serverM) cSatipDiscover::GetInstance()->AttachServer(serverM, deviceIdM, transponderM); }
|
||||||
|
void Detach(void) { if (serverM) cSatipDiscover::GetInstance()->DetachServer(serverM, deviceIdM, transponderM); }
|
||||||
void Set(cSatipServer *serverP, const int transponderP) { serverM = serverP; transponderM = transponderP; }
|
void Set(cSatipServer *serverP, const int transponderP) { serverM = serverP; transponderM = transponderP; }
|
||||||
void Reset(void) { serverM = NULL; transponderM = 0; }
|
void Reset(void) { serverM = NULL; transponderM = 0; }
|
||||||
cString GetAddress(void) { return serverM ? cSatipDiscover::GetInstance()->GetServerAddress(serverM) : ""; }
|
cString GetAddress(void) { return serverM ? cSatipDiscover::GetInstance()->GetServerAddress(serverM) : ""; }
|
||||||
cString GetInfo(void) { return cString::sprintf("server=%s transponder=%d", serverM ? "assigned" : "null", transponderM); }
|
cString GetInfo(void) { return cString::sprintf("server=%s deviceid=%d transponder=%d", serverM ? "assigned" : "null", deviceIdM, transponderM); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class cSatipTuner : public cThread, public cSatipTunerStatistics, public cSatipTunerIf
|
class cSatipTuner : public cThread, public cSatipTunerStatistics, public cSatipTunerIf
|
||||||
|
Loading…
Reference in New Issue
Block a user