mirror of
https://github.com/rofafor/vdr-plugin-femon.git
synced 2023-10-10 13:36:53 +02:00
Updated for vdr-1.7.23.
Updated SVDRP interface.
This commit is contained in:
parent
1e3b10faa7
commit
cf8920ddd6
4
HISTORY
4
HISTORY
@ -422,6 +422,8 @@ VDR Plugin 'femon' Revision History
|
|||||||
- Added cppcheck target into Makefile.
|
- Added cppcheck target into Makefile.
|
||||||
- Refactored bitstream code.
|
- Refactored bitstream code.
|
||||||
|
|
||||||
20XX-XX-XX: Version 1.7.12
|
2012-01-15: Version 1.7.12
|
||||||
|
|
||||||
|
- Updated for vdr-1.7.23.
|
||||||
|
- Updated SVDRP interface.
|
||||||
— Added Hungarian translation (Thanks to Fuley Istvan).
|
— Added Hungarian translation (Thanks to Fuley Istvan).
|
||||||
|
88
femon.c
88
femon.c
@ -14,8 +14,8 @@
|
|||||||
#include "femonservice.h"
|
#include "femonservice.h"
|
||||||
#include "femontools.h"
|
#include "femontools.h"
|
||||||
|
|
||||||
#if defined(APIVERSNUM) && APIVERSNUM < 10722
|
#if defined(APIVERSNUM) && APIVERSNUM < 10723
|
||||||
#error "VDR-1.7.22 API version or greater is required!"
|
#error "VDR-1.7.23 API version or greater is required!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char VERSION[] = "1.7.12";
|
static const char VERSION[] = "1.7.12";
|
||||||
@ -135,13 +135,13 @@ bool cPluginFemon::Service(const char *Id, void *Data)
|
|||||||
FemonService_v1_0 *data = (FemonService_v1_0*)Data;
|
FemonService_v1_0 *data = (FemonService_v1_0*)Data;
|
||||||
if (!cDevice::ActualDevice())
|
if (!cDevice::ActualDevice())
|
||||||
return false;
|
return false;
|
||||||
int ndx = cDevice::ActualDevice()->CardIndex();
|
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
|
||||||
data->fe_name = getFrontendName(ndx);
|
data->fe_name = getFrontendName(dev);
|
||||||
data->fe_status = getFrontendStatus(ndx);
|
data->fe_status = getFrontendStatus(dev);
|
||||||
data->fe_snr = getSNR(ndx);
|
data->fe_snr = getSNR(dev);
|
||||||
data->fe_signal = getSignal(ndx);
|
data->fe_signal = getSignal(dev);
|
||||||
data->fe_ber = getBER(ndx);
|
data->fe_ber = getBER(dev);
|
||||||
data->fe_unc = getUNC(ndx);
|
data->fe_unc = getUNC(dev);
|
||||||
data->video_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetVideoBitrate() : 0.0;
|
data->video_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetVideoBitrate() : 0.0;
|
||||||
data->audio_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetAudioBitrate() : 0.0;
|
data->audio_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetAudioBitrate() : 0.0;
|
||||||
data->dolby_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetDolbyBitrate() : 0.0;
|
data->dolby_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetDolbyBitrate() : 0.0;
|
||||||
@ -163,30 +163,30 @@ const char **cPluginFemon::SVDRPHelpPages(void)
|
|||||||
" Switch to next possible device.",
|
" Switch to next possible device.",
|
||||||
"PREV\n"
|
"PREV\n"
|
||||||
" Switch to previous possible device.",
|
" Switch to previous possible device.",
|
||||||
"INFO\n"
|
"INFO <card index>\n"
|
||||||
" Print the current frontend information.",
|
" Print the frontend information.",
|
||||||
"NAME\n"
|
"NAME <card index>\n"
|
||||||
" Print the current frontend name.",
|
" Print the frontend name.",
|
||||||
"STAT\n"
|
"STAT <card index>\n"
|
||||||
" Print the current frontend status.",
|
" Print the frontend status.",
|
||||||
"STRG\n"
|
"STRG <card index>\n"
|
||||||
" Print the current signal strength.",
|
" Print the signal strength.",
|
||||||
"QUAL\n"
|
"QUAL <card index>\n"
|
||||||
" Print the current signal quality.",
|
" Print the signal quality.",
|
||||||
"SGNL\n"
|
"SGNL <card index>\n"
|
||||||
" Print the current signal strength from driver.",
|
" Print the signal strength from driver.",
|
||||||
"SNRA\n"
|
"SNRA <card index>\n"
|
||||||
" Print the current signal-to-noise ratio from driver.",
|
" Print the signal-to-noise ratio from driver.",
|
||||||
"BERA\n"
|
"BERA <card index>\n"
|
||||||
" Print the current bit error rate.",
|
" Print the bit error rate.",
|
||||||
"UNCB\n"
|
"UNCB <card index>\n"
|
||||||
" Print the current uncorrected blocks rate.",
|
" Print the uncorrected blocks rate.",
|
||||||
"VIBR\n"
|
"VIBR\n"
|
||||||
" Print the actual device and current video bitrate [Mbit/s].",
|
" Print the current video bitrate [Mbit/s].",
|
||||||
"AUBR\n"
|
"AUBR\n"
|
||||||
" Print the actual device and current audio bitrate [kbit/s].",
|
" Print the current audio bitrate [kbit/s].",
|
||||||
"DDBR\n"
|
"DDBR\n"
|
||||||
" Print the actual device and current dolby bitrate [kbit/s].",
|
" Print the current dolby bitrate [kbit/s].",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
return HelpPages;
|
return HelpPages;
|
||||||
@ -194,6 +194,12 @@ const char **cPluginFemon::SVDRPHelpPages(void)
|
|||||||
|
|
||||||
cString cPluginFemon::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
|
cString cPluginFemon::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
|
||||||
{
|
{
|
||||||
|
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
|
||||||
|
if (*Option && isnumber(Option)) {
|
||||||
|
cDvbDevice *dev2 = dynamic_cast<cDvbDevice*>(cDevice::GetDevice(strtol(Option, NULL, 10)));
|
||||||
|
if (dev2)
|
||||||
|
dev = dev2;
|
||||||
|
}
|
||||||
if (strcasecmp(Command, "OPEN") == 0) {
|
if (strcasecmp(Command, "OPEN") == 0) {
|
||||||
if (cReplayControl::NowReplaying()) {
|
if (cReplayControl::NowReplaying()) {
|
||||||
ReplyCode = 550; // Requested action not taken
|
ReplyCode = 550; // Requested action not taken
|
||||||
@ -221,33 +227,33 @@ cString cPluginFemon::SVDRPCommand(const char *Command, const char *Option, int
|
|||||||
return cString("Cannot switch device");
|
return cString("Cannot switch device");
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "INFO") == 0) {
|
else if (strcasecmp(Command, "INFO") == 0) {
|
||||||
return getFrontendInfo(cDevice::ActualDevice()->CardIndex());
|
return getFrontendInfo(dev);
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "NAME") == 0) {
|
else if (strcasecmp(Command, "NAME") == 0) {
|
||||||
return getFrontendName(cDevice::ActualDevice()->CardIndex());
|
return getFrontendName(dev);
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "STAT") == 0) {
|
else if (strcasecmp(Command, "STAT") == 0) {
|
||||||
return getFrontendStatus(cDevice::ActualDevice()->CardIndex());
|
return getFrontendStatus(dev);
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "STRG") == 0) {
|
else if (strcasecmp(Command, "STRG") == 0) {
|
||||||
return cString::sprintf("%d on device #%d", cDevice::ActualDevice()->SignalStrength(), cDevice::ActualDevice()->CardIndex());
|
return cString::sprintf("%d on device #%d", dev->SignalStrength(), dev->CardIndex());
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "QUAL") == 0) {
|
else if (strcasecmp(Command, "QUAL") == 0) {
|
||||||
return cString::sprintf("%d on device #%d", cDevice::ActualDevice()->SignalQuality(), cDevice::ActualDevice()->CardIndex());
|
return cString::sprintf("%d on device #%d", dev->SignalQuality(), dev->CardIndex());
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "SGNL") == 0) {
|
else if (strcasecmp(Command, "SGNL") == 0) {
|
||||||
int value = getSignal(cDevice::ActualDevice()->CardIndex());
|
int value = getSignal(dev);
|
||||||
return cString::sprintf("%04X (%02d%%) on device #%d", value, value / 655, cDevice::ActualDevice()->CardIndex());
|
return cString::sprintf("%04X (%02d%%) on device #%d", value, value / 655, dev->CardIndex());
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "SNRA") == 0) {
|
else if (strcasecmp(Command, "SNRA") == 0) {
|
||||||
int value = getSNR(cDevice::ActualDevice()->CardIndex());
|
int value = getSNR(dev);
|
||||||
return cString::sprintf("%04X (%02d%%) on device #%d", value, value / 655, cDevice::ActualDevice()->CardIndex());
|
return cString::sprintf("%04X (%02d%%) on device #%d", value, value / 655, dev->CardIndex());
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "BERA") == 0) {
|
else if (strcasecmp(Command, "BERA") == 0) {
|
||||||
return cString::sprintf("%08X on device #%d", getBER(cDevice::ActualDevice()->CardIndex()), cDevice::ActualDevice()->CardIndex());
|
return cString::sprintf("%08X on device #%d", getBER(dev), dev->CardIndex());
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "UNCB") == 0) {
|
else if (strcasecmp(Command, "UNCB") == 0) {
|
||||||
return cString::sprintf("%08X on device #%d", getUNC(cDevice::ActualDevice()->CardIndex()), cDevice::ActualDevice()->CardIndex());
|
return cString::sprintf("%08X on device #%d", getUNC(dev), dev->CardIndex());
|
||||||
}
|
}
|
||||||
else if (strcasecmp(Command, "VIBR") == 0) {
|
else if (strcasecmp(Command, "VIBR") == 0) {
|
||||||
if (cFemonOsd::Instance())
|
if (cFemonOsd::Instance())
|
||||||
|
19
femonosd.c
19
femonosd.c
@ -419,7 +419,7 @@ void cFemonOsd::DrawInfoWindow(void)
|
|||||||
offset += OSDROWHEIGHT;
|
offset += OSDROWHEIGHT;
|
||||||
switch (channel->Source() & cSource::st_Mask) {
|
switch (channel->Source() & cSource::st_Mask) {
|
||||||
case cSource::stSat:
|
case cSource::stSat:
|
||||||
OSDDRAWINFOLINE(*cString::sprintf("DVB-S%s #%d - %s", (m_FrontendInfo.caps & 0x10000000) ? "2" : "", (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
|
OSDDRAWINFOLINE(*cString::sprintf("%s #%d - %s", *getSatelliteSystem(dtp.System()), (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
|
||||||
offset += OSDROWHEIGHT;
|
offset += OSDROWHEIGHT;
|
||||||
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
|
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
|
||||||
OSDDRAWINFORIGHT(trVDR("Source"), *cSource::ToString(channel->Source()));
|
OSDDRAWINFORIGHT(trVDR("Source"), *cSource::ToString(channel->Source()));
|
||||||
@ -430,7 +430,8 @@ void cFemonOsd::DrawInfoWindow(void)
|
|||||||
OSDDRAWINFOLEFT( trVDR("Inversion"), *getInversion(dtp.Inversion()));
|
OSDDRAWINFOLEFT( trVDR("Inversion"), *getInversion(dtp.Inversion()));
|
||||||
OSDDRAWINFORIGHT(trVDR("CoderateH"), *getCoderate(dtp.CoderateH()));
|
OSDDRAWINFORIGHT(trVDR("CoderateH"), *getCoderate(dtp.CoderateH()));
|
||||||
offset += OSDROWHEIGHT;
|
offset += OSDROWHEIGHT;
|
||||||
OSDDRAWINFOLEFT( trVDR("System"), *getSystem(dtp.System()));
|
OSDDRAWINFOLEFT( trVDR("System"), *getSatelliteSystem(dtp.System()));
|
||||||
|
if (dtp.System())
|
||||||
OSDDRAWINFORIGHT(trVDR("RollOff"), *getRollOff(dtp.RollOff()));
|
OSDDRAWINFORIGHT(trVDR("RollOff"), *getRollOff(dtp.RollOff()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -448,7 +449,7 @@ void cFemonOsd::DrawInfoWindow(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case cSource::stTerr:
|
case cSource::stTerr:
|
||||||
OSDDRAWINFOLINE(*cString::sprintf("DVB-T #%d - %s", (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
|
OSDDRAWINFOLINE(*cString::sprintf("%s #%d - %s", *getTerrestrialSystem(dtp.System()), (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
|
||||||
offset += OSDROWHEIGHT;
|
offset += OSDROWHEIGHT;
|
||||||
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
|
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
|
||||||
OSDDRAWINFORIGHT(trVDR("Transmission"), *getTransmission(dtp.Transmission()));
|
OSDDRAWINFORIGHT(trVDR("Transmission"), *getTransmission(dtp.Transmission()));
|
||||||
@ -461,6 +462,10 @@ void cFemonOsd::DrawInfoWindow(void)
|
|||||||
offset += OSDROWHEIGHT;
|
offset += OSDROWHEIGHT;
|
||||||
OSDDRAWINFOLEFT( trVDR("Hierarchy"), *getHierarchy(dtp.Hierarchy()));
|
OSDDRAWINFOLEFT( trVDR("Hierarchy"), *getHierarchy(dtp.Hierarchy()));
|
||||||
OSDDRAWINFORIGHT(trVDR("Guard"), *getGuard(dtp.Guard()));
|
OSDDRAWINFORIGHT(trVDR("Guard"), *getGuard(dtp.Guard()));
|
||||||
|
offset += OSDROWHEIGHT;
|
||||||
|
OSDDRAWINFOLEFT( trVDR("System"), *getTerrestrialSystem(dtp.System()));
|
||||||
|
if (dtp.System())
|
||||||
|
OSDDRAWINFORIGHT(trVDR("PlpId"), *cString::sprintf("%d", dtp.PlpId()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -622,8 +627,8 @@ void cFemonOsd::Show(void)
|
|||||||
{
|
{
|
||||||
debug("%s()\n", __PRETTY_FUNCTION__);
|
debug("%s()\n", __PRETTY_FUNCTION__);
|
||||||
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
|
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0);
|
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
|
||||||
m_Frontend = open(dev, O_RDONLY | O_NONBLOCK);
|
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
|
||||||
if (m_Frontend >= 0) {
|
if (m_Frontend >= 0) {
|
||||||
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
||||||
if (!femonConfig.usesvdrp)
|
if (!femonConfig.usesvdrp)
|
||||||
@ -680,8 +685,8 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber)
|
|||||||
if (!device->IsPrimaryDevice() || !channelNumber || cDevice::PrimaryDevice()->CurrentChannel() != channelNumber)
|
if (!device->IsPrimaryDevice() || !channelNumber || cDevice::PrimaryDevice()->CurrentChannel() != channelNumber)
|
||||||
return;
|
return;
|
||||||
close(m_Frontend);
|
close(m_Frontend);
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0);
|
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
|
||||||
m_Frontend = open(dev, O_RDONLY | O_NONBLOCK);
|
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
|
||||||
if (m_Frontend >= 0) {
|
if (m_Frontend >= 0) {
|
||||||
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
||||||
if (!femonConfig.usesvdrp)
|
if (!femonConfig.usesvdrp)
|
||||||
|
73
femontools.c
73
femontools.c
@ -76,7 +76,7 @@ static const char *getUserString(int Value, const tDvbParameterMap *Map)
|
|||||||
return "---";
|
return "---";
|
||||||
}
|
}
|
||||||
|
|
||||||
cString getFrontendInfo(int cardIndex)
|
cString getFrontendInfo(cDvbDevice *device)
|
||||||
{
|
{
|
||||||
cString info;
|
cString info;
|
||||||
struct dvb_frontend_info value;
|
struct dvb_frontend_info value;
|
||||||
@ -86,13 +86,15 @@ cString getFrontendInfo(int cardIndex)
|
|||||||
uint32_t ber = 0;
|
uint32_t ber = 0;
|
||||||
uint32_t unc = 0;
|
uint32_t unc = 0;
|
||||||
cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
|
cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cardIndex, 0);
|
|
||||||
|
|
||||||
int fe = open(dev, O_RDONLY | O_NONBLOCK);
|
if (!device)
|
||||||
|
return info;
|
||||||
|
|
||||||
|
int fe = open(*cString::sprintf(FRONTEND_DEVICE, device->Adapter(), device->Frontend()), O_RDONLY | O_NONBLOCK);
|
||||||
if (fe < 0)
|
if (fe < 0)
|
||||||
return NULL;
|
return info;
|
||||||
|
|
||||||
info = cString::sprintf("CARD:%d\nSTRG:%d\nQUAL:%d", cardIndex, cDevice::ActualDevice()->SignalStrength(), cDevice::ActualDevice()->SignalQuality());
|
info = cString::sprintf("CARD:%d\nSTRG:%d\nQUAL:%d", device->CardIndex(), device->SignalStrength(), device->SignalQuality());
|
||||||
|
|
||||||
if (ioctl(fe, FE_GET_INFO, &value) >= 0)
|
if (ioctl(fe, FE_GET_INFO, &value) >= 0)
|
||||||
info = cString::sprintf("%s\nTYPE:%d\nNAME:%s", *info, value.type, value.name);
|
info = cString::sprintf("%s\nTYPE:%d\nNAME:%s", *info, value.type, value.name);
|
||||||
@ -117,42 +119,48 @@ cString getFrontendInfo(int cardIndex)
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
cString getFrontendName(int cardIndex)
|
cString getFrontendName(cDvbDevice *device)
|
||||||
{
|
{
|
||||||
struct dvb_frontend_info value;
|
struct dvb_frontend_info value;
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cardIndex, 0);
|
|
||||||
|
|
||||||
int fe = open(dev, O_RDONLY | O_NONBLOCK);
|
if (!device)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
int fe = open(*cString::sprintf(FRONTEND_DEVICE, device->Adapter(), device->Frontend()), O_RDONLY | O_NONBLOCK);
|
||||||
if (fe < 0)
|
if (fe < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
memset(&value, 0, sizeof(value));
|
memset(&value, 0, sizeof(value));
|
||||||
ioctl(fe, FE_GET_INFO, &value);
|
ioctl(fe, FE_GET_INFO, &value);
|
||||||
close(fe);
|
close(fe);
|
||||||
|
|
||||||
return (cString::sprintf("%s on device #%d", value.name, cardIndex));
|
return (cString::sprintf("%s on device #%d", value.name, device->CardIndex()));
|
||||||
}
|
}
|
||||||
|
|
||||||
cString getFrontendStatus(int cardIndex)
|
cString getFrontendStatus(cDvbDevice *device)
|
||||||
{
|
{
|
||||||
fe_status_t value;
|
fe_status_t value;
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cardIndex, 0);
|
|
||||||
|
|
||||||
int fe = open(dev, O_RDONLY | O_NONBLOCK);
|
if (!device)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
int fe = open(*cString::sprintf(FRONTEND_DEVICE, device->Adapter(), device->Frontend()), O_RDONLY | O_NONBLOCK);
|
||||||
if (fe < 0)
|
if (fe < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
memset(&value, 0, sizeof(value));
|
memset(&value, 0, sizeof(value));
|
||||||
ioctl(fe, FE_READ_STATUS, &value);
|
ioctl(fe, FE_READ_STATUS, &value);
|
||||||
close(fe);
|
close(fe);
|
||||||
|
|
||||||
return (cString::sprintf("Status %s:%s:%s:%s:%s on device #%d", (value & FE_HAS_LOCK) ? "LOCKED" : "-", (value & FE_HAS_SIGNAL) ? "SIGNAL" : "-", (value & FE_HAS_CARRIER) ? "CARRIER" : "-", (value & FE_HAS_VITERBI) ? "VITERBI" : "-", (value & FE_HAS_SYNC) ? "SYNC" : "-", cardIndex));
|
return (cString::sprintf("Status %s:%s:%s:%s:%s on device #%d", (value & FE_HAS_LOCK) ? "LOCKED" : "-", (value & FE_HAS_SIGNAL) ? "SIGNAL" : "-", (value & FE_HAS_CARRIER) ? "CARRIER" : "-", (value & FE_HAS_VITERBI) ? "VITERBI" : "-", (value & FE_HAS_SYNC) ? "SYNC" : "-", device->CardIndex()));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t getSignal(int cardIndex)
|
uint16_t getSignal(cDvbDevice *device)
|
||||||
{
|
{
|
||||||
uint16_t value = 0;
|
uint16_t value = 0;
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cardIndex, 0);
|
|
||||||
|
|
||||||
int fe = open(dev, O_RDONLY | O_NONBLOCK);
|
if (!device)
|
||||||
|
return (value);
|
||||||
|
|
||||||
|
int fe = open(*cString::sprintf(FRONTEND_DEVICE, device->Adapter(), device->Frontend()), O_RDONLY | O_NONBLOCK);
|
||||||
if (fe < 0)
|
if (fe < 0)
|
||||||
return (value);
|
return (value);
|
||||||
ioctl(fe, FE_READ_SIGNAL_STRENGTH, &value);
|
ioctl(fe, FE_READ_SIGNAL_STRENGTH, &value);
|
||||||
@ -161,12 +169,14 @@ uint16_t getSignal(int cardIndex)
|
|||||||
return (value);
|
return (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t getSNR(int cardIndex)
|
uint16_t getSNR(cDvbDevice *device)
|
||||||
{
|
{
|
||||||
uint16_t value = 0;
|
uint16_t value = 0;
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cardIndex, 0);
|
|
||||||
|
|
||||||
int fe = open(dev, O_RDONLY | O_NONBLOCK);
|
if (!device)
|
||||||
|
return (value);
|
||||||
|
|
||||||
|
int fe = open(*cString::sprintf(FRONTEND_DEVICE, device->Adapter(), device->Frontend()), O_RDONLY | O_NONBLOCK);
|
||||||
if (fe < 0)
|
if (fe < 0)
|
||||||
return (value);
|
return (value);
|
||||||
ioctl(fe, FE_READ_SNR, &value);
|
ioctl(fe, FE_READ_SNR, &value);
|
||||||
@ -175,12 +185,14 @@ uint16_t getSNR(int cardIndex)
|
|||||||
return (value);
|
return (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getBER(int cardIndex)
|
uint32_t getBER(cDvbDevice *device)
|
||||||
{
|
{
|
||||||
uint32_t value = 0;
|
uint32_t value = 0;
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cardIndex, 0);
|
|
||||||
|
|
||||||
int fe = open(dev, O_RDONLY | O_NONBLOCK);
|
if (!device)
|
||||||
|
return (value);
|
||||||
|
|
||||||
|
int fe = open(*cString::sprintf(FRONTEND_DEVICE, device->Adapter(), device->Frontend()), O_RDONLY | O_NONBLOCK);
|
||||||
if (fe < 0)
|
if (fe < 0)
|
||||||
return (value);
|
return (value);
|
||||||
ioctl(fe, FE_READ_BER, &value);
|
ioctl(fe, FE_READ_BER, &value);
|
||||||
@ -189,12 +201,14 @@ uint32_t getBER(int cardIndex)
|
|||||||
return (value);
|
return (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getUNC(int cardIndex)
|
uint32_t getUNC(cDvbDevice *device)
|
||||||
{
|
{
|
||||||
uint32_t value = 0;
|
uint32_t value = 0;
|
||||||
cString dev = cString::sprintf(FRONTEND_DEVICE, cardIndex, 0);
|
|
||||||
|
|
||||||
int fe = open(dev, O_RDONLY | O_NONBLOCK);
|
if (!device)
|
||||||
|
return (value);
|
||||||
|
|
||||||
|
int fe = open(*cString::sprintf(FRONTEND_DEVICE, device->Adapter(), device->Frontend()), O_RDONLY | O_NONBLOCK);
|
||||||
if (fe < 0)
|
if (fe < 0)
|
||||||
return (value);
|
return (value);
|
||||||
ioctl(fe, FE_READ_UNCORRECTED_BLOCKS, &value);
|
ioctl(fe, FE_READ_UNCORRECTED_BLOCKS, &value);
|
||||||
@ -347,9 +361,14 @@ cString getModulation(int value)
|
|||||||
return cString::sprintf("%s", getUserString(value, ModulationValues));
|
return cString::sprintf("%s", getUserString(value, ModulationValues));
|
||||||
}
|
}
|
||||||
|
|
||||||
cString getSystem(int value)
|
cString getTerrestrialSystem(int value)
|
||||||
{
|
{
|
||||||
return cString::sprintf("%s", getUserString(value, SystemValues));
|
return cString::sprintf("%s", getUserString(value, SystemValuesTerr));
|
||||||
|
}
|
||||||
|
|
||||||
|
cString getSatelliteSystem(int value)
|
||||||
|
{
|
||||||
|
return cString::sprintf("%s", getUserString(value, SystemValuesSat));
|
||||||
}
|
}
|
||||||
|
|
||||||
cString getRollOff(int value)
|
cString getRollOff(int value)
|
||||||
|
18
femontools.h
18
femontools.h
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <vdr/channels.h>
|
#include <vdr/channels.h>
|
||||||
|
#include <vdr/dvbdevice.h>
|
||||||
#include <vdr/remux.h>
|
#include <vdr/remux.h>
|
||||||
#include <vdr/tools.h>
|
#include <vdr/tools.h>
|
||||||
|
|
||||||
@ -25,15 +26,15 @@
|
|||||||
|
|
||||||
#define FRONTEND_DEVICE "/dev/dvb/adapter%d/frontend%d"
|
#define FRONTEND_DEVICE "/dev/dvb/adapter%d/frontend%d"
|
||||||
|
|
||||||
cString getFrontendInfo(int cardIndex = 0);
|
cString getFrontendInfo(cDvbDevice *device);
|
||||||
cString getFrontendName(int cardIndex = 0);
|
cString getFrontendName(cDvbDevice *device);
|
||||||
cString getFrontendStatus(int cardIndex = 0);
|
cString getFrontendStatus(cDvbDevice *device);
|
||||||
|
|
||||||
uint16_t getSNR(int cardIndex = 0);
|
uint16_t getSNR(cDvbDevice *device);
|
||||||
uint16_t getSignal(int cardIndex = 0);
|
uint16_t getSignal(cDvbDevice *device);
|
||||||
|
|
||||||
uint32_t getBER(int cardIndex = 0);
|
uint32_t getBER(cDvbDevice *device);
|
||||||
uint32_t getUNC(int cardIndex = 0);
|
uint32_t getUNC(cDvbDevice *device);
|
||||||
|
|
||||||
cString getApids(const cChannel *channel);
|
cString getApids(const cChannel *channel);
|
||||||
cString getDpids(const cChannel *channel);
|
cString getDpids(const cChannel *channel);
|
||||||
@ -51,7 +52,8 @@ cString getInversion(int value);
|
|||||||
cString getHierarchy(int value);
|
cString getHierarchy(int value);
|
||||||
cString getGuard(int value);
|
cString getGuard(int value);
|
||||||
cString getModulation(int value);
|
cString getModulation(int value);
|
||||||
cString getSystem(int value);
|
cString getTerrestrialSystem(int value);
|
||||||
|
cString getSatelliteSystem(int value);
|
||||||
cString getRollOff(int value);
|
cString getRollOff(int value);
|
||||||
cString getResolution(int width, int height, int scan);
|
cString getResolution(int width, int height, int scan);
|
||||||
cString getAspectRatio(int value);
|
cString getAspectRatio(int value);
|
||||||
|
Loading…
Reference in New Issue
Block a user