2014-03-13 17:23:55 +01:00
|
|
|
/*
|
|
|
|
* server.c: SAT>IP plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <vdr/sources.h>
|
|
|
|
|
2014-12-03 18:57:23 +01:00
|
|
|
#include "config.h"
|
2014-03-13 17:23:55 +01:00
|
|
|
#include "common.h"
|
2014-12-05 22:14:40 +01:00
|
|
|
#include "log.h"
|
2014-03-13 17:23:55 +01:00
|
|
|
#include "server.h"
|
|
|
|
|
2015-01-15 22:33:51 +01:00
|
|
|
// --- cSatipFrontend ---------------------------------------------------------
|
|
|
|
|
|
|
|
cSatipFrontend::cSatipFrontend(const int indexP, const char *descriptionP)
|
|
|
|
: indexM(indexP),
|
|
|
|
transponderM(0),
|
2015-02-16 16:21:00 +01:00
|
|
|
deviceIdM(-1),
|
|
|
|
descriptionM(descriptionP)
|
2015-01-15 22:33:51 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
cSatipFrontend::~cSatipFrontend()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// --- cSatipFrontends --------------------------------------------------------
|
|
|
|
|
2015-02-16 16:21:00 +01:00
|
|
|
bool cSatipFrontends::Matches(int deviceIdP, int transponderP)
|
2015-01-15 22:33:51 +01:00
|
|
|
{
|
|
|
|
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
2015-02-16 18:42:18 +01:00
|
|
|
if (f->Attached() && (f->DeviceId() == deviceIdP) && (f->Transponder() == transponderP))
|
2015-01-15 22:33:51 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-16 16:21:00 +01:00
|
|
|
bool cSatipFrontends::Assign(int deviceIdP, int transponderP)
|
2015-01-15 22:33:51 +01:00
|
|
|
{
|
2015-02-16 18:42:18 +01:00
|
|
|
cSatipFrontend *tmp = NULL;
|
2015-01-15 22:33:51 +01:00
|
|
|
// Prefer any unused one
|
|
|
|
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
2015-02-16 18:42:18 +01:00
|
|
|
if (!f->Attached() || (f->DeviceId() == deviceIdP)) {
|
2015-01-15 22:33:51 +01:00
|
|
|
tmp = f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tmp) {
|
|
|
|
tmp->SetTransponder(transponderP);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-16 16:21:00 +01:00
|
|
|
bool cSatipFrontends::Attach(int deviceIdP, int transponderP)
|
2015-01-15 22:33:51 +01:00
|
|
|
{
|
|
|
|
for (cSatipFrontend *f = First(); f; f = Next(f)) {
|
|
|
|
if (f->Transponder() == transponderP) {
|
2015-02-16 16:21:00 +01:00
|
|
|
f->Attach(deviceIdP);
|
|
|
|
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());
|
2015-01-15 22:33:51 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-03-13 17:23:55 +01:00
|
|
|
// --- cSatipServer -----------------------------------------------------------
|
|
|
|
|
2014-11-10 23:05:03 +01:00
|
|
|
cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char *descriptionP)
|
2015-01-16 23:00:59 +01:00
|
|
|
: addressM((addressP && *addressP) ? addressP : "0.0.0.0"),
|
|
|
|
modelM((modelP && *modelP) ? modelP : "DVBS-1"),
|
|
|
|
descriptionM(!isempty(descriptionP) ? descriptionP : "MyBrokenHardware"),
|
2015-01-27 15:27:23 +01:00
|
|
|
quirksM(""),
|
2014-05-08 21:09:35 +02:00
|
|
|
quirkM(eSatipQuirkNone),
|
2015-01-25 23:21:55 +01:00
|
|
|
hasCiM(false),
|
2014-03-13 17:23:55 +01:00
|
|
|
createdM(time(NULL)),
|
|
|
|
lastSeenM(0)
|
|
|
|
{
|
2015-01-17 16:29:21 +01:00
|
|
|
if (!SatipConfig.GetDisableServerQuirks()) {
|
|
|
|
// These devices contain a session id bug:
|
|
|
|
// Inverto Airscreen Server IDL 400 ?
|
|
|
|
// Elgato EyeTV Netstream 4Sat ?
|
|
|
|
if (strstr(*descriptionM, "GSSBOX") || // Grundig Sat Systems GSS.box DSI 400
|
|
|
|
strstr(*descriptionM, "DIGIBIT") || // Telestar Digibit R1
|
|
|
|
strstr(*descriptionM, "Triax SatIP Converter") // Triax TSS 400
|
2015-01-27 15:27:23 +01:00
|
|
|
) {
|
2015-01-17 16:29:21 +01:00
|
|
|
quirkM |= eSatipQuirkSessionId;
|
2015-01-27 15:27:23 +01:00
|
|
|
quirksM = cString::sprintf("%s%sSessionId", *quirksM, isempty(*quirksM) ? "" : ",");
|
|
|
|
}
|
2015-01-17 16:29:21 +01:00
|
|
|
// These devices contain a play (add/delpids) parameter bug:
|
2015-01-27 15:27:23 +01:00
|
|
|
if (strstr(*descriptionM, "fritzdvbc") // Fritz!WLAN Repeater DVB-C
|
|
|
|
) {
|
2015-01-17 16:29:21 +01:00
|
|
|
quirkM |= eSatipQuirkPlayPids;
|
2015-01-27 15:27:23 +01:00
|
|
|
quirksM = cString::sprintf("%s%sPlayPids", *quirksM, isempty(*quirksM) ? "" : ",");
|
|
|
|
}
|
2015-01-17 16:29:21 +01:00
|
|
|
// These devices contain a frontend locking bug:
|
2015-09-18 17:31:53 +02:00
|
|
|
if (strstr(*descriptionM, "fritzdvbc") || // Fritz!WLAN Repeater DVB-C
|
|
|
|
strstr(*descriptionM, "Schwaiger Sat>IP Server") // Schwaiger MS41IP
|
2015-01-27 15:27:23 +01:00
|
|
|
) {
|
2015-01-17 16:29:21 +01:00
|
|
|
quirkM |= eSatipQuirkForceLock;
|
2015-01-27 15:27:23 +01:00
|
|
|
quirksM = cString::sprintf("%s%sForceLock", *quirksM, isempty(*quirksM) ? "" : ",");
|
|
|
|
}
|
|
|
|
debug3("%s description=%s quirks=%s", __PRETTY_FUNCTION__, *descriptionM, *quirksM);
|
2015-01-17 16:29:21 +01:00
|
|
|
}
|
2015-01-16 23:00:59 +01:00
|
|
|
// These devices support the X_PMT protocol extension
|
2015-05-26 20:18:05 +02:00
|
|
|
if (strstr(*descriptionM, "OctopusNet") || // Digital Devices OctopusNet
|
|
|
|
strstr(*descriptionM, "minisatip") // minisatip server
|
|
|
|
) {
|
2015-01-25 23:21:55 +01:00
|
|
|
hasCiM = true;
|
2015-05-26 20:18:05 +02:00
|
|
|
}
|
2014-03-13 17:23:55 +01:00
|
|
|
char *s, *p = strdup(*modelM);
|
|
|
|
char *r = strtok_r(p, ",", &s);
|
|
|
|
while (r) {
|
2015-01-15 22:33:51 +01:00
|
|
|
char *c;
|
|
|
|
if (c = strstr(r, "DVBS2-")) {
|
|
|
|
int count = atoi(c + 6);
|
|
|
|
for (int i = 1; i <= count; ++i)
|
|
|
|
frontendsM[eSatipFrontendDVBS2].Add(new cSatipFrontend(i, "DVB-S2"));
|
2014-03-13 17:23:55 +01:00
|
|
|
}
|
2015-01-15 22:33:51 +01:00
|
|
|
else if (c = strstr(r, "DVBT-")) {
|
|
|
|
int count = atoi(c + 5);
|
|
|
|
for (int i = 1; i <= count; ++i)
|
|
|
|
frontendsM[eSatipFrontendDVBT].Add(new cSatipFrontend(i, "DVB-T"));
|
2014-03-13 17:23:55 +01:00
|
|
|
}
|
2015-01-15 22:33:51 +01:00
|
|
|
else if (c = strstr(r, "DVBT2-")) {
|
|
|
|
int count = atoi(c + 6);
|
|
|
|
for (int i = 1; i <= count; ++i)
|
|
|
|
frontendsM[eSatipFrontendDVBT2].Add(new cSatipFrontend(i, "DVB-T2"));
|
2014-10-30 21:10:09 +01:00
|
|
|
}
|
2015-01-15 22:33:51 +01:00
|
|
|
else if (c = strstr(r, "DVBC-")) {
|
|
|
|
int count = atoi(c + 5);
|
|
|
|
for (int i = 1; i <= count; ++i)
|
|
|
|
frontendsM[eSatipFrontendDVBC].Add(new cSatipFrontend(i, "DVB-C"));
|
2014-11-20 21:30:18 +01:00
|
|
|
}
|
2015-01-15 22:33:51 +01:00
|
|
|
else if (c = strstr(r, "DVBC2-")) {
|
|
|
|
int count = atoi(c + 6);
|
|
|
|
for (int i = 1; i <= count; ++i)
|
|
|
|
frontendsM[eSatipFrontendDVBC2].Add(new cSatipFrontend(i, "DVB-C2"));
|
2014-03-13 17:23:55 +01:00
|
|
|
}
|
|
|
|
r = strtok_r(NULL, ",", &s);
|
|
|
|
}
|
|
|
|
free(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
cSatipServer::~cSatipServer()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipServer::Compare(const cListObject &listObjectP) const
|
|
|
|
{
|
|
|
|
const cSatipServer *s = (const cSatipServer *)&listObjectP;
|
2015-01-13 20:24:31 +01:00
|
|
|
int result = strcasecmp(*addressM, *s->addressM);
|
|
|
|
if (!result) {
|
|
|
|
result = strcasecmp(*modelM, *s->modelM);
|
|
|
|
if (!result)
|
|
|
|
result = strcasecmp(*descriptionM, *s->descriptionM);
|
|
|
|
}
|
|
|
|
return result;
|
2014-03-13 17:23:55 +01:00
|
|
|
}
|
|
|
|
|
2015-02-16 16:21:00 +01:00
|
|
|
bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transponderP)
|
2015-01-15 22:33:51 +01:00
|
|
|
{
|
|
|
|
bool result = false;
|
|
|
|
if (cSource::IsType(sourceP, 'S'))
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBS2].Assign(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
else if (cSource::IsType(sourceP, 'T')) {
|
|
|
|
if (systemP)
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBT2].Assign(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
else
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBT].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBT2].Assign(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
}
|
|
|
|
else if (cSource::IsType(sourceP, 'C')) {
|
|
|
|
if (systemP)
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
else
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBC].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cSatipServer::Matches(int sourceP)
|
|
|
|
{
|
|
|
|
if (cSource::IsType(sourceP, 'S'))
|
|
|
|
return GetModulesDVBS2();
|
|
|
|
else if (cSource::IsType(sourceP, 'T'))
|
|
|
|
return GetModulesDVBT() || GetModulesDVBT2();
|
|
|
|
else if (cSource::IsType(sourceP, 'C'))
|
|
|
|
return GetModulesDVBC() || GetModulesDVBC2();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-16 16:21:00 +01:00
|
|
|
bool cSatipServer::Matches(int deviceIdP, int sourceP, int systemP, int transponderP)
|
2015-01-15 22:33:51 +01:00
|
|
|
{
|
|
|
|
bool result = false;
|
|
|
|
if (cSource::IsType(sourceP, 'S'))
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBS2].Matches(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
else if (cSource::IsType(sourceP, 'T')) {
|
|
|
|
if (systemP)
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBT2].Matches(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
else
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBT].Matches(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBT2].Matches(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
}
|
|
|
|
else if (cSource::IsType(sourceP, 'C')) {
|
|
|
|
if (systemP)
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBC2].Matches(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
else
|
2015-02-16 16:21:00 +01:00
|
|
|
result = frontendsM[eSatipFrontendDVBC].Matches(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Matches(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2015-02-16 16:21:00 +01:00
|
|
|
void cSatipServer::Attach(int deviceIdP, int transponderP)
|
2015-01-15 22:33:51 +01:00
|
|
|
{
|
|
|
|
for (int i = 0; i < eSatipFrontendCount; ++i) {
|
2015-02-16 16:21:00 +01:00
|
|
|
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))
|
2015-01-15 22:33:51 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipServer::GetModulesDVBS2(void)
|
|
|
|
{
|
|
|
|
return frontendsM[eSatipFrontendDVBS2].Count();
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipServer::GetModulesDVBT(void)
|
|
|
|
{
|
|
|
|
return frontendsM[eSatipFrontendDVBT].Count();
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipServer::GetModulesDVBT2(void)
|
|
|
|
{
|
|
|
|
return frontendsM[eSatipFrontendDVBT2].Count();
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipServer::GetModulesDVBC(void)
|
|
|
|
{
|
|
|
|
return frontendsM[eSatipFrontendDVBC].Count();
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipServer::GetModulesDVBC2(void)
|
2014-03-13 17:23:55 +01:00
|
|
|
{
|
2015-01-15 22:33:51 +01:00
|
|
|
return frontendsM[eSatipFrontendDVBC2].Count();
|
2014-03-13 17:23:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// --- cSatipServers ----------------------------------------------------------
|
|
|
|
|
|
|
|
cSatipServer *cSatipServers::Find(cSatipServer *serverP)
|
|
|
|
{
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
2015-01-15 22:33:51 +01:00
|
|
|
if (s->Compare(*serverP) == 0)
|
2014-03-13 17:23:55 +01:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-01-15 22:33:51 +01:00
|
|
|
cSatipServer *cSatipServers::Find(int sourceP)
|
2014-03-13 17:23:55 +01:00
|
|
|
{
|
2014-11-01 15:31:44 +01:00
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
2015-01-15 22:33:51 +01:00
|
|
|
if (s->Matches(sourceP))
|
2014-11-01 15:31:44 +01:00
|
|
|
return s;
|
|
|
|
}
|
2015-01-15 22:33:51 +01:00
|
|
|
return NULL;
|
2014-03-13 17:23:55 +01:00
|
|
|
}
|
|
|
|
|
2015-02-16 16:21:00 +01:00
|
|
|
cSatipServer *cSatipServers::Assign(int deviceIdP, int sourceP, int transponderP, int systemP)
|
2014-11-01 15:31:44 +01:00
|
|
|
{
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
2015-02-16 16:21:00 +01:00
|
|
|
if (s->Matches(deviceIdP, sourceP, systemP, transponderP))
|
2015-01-15 22:33:51 +01:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
2015-02-16 16:21:00 +01:00
|
|
|
if (s->Assign(deviceIdP, sourceP, systemP, transponderP))
|
2015-01-15 22:33:51 +01:00
|
|
|
return s;
|
2014-11-01 15:31:44 +01:00
|
|
|
}
|
2015-01-15 22:33:51 +01:00
|
|
|
return NULL;
|
2014-11-01 15:31:44 +01:00
|
|
|
}
|
|
|
|
|
2014-03-13 17:23:55 +01:00
|
|
|
cSatipServer *cSatipServers::Update(cSatipServer *serverP)
|
|
|
|
{
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
|
|
|
if (s->Compare(*serverP) == 0) {
|
|
|
|
s->Update();
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-02-16 16:21:00 +01:00
|
|
|
void cSatipServers::Attach(cSatipServer *serverP, int deviceIdP, int transponderP)
|
|
|
|
{
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
|
|
|
if (s == serverP) {
|
|
|
|
s->Attach(deviceIdP, transponderP);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void cSatipServers::Detach(cSatipServer *serverP, int deviceIdP, int transponderP)
|
2015-01-15 22:33:51 +01:00
|
|
|
{
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
|
|
|
if (s == serverP) {
|
2015-02-16 16:21:00 +01:00
|
|
|
s->Detach(deviceIdP, transponderP);
|
2015-01-15 22:33:51 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cSatipServers::IsQuirk(cSatipServer *serverP, int quirkP)
|
2014-03-13 17:23:55 +01:00
|
|
|
{
|
2015-01-15 22:33:51 +01:00
|
|
|
bool result = false;
|
2014-03-13 17:23:55 +01:00
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
|
|
|
if (s == serverP) {
|
2015-01-15 22:33:51 +01:00
|
|
|
result = s->Quirk(quirkP);
|
2014-03-13 17:23:55 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2015-01-15 22:33:51 +01:00
|
|
|
return result;
|
2014-03-13 17:23:55 +01:00
|
|
|
}
|
|
|
|
|
2015-01-25 23:21:55 +01:00
|
|
|
bool cSatipServers::HasCI(cSatipServer *serverP)
|
|
|
|
{
|
|
|
|
bool result = false;
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
|
|
|
if (s == serverP) {
|
|
|
|
result = s->HasCI();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2014-03-13 17:23:55 +01:00
|
|
|
void cSatipServers::Cleanup(uint64_t intervalMsP)
|
|
|
|
{
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
|
|
|
if (!intervalMsP || (s->LastSeen() > intervalMsP)) {
|
2014-12-16 22:09:31 +01:00
|
|
|
info("Removing server %s (%s %s)", s->Description(), s->Address(), s->Model());
|
2014-03-13 17:23:55 +01:00
|
|
|
Del(s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-15 22:33:51 +01:00
|
|
|
cString cSatipServers::GetAddress(cSatipServer *serverP)
|
|
|
|
{
|
|
|
|
cString address = "";
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
|
|
|
if (s == serverP) {
|
|
|
|
address = s->Address();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return address;
|
|
|
|
}
|
|
|
|
|
2014-03-13 17:23:55 +01:00
|
|
|
cString cSatipServers::GetString(cSatipServer *serverP)
|
|
|
|
{
|
|
|
|
cString list = "";
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
|
|
|
if (s == serverP) {
|
2014-03-23 16:59:08 +01:00
|
|
|
list = cString::sprintf("%s|%s|%s", s->Address(), s->Model(), s->Description());
|
2014-03-13 17:23:55 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
cString cSatipServers::List(void)
|
|
|
|
{
|
|
|
|
cString list = "";
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s))
|
2014-03-23 16:59:08 +01:00
|
|
|
list = cString::sprintf("%s%s|%s|%s\n", *list, s->Address(), s->Model(), s->Description());
|
2014-03-13 17:23:55 +01:00
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipServers::NumProvidedSystems(void)
|
|
|
|
{
|
|
|
|
int count = 0;
|
|
|
|
for (cSatipServer *s = First(); s; s = Next(s)) {
|
2014-11-01 15:31:44 +01:00
|
|
|
// DVB-S2: qpsk, 8psk, 16apsk, 32apsk
|
2015-01-15 22:33:51 +01:00
|
|
|
count += s->GetModulesDVBS2() * 4;
|
2014-11-01 15:31:44 +01:00
|
|
|
// DVB-T: qpsk, qam16, qam64
|
2015-01-15 22:33:51 +01:00
|
|
|
count += s->GetModulesDVBT() * 3;
|
|
|
|
// DVB-T2: qpsk, qam16, qam64, qam256
|
|
|
|
count += s->GetModulesDVBT2() * 4;
|
2014-11-01 15:31:44 +01:00
|
|
|
// DVB-C: qam64, qam128, qam256
|
2015-01-15 22:33:51 +01:00
|
|
|
count += s->GetModulesDVBC() * 3;
|
|
|
|
// DVB-C2: qam16, qam32, qam64, qam128, qam256
|
|
|
|
count += s->GetModulesDVBC2() * 5;
|
2014-03-13 17:23:55 +01:00
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|