Go to the documentation of this file.
17 #define LOC QString("SatIP: ")
20 const QString
SATIP_URI =
"urn:ses-com:device:SatIPServer:1";
27 auto seconds = duration_cast<std::chrono::seconds>(totalSearchTime);
29 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Using UPNP to search for Sat>IP servers (%1 secs)")
30 .arg(seconds.count()));
37 while (totalTime.
elapsed() < totalSearchTime)
39 std::this_thread::sleep_for(25ms);
40 std::chrono::milliseconds ttl = totalSearchTime - totalTime.
elapsed();
41 if (searchTime.
elapsed() > 249ms && ttl > 1s)
43 auto ttl_s = duration_cast<std::chrono::seconds>(ttl);
44 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"UPNP search %1 ms")
62 LOG(VB_GENERAL, LOG_INFO,
LOC +
"No UPnP Sat>IP servers found");
66 int count = satipservers->
Count();
71 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Found %1 possible Sat>IP servers").arg(count));
76 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No UPnP Sat>IP servers found, but SSDP::Find() != NULL");
82 for (
auto *BE : std::as_const(map))
84 QString friendlyName = BE->GetFriendlyName();
89 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"GetDeviceDesc() failed for %1").arg(friendlyName));
97 for (
const auto& attrib : extraAttribs)
99 if (attrib.m_sName ==
"satip:X_SATIPCAP")
101 QStringList caps = attrib.m_sValue.split(
",");
103 for (
const auto& cap : std::as_const(caps))
105 QStringList tuner = cap.split(
"-");
107 if (tuner.size() != 2)
110 int num_tuners = tuner.at(1).toInt();
111 for (
int i = 0; i < num_tuners; i++)
113 QString device = QString(
"%1 %2 %3 %4 %5")
115 friendlyName.remove(
" "),
122 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Found %1").arg(device));
132 satipservers =
nullptr;
141 if (satipservers && satipservers->
Count() > 0)
156 for (
const auto& dev : std::as_const(devs))
158 QStringList devinfo = dev.split(
" ");
159 const QString&
id = devinfo.at(0);
161 if (
id.toUpper() == deviceuuid.toUpper())
163 return devinfo.at(2);
171 QStringList dev = deviceid.split(
":");
172 if (dev.length() < 3)
177 QString
type = dev.at(2).toUpper();
203 QStringList devinfo = deviceid.split(
":");
204 if (devinfo.length() < 3)
209 QString
type = devinfo.at(2).toUpper();
211 if (
type.startsWith(
"DVBC"))
270 return QString::number(
freq / 1000000.0,
'f', 2);
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
static const int kTunerTypeDVBC
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
void PerformSearch(const QString &sST, std::chrono::seconds timeout=2s)
A QElapsedTimer based timer to replace use of QTime as a timer.
static QString ro(DTVRollOff ro)
@ kModulationSystem_DVBS2
static const int kTunerTypeDVBS1
static const std::array< const uint32_t, 4 > freq
static QString bw(DTVBandwidth bw)
static SSDPCacheEntries * Find(const QString &sURI)
void start(void)
starts measuring elapsed time.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static QString tmode(DTVTransmitMode tmode)
void GetEntryMap(EntryMap &map)
Returns a copy of the EntryMap.
constexpr std::chrono::milliseconds SEARCH_TIME_MS
static QStringList doUPNPsearch(bool loginfo)
static QString findDeviceIP(const QString &deviceuuid)
static QStringList probeDevices(void)
static const int kTunerTypeUnknown
static int toTunerType(const QString &deviceid)
static QStringList findServers(void)
QMap< QString, DeviceLocation * > EntryMap
Key == Unique Service Name (USN)
static CardUtil::INPUT_TYPES toDVBInputType(const QString &deviceid)
static QString freq(uint64_t freq)
static QString gi(DTVGuardInterval gi)
static QString pol(DTVPolarity pol)
static const int kTunerTypeDVBS2
@ kModulationSystem_DVBT2
@ kModulationSystem_DVBC_ANNEX_A
static QString fec(DTVCodeRate fec)
static const int kTunerTypeDVBT
INPUT_TYPES
all the different inputs
QString GetUDN(void) const
static QString msys(DTVModulationSystem msys)
static const int kTunerTypeDVBT2
static QString mtype(DTVModulation mtype)