Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuners and signal status #156

Merged
merged 9 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ set(VUPLUS_HEADERS src/client.h
src/enigma2/utilities/LocalizedString.h
src/enigma2/utilities/UpdateState.h
src/enigma2/utilities/FileUtils.h
src/enigma2/utilities/json.hpp
src/enigma2/utilities/Logger.h
src/enigma2/utilities/Tuner.h
src/enigma2/utilities/WebUtils.h)

set(DEPLIBS ${kodiplatform_LIBRARIES}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Within this tab general options are configured.

* **Fetch picons from web interface**: Fetch the picons straight from the Enigma 2 set-top box.
* **Use picons.eu file formate**: Assume all picons files fetched from the set-top box start with `1_1_1_` and end with `_0_0_0`
* **Use OpenWebIf picon path**: Fetch the picon path from OpenWebIf instead of constructing from ServiceRef. Requires OpenWebIf 1.3.x or higher.
* **Icon path**: In order to have Kodi display channel logos you have to copy the picons from your set-top box onto your OpenELEC machine. You then need to specify this path in this property.
* **Update interval**: As the set-top box can also be used to modify timers, delete recordings etc. and the set-top box does not notify the Kodi installation, the addon needs to regularly check for updates (new channels, new/changed/deletes timers, deleted recordings, etc.) This property defines how often the addon checks for updates.
* **Update mode**: The mode used when the update interval is reached. Note that if there is any timer change detected a recordings update will always occur regardless of the update mode. Choose from one of the following two modes:
Expand Down
10 changes: 9 additions & 1 deletion pvr.vuplus/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.vuplus"
version="3.15.5"
version="3.16.0"
name="Enigma2 Client"
provider-name="Joerg Dembski and Ross Nicholson">
<requires>@ADDON_DEPENDS@</requires>
Expand Down Expand Up @@ -175,6 +175,14 @@
<disclaimer lang="zh_TW">這是測試版軟體!其原創作者並無法對於以下情況負責,包含:錄影失敗,不正確的定時設定,多餘時數,或任何產生的其它不良影響...</disclaimer>
<platform>@PLATFORM@</platform>
<news>
v3.16.0
- Added: Tuners and SignalStatus
- Added: Use Picon Path from OpenWebIf
- Fixed: Change startup issue log statements from Debug to Error, fixes #157

v3.15.5
- Added: updated language files from Transifex

v3.15.4
- Fixed: In 3.15.2 WebIf that is not OpenWebIf does not support auto timer API - Addon won't load Newnigma2 image, fixes #151

Expand Down
8 changes: 8 additions & 0 deletions pvr.vuplus/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v3.16.0
- Added: Tuners and SignalStatus
- Added: Use Picon Path from OpenWebIf
- Fixed: Change startup issue log statements from Debug to Error, fixes #157

v3.15.5
- Added: updated language files from Transifex

v3.15.4
- Fixed: In 3.15.2 WebIf that is not OpenWebIf does not support auto timer API - Addon won't load Newnigma2 image, fixes #151

Expand Down
18 changes: 17 additions & 1 deletion pvr.vuplus/resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,11 @@ msgctxt "#30102"
msgid "Timers only"
msgstr ""

#empty strings from id 30103 to 30409
msgctxt "#30103"
msgid "Use OpenWebIf picon path"
msgstr ""

#empty strings from id 30104 to 30409

msgctxt "#30410"
msgid "Automatic"
Expand Down Expand Up @@ -478,3 +482,15 @@ msgstr ""
msgctxt "#30514"
msgid "Timeshift buffer path does not exist"
msgstr ""

msgctxt "#30515"
msgid "Enigma2: Could not reach web interface"
msgstr ""

msgctxt "#30516"
msgid "Enigma2: No channel groups found"
msgstr ""

msgctxt "#30517"
msgid "Enigma2: No channels found"
msgstr ""
8 changes: 8 additions & 0 deletions pvr.vuplus/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@
</dependencies>
<control type="toggle" />
</setting>
<setting id="useopenwebifpiconpath" type="boolean" parent="onlinepicons" label="30103">
<level>0</level>
<default>false</default>
<dependencies>
<dependency type="enable" setting="onlinepicons">true</dependency>
</dependencies>
<control type="toggle" />
</setting>
<setting id="iconpath" type="path" label="30008">
<level>0</level>
<default></default>
Expand Down
25 changes: 24 additions & 1 deletion src/Enigma2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ bool Enigma2::Open()
if (!m_isConnected)
{
Logger::Log(LEVEL_ERROR, "%s It seem's that the webinterface cannot be reached. Make sure that you set the correct configuration options in the addon settings!", __FUNCTION__);
XBMC->QueueNotification(QUEUE_ERROR, LocalizedString(30515).c_str());
return false;
}

Expand All @@ -113,11 +114,20 @@ bool Enigma2::Open()
{
// Load the TV channels - close connection if no channels are found
if (!m_channelGroups.LoadChannelGroups())
{
Logger::Log(LEVEL_ERROR, "%s No channel groups (bouquets) found, please check the addon channel settings, exiting", __FUNCTION__);
XBMC->QueueNotification(QUEUE_ERROR, LocalizedString(30516).c_str());

return false;
}

if (!m_channels.LoadChannels(m_channelGroups))
return false;
{
Logger::Log(LEVEL_ERROR, "%s No channels found, please check the addon channel settings, exiting", __FUNCTION__);
XBMC->QueueNotification(QUEUE_ERROR, LocalizedString(30517).c_str());

return false;
}
}
m_timers.AddTimerChangeWatcher(&m_dueRecordingUpdate);
m_timers.TimerUpdates();
Expand Down Expand Up @@ -464,4 +474,17 @@ PVR_ERROR Enigma2::DeleteTimer(const PVR_TIMER &timer)
PVR_ERROR Enigma2::GetDriveSpace(long long *iTotal, long long *iUsed)
{
return m_admin.GetDriveSpace(iTotal, iUsed, m_locations);
}

PVR_ERROR Enigma2::GetTunerSignal(PVR_SIGNAL_STATUS &signalStatus)
{
if (m_currentChannel >= 0)
{
const std::shared_ptr<Channel> channel = m_channels.GetChannel(m_currentChannel);

strncpy(signalStatus.strServiceName, channel->GetChannelName().c_str(), sizeof(signalStatus.strServiceName) - 1);
strncpy(signalStatus.strProviderName, channel->GetProviderName().c_str(), sizeof(signalStatus.strProviderName) - 1);
}

return m_admin.GetTunerSignal(signalStatus);
}
1 change: 1 addition & 0 deletions src/Enigma2.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Enigma2 : public P8PLATFORM::CThread
PVR_ERROR UpdateTimer(const PVR_TIMER &timer);
PVR_ERROR DeleteTimer(const PVR_TIMER &timer);
PVR_ERROR GetDriveSpace(long long *iTotal, long long *iUsed);
PVR_ERROR GetTunerSignal(PVR_SIGNAL_STATUS &signalStatus);

protected:
virtual void *Process(void);
Expand Down
17 changes: 13 additions & 4 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,23 @@ PVR_ERROR GetDriveSpace(long long *iTotal, long long *iUsed)

PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS &signalStatus)
{
// the RS api doesn't provide information about signal quality (yet)
// SNR = Signal to Noise Ratio - which means signal quality
// AGC = Automatic Gain Control - which means signal strength
// BER = Bit Error Rate - which shows the error rate of the signal.
// UNC = There is not notion of UNC on enigma devices

// So, SNR and AGC should be as high as possible.
// BER should be as low as possible, like 0. It can be higher, if your other values are higher.

enigma->GetTunerSignal(signalStatus);

Logger::Log(LEVEL_DEBUG, "%s Tuner Details - name: %s, status: %s", __FUNCTION__, signalStatus.strAdapterName, signalStatus.strAdapterStatus);
Logger::Log(LEVEL_DEBUG, "%s Service Details - service: %s, provider: %s", __FUNCTION__, signalStatus.strServiceName, signalStatus.strProviderName);
Logger::Log(LEVEL_DEBUG, "%s Signal - snrPercent: %d, ber: %u, signal strength: %d", __FUNCTION__, signalStatus.iSNR, signalStatus.iBER, signalStatus.iSignal);

PVR_STRCPY(signalStatus.strAdapterName, LocalizedString(60084).c_str()); //Enigma2 Media Server
PVR_STRCPY(signalStatus.strAdapterStatus, LocalizedString(60085).c_str()); //OK
return PVR_ERROR_NO_ERROR;
}


/***************************************************************************
* ChannelGroups
**************************************************************************/
Expand Down
Loading