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

Ci #2985

Merged
merged 3 commits into from
Aug 3, 2023
Merged

Ci #2985

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
14 changes: 11 additions & 3 deletions lib/dvb_ci/dvbci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1323,16 +1323,24 @@ void eDVBCISlot::data(int what)

DEFINE_REF(eDVBCISlot);

eDVBCISlot::eDVBCISlot(eMainloop *context, int nr)
eDVBCISlot::eDVBCISlot(eMainloop *context, int nr):
startup_timeout(eTimer::create(context))
{
char configStr[255];
slotid = nr;
m_context = context;
state = stateDisabled;
snprintf(configStr, 255, "config.ci.%d.enabled", slotid);
bool enabled = eConfigManager::getConfigBoolValue(configStr, true);
if (enabled)
openDevice();
int bootDelay = eConfigManager::getConfigIntValue("config.cimisc.bootDelay");
if (enabled) {
if (bootDelay) {
CONNECT(startup_timeout->timeout, eDVBCISlot::openDevice);
startup_timeout->start(1000 * bootDelay, true);
}
else
openDevice();
}
else
/* emit */ eDVBCI_UI::getInstance()->m_messagepump.send(eDVBCIInterfaces::Message(eDVBCIInterfaces::Message::slotStateChanged, getSlotID(), 3)); // state disabled
}
Expand Down
1 change: 1 addition & 0 deletions lib/dvb_ci/dvbci.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class eDVBCISlot: public iObject, public sigc::trackable
int slotid;
int fd;
ePtr<eSocketNotifier> notifier;
ePtr<eTimer> startup_timeout;
int state;
int m_ci_version;
std::map<uint16_t, uint8_t> running_services;
Expand Down
10 changes: 2 additions & 8 deletions lib/python/Screens/Ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ def setRelevantPidsRouting(configElement):


def InitCiConfig():
def delayTimerCallback():
for slot in range(SystemInfo["CommonInterface"]):
config.ci[slot].enabled.addNotifier(setCIEnabled)
config.ci = ConfigSubList()
config.cimisc = ConfigSubsection()
if SystemInfo["CommonInterface"]:
for slot in range(SystemInfo["CommonInterface"]):
config.ci.append(ConfigSubsection())
config.ci[slot].enabled = ConfigYesNo(default=True)
config.ci[slot].enabled.slotid = slot
config.ci[slot].enabled.addNotifier(setCIEnabled, initial_call=False)
config.ci[slot].canDescrambleMultipleServices = ConfigSelection(choices=[("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default="auto")
config.ci[slot].use_static_pin = ConfigYesNo(default=True)
config.ci[slot].static_pin = ConfigPIN(default=0)
Expand All @@ -68,11 +66,7 @@ def delayTimerCallback():
if SystemInfo["CommonInterfaceCIDelay"]:
config.cimisc.dvbCiDelay = ConfigSelection(default="256", choices=[("16", "16"), ("32", "32"), ("64", "64"), ("128", "128"), ("256", "256")])
config.cimisc.dvbCiDelay.addNotifier(setdvbCiDelay)
config.cimisc.bootDelay = ConfigSelection(default=10, choices=[(x, _("%d Seconds") % x) for x in range(16)])
if config.cimisc.bootDelay.value:
delayTimer = eTimer()
delayTimer.callback.append(delayTimerCallback)
delayTimer.start(config.cimisc.bootDelay.value * 1000, True)
config.cimisc.bootDelay = ConfigSelection(default=5, choices=[(x, _("%d Seconds") % x) for x in range(16)])


class MMIDialog(Screen):
Expand Down
Loading