Thread: [Commits] : Tuxbox-GIT: apps branch master updated. CVS-Final-50-g4a74281
Tuxbox Sources
Brought to you by:
dbt1
|
From: Thilo G. <tux...@ne...> - 2013-03-07 10:46:22
|
Project "Tuxbox-GIT: apps":
The branch, master has been updated
via 4a7428140c57a6f14ba059019f5983c6eb7c8d28 (commit)
via a547e4575600baa79f0f14cf4b3505e33f3eafba (commit)
via bbeb938f65eaf7fa8112d352663055cab0fe701e (commit)
from 07fcbdcaf0b55d4e4b13fbb71fad37be6598b068 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4a7428140c57a6f14ba059019f5983c6eb7c8d28
Author: Stefan Seyfried <se...@tu...>
Date: Thu Mar 7 11:32:20 2013 +0100
neutrino: add GUI setup support for unicable
diff --git a/tuxbox/neutrino/data/locale/deutsch.locale b/tuxbox/neutrino/data/locale/deutsch.locale
index 6039a13..74c06dc 100644
--- a/tuxbox/neutrino/data/locale/deutsch.locale
+++ b/tuxbox/neutrino/data/locale/deutsch.locale
@@ -1254,6 +1254,10 @@ satsetup.satellite Satellit
satsetup.savesettingsnow Einstellungen jetzt speichern
satsetup.smatvremote SMATV Remote Tuning
satsetup.south Süd
+satsetup.unicable Unicable
+satsetup.unicable_qrg Unicable Frequenz
+satsetup.unicable_scr Unicable SCR#
+satsetup.unicable_settings Unicable Einstellungen
satsetup.usegotoxx Benutze GotoXX
satsetup.west West
scantp.fec FEC
diff --git a/tuxbox/neutrino/data/locale/english.locale b/tuxbox/neutrino/data/locale/english.locale
index 7627c6f..3e09a55 100644
--- a/tuxbox/neutrino/data/locale/english.locale
+++ b/tuxbox/neutrino/data/locale/english.locale
@@ -1254,6 +1254,10 @@ satsetup.satellite Satellite
satsetup.savesettingsnow save settings now
satsetup.smatvremote SMATV Remote Tuning
satsetup.south South
+satsetup.unicable Unicable
+satsetup.unicable_qrg Unicable Frequency
+satsetup.unicable_scr Unicable SCR#
+satsetup.unicable_settings Unicable Settings
satsetup.usegotoxx Use GotoXX
satsetup.west West
scantp.fec FEC
diff --git a/tuxbox/neutrino/src/gui/scan.cpp b/tuxbox/neutrino/src/gui/scan.cpp
index 0bc6cad..b1d7bc1 100644
--- a/tuxbox/neutrino/src/gui/scan.cpp
+++ b/tuxbox/neutrino/src/gui/scan.cpp
@@ -4,6 +4,8 @@
Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/
+ Copyright (C) 2007-2009, 2013 Stefan Seyfried
+
Kommentar:
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
@@ -151,6 +153,9 @@ printf("[neutrino] TP_scan %d TP_freq %s TP_rate %s TP_fec %d TP_pol %d TP_mod %
/* send diseqc type to zapit */
diseqcType = CNeutrinoApp::getInstance()->getScanSettings().diseqcMode;
+ if (diseqcType == DISEQC_UNICABLE)
+ g_Zapit->setUnicableParam(CNeutrinoApp::getInstance()->getScanSettings().uni_scr,
+ CNeutrinoApp::getInstance()->getScanSettings().uni_qrg);
g_Zapit->setDiseqcType(diseqcType);
/* send diseqc repeat to zapit */
diff --git a/tuxbox/neutrino/src/gui/scan_setup.cpp b/tuxbox/neutrino/src/gui/scan_setup.cpp
index b45cd63..aeefd1d 100644
--- a/tuxbox/neutrino/src/gui/scan_setup.cpp
+++ b/tuxbox/neutrino/src/gui/scan_setup.cpp
@@ -12,6 +12,8 @@
Copyright (C) 2009 T. Graf 'dbt'
Homepage: http://www.dbox2-tuning.net/
+ Copyright (C) 2013 Stefan Seyfried
+
License: GPL
This program is free software; you can redistribute it and/or modify
@@ -44,6 +46,7 @@
#include <gui/widget/icons.h>
#include <gui/widget/stringinput.h>
+#include <gui/widget/stringinput_ext.h>
#include <gui/widget/hintbox.h>
#include <driver/screen_max.h>
@@ -140,7 +143,7 @@ const CMenuOptionChooser::keyval SATSETUP_SCANTP_POL[SATSETUP_SCANTP_POL_COUNT]
{ 1, LOCALE_SCANTP_POL_V }
};
-#define SATSETUP_DISEQC_OPTION_COUNT 6
+#define SATSETUP_DISEQC_OPTION_COUNT 7
const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_COUNT] =
{
{ NO_DISEQC , LOCALE_SATSETUP_NODISEQC },
@@ -148,6 +151,7 @@ const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_
{ DISEQC_1_0 , LOCALE_SATSETUP_DISEQC10 },
{ DISEQC_1_1 , LOCALE_SATSETUP_DISEQC11 },
{ DISEQC_1_2 , LOCALE_SATSETUP_DISEQC12 },
+ { DISEQC_UNICABLE , LOCALE_SATSETUP_UNICABLE },
{ SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE }
};
@@ -233,10 +237,12 @@ int CScanSetup::showScanService()
//prepare sat-lnb-settings
CMenuWidget* extSatSettings = NULL;
CMenuWidget* extMotorSettings = NULL;
+ CMenuWidget* extUnicableSettings = NULL;
CStringInput* toff_lat = NULL;
CStringInput* toff_long = NULL;
CMotorControl* motorControl = NULL;
CSatDiseqcNotifier* satDiseqcNotifier = NULL;
+ CIntInput* uniqrg = NULL;
//sat-lnb-settings
if(g_info.delivery_system == DVB_S)
@@ -244,7 +250,7 @@ int CScanSetup::showScanService()
g_Zapit->getScanSatelliteList(satList);
//prepare diseqc
- CMenuOptionStringChooser* ojSat = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, scanSettings.satNameNoDiseqc, ((scanSettings.diseqcMode == DISEQC_1_2) || (scanSettings.diseqcMode == NO_DISEQC)));
+ CMenuOptionStringChooser* ojSat = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, scanSettings.satNameNoDiseqc, ((scanSettings.diseqcMode == DISEQC_1_2) || (scanSettings.diseqcMode == NO_DISEQC)|| scanSettings.diseqcMode == DISEQC_UNICABLE));
for (uint i=0; i < sat_list_size; i++)
{
@@ -253,7 +259,7 @@ int CScanSetup::showScanService()
}
//prepare diseqc repeats
- CMenuOptionNumberChooser * ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&scanSettings.diseqcRepeat, (scanSettings.diseqcMode != NO_DISEQC) && (scanSettings.diseqcMode != DISEQC_1_0), 0, 2);
+ CMenuOptionNumberChooser * ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&scanSettings.diseqcRepeat, (scanSettings.diseqcMode != NO_DISEQC) && (scanSettings.diseqcMode != DISEQC_1_0) && scanSettings.diseqcMode != DISEQC_UNICABLE, 0, 2);
//extended sat settings
extSatSettings = new CMenuWidget(LOCALE_SATSETUP_EXTENDED, NEUTRINO_ICON_SETTINGS);
@@ -262,7 +268,7 @@ int CScanSetup::showScanService()
extSatSettings->addIntroItems();
//prepare diseqc mode
- CMenuForwarder* ojExtSatSettings = new CMenuForwarder(LOCALE_SATSETUP_EXTENDED, (scanSettings.diseqcMode != NO_DISEQC), NULL, extSatSettings, NULL, CRCInput::RC_1);
+ CMenuForwarder* ojExtSatSettings = new CMenuForwarder(LOCALE_SATSETUP_EXTENDED, (scanSettings.diseqcMode != NO_DISEQC && scanSettings.diseqcMode != DISEQC_UNICABLE), NULL, extSatSettings, NULL, CRCInput::RC_1);
//make sat list
for( uint i=0; i < sat_list_size; i++)
@@ -318,10 +324,19 @@ int CScanSetup::showScanService()
extMotorSettings->addItem(oj);
}
+ extUnicableSettings = new CMenuWidget(LOCALE_SATSETUP_UNICABLE_SETTINGS, NEUTRINO_ICON_SETTINGS);
+ extUnicableSettings->addIntroItems();
+ CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNICABLE_SCR, (int *)&scanSettings.uni_scr, true, 0, 7);
+ uniqrg = new CIntInput(LOCALE_SATSETUP_UNICABLE_QRG, (long &)scanSettings.uni_qrg, 4, LOCALE_GENERIC_EMPTY, LOCALE_GENERIC_EMPTY, NULL);
+ extUnicableSettings->addItem(uniscr);
+ extUnicableSettings->addItem(new CMenuForwarder(LOCALE_SATSETUP_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg));
+ CMenuForwarder* ojExtUnicableSettings = new CMenuForwarder(LOCALE_SATSETUP_UNICABLE, (scanSettings.diseqcMode == DISEQC_UNICABLE), NULL, extUnicableSettings, NULL, CRCInput::RC_3);
+
//prepare sat list with diseqc options
- satDiseqcNotifier = new CSatDiseqcNotifier(ojSat, ojExtSatSettings, ojExtMotorSettings, ojDiseqcRepeats);
+ satDiseqcNotifier = new CSatDiseqcNotifier(ojSat, ojExtSatSettings, ojExtMotorSettings, ojDiseqcRepeats, ojExtUnicableSettings);
CMenuOptionChooser* ojDiseqc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&scanSettings.diseqcMode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, true, satDiseqcNotifier);
+
//show entries
scansetup->addItem( ojScantype );
scansetup->addItem( ojBouquets );
@@ -332,6 +347,7 @@ int CScanSetup::showScanService()
scansetup->addItem( ojExtSatSettings );
scansetup->addItem( ojExtMotorSettings );
+ scansetup->addItem( ojExtUnicableSettings );
}
else
{//cable
@@ -388,11 +404,13 @@ int CScanSetup::showScanService()
delete extSatSettings;
delete extMotorSettings;
+ delete extUnicableSettings;
delete toff_lat;
delete toff_long;
delete motorControl;
delete satDiseqcNotifier;
delete scanTs;
+ delete uniqrg;
return res;
}
@@ -580,6 +598,15 @@ bool CSatDiseqcNotifier::changeNotify(const neutrino_locale_t, void * Data)
repeatMenu->setActive(true);
}
else
+ if (*((int*) Data) == DISEQC_UNICABLE)
+ {
+ satMenu->setActive(true);
+ extMenu->setActive(false);
+ extMotorMenu->setActive(false);
+ repeatMenu->setActive(false);
+ extUnicableMenu->setActive(true);
+ }
+ else
{
satMenu->setActive(false);
extMenu->setActive(true);
diff --git a/tuxbox/neutrino/src/gui/scan_setup.h b/tuxbox/neutrino/src/gui/scan_setup.h
index 4edfe98..769a08c 100644
--- a/tuxbox/neutrino/src/gui/scan_setup.h
+++ b/tuxbox/neutrino/src/gui/scan_setup.h
@@ -63,11 +63,12 @@ class CSatDiseqcNotifier : public CChangeObserver
CMenuItem* extMenu;
CMenuItem* extMotorMenu;
CMenuItem* repeatMenu;
+ CMenuItem* extUnicableMenu;
protected:
CSatDiseqcNotifier( ) : CChangeObserver(){}; // prevent calling constructor without data we need
public:
- CSatDiseqcNotifier( CMenuItem* SatMenu, CMenuItem* ExtMenu, CMenuItem* ExtMotorMenu, CMenuItem* RepeatMenu) : CChangeObserver()
- { satMenu = SatMenu; extMenu = ExtMenu; extMotorMenu = ExtMotorMenu; repeatMenu = RepeatMenu;};
+ CSatDiseqcNotifier( CMenuItem* SatMenu, CMenuItem* ExtMenu, CMenuItem* ExtMotorMenu, CMenuItem* RepeatMenu, CMenuItem* ExtUnicableMenu) : CChangeObserver()
+ { satMenu = SatMenu; extMenu = ExtMenu; extMotorMenu = ExtMotorMenu; repeatMenu = RepeatMenu; extUnicableMenu = ExtUnicableMenu; };
bool changeNotify(const neutrino_locale_t, void * Data);
};
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index 4834f39..0d18ed5 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -8,7 +8,7 @@
Homepage: http://dbox.cyberphoria.org/
Copyright (C) 2008 Novell, Inc. Author: Stefan Seyfried
- Copyright (C) 2007, 2008, 2009 Stefan Seyfried
+ Copyright (C) 2007-2010, 2013 Stefan Seyfried
Kommentar:
@@ -4056,6 +4056,8 @@ int CNeutrinoApp::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
CNeutrinoApp::getInstance()->getScanSettings().toMotorPosList(motorPosList);
g_Zapit->setScanMotorPosList(motorPosList);
}
+ /* set unicable, is only used if diseqcMode == DISEQC_UNICABLE */
+ g_Zapit->setUnicableParam(scanSettings.uni_scr, scanSettings.uni_qrg);
// Houdini set DiseqcType/Repeat so you don't have to reboot for changes to take effect
/* send diseqc type to zapit */
g_Zapit->setDiseqcType(CNeutrinoApp::getInstance()->getScanSettings().diseqcMode);
diff --git a/tuxbox/neutrino/src/system/locals.h b/tuxbox/neutrino/src/system/locals.h
index 54886d8..41c2ece 100644
--- a/tuxbox/neutrino/src/system/locals.h
+++ b/tuxbox/neutrino/src/system/locals.h
@@ -2,7 +2,7 @@
#define __locals__
/*
- * $Id: locals.h,v 1.205 2012/11/03 07:04:00 rhabarber1848 Exp $
+ * $Id$
*
* (C) 2004 by thegoodguy <the...@be...>
*
@@ -1281,6 +1281,10 @@ typedef enum
LOCALE_SATSETUP_SAVESETTINGSNOW,
LOCALE_SATSETUP_SMATVREMOTE,
LOCALE_SATSETUP_SOUTH,
+ LOCALE_SATSETUP_UNICABLE,
+ LOCALE_SATSETUP_UNICABLE_QRG,
+ LOCALE_SATSETUP_UNICABLE_SCR,
+ LOCALE_SATSETUP_UNICABLE_SETTINGS,
LOCALE_SATSETUP_USEGOTOXX,
LOCALE_SATSETUP_WEST,
LOCALE_SCANTP_FEC,
diff --git a/tuxbox/neutrino/src/system/locals_intern.h b/tuxbox/neutrino/src/system/locals_intern.h
index 13c7be6..52bbdb4 100644
--- a/tuxbox/neutrino/src/system/locals_intern.h
+++ b/tuxbox/neutrino/src/system/locals_intern.h
@@ -2,7 +2,7 @@
#define __locals_intern__
/*
- * $Id: locals_intern.h,v 1.205 2012/11/03 07:04:00 rhabarber1848 Exp $
+ * $Id$
*
* (C) 2004 by thegoodguy <the...@be...>
*
@@ -1281,6 +1281,10 @@ const char * locale_real_names[] =
"satsetup.savesettingsnow",
"satsetup.smatvremote",
"satsetup.south",
+ "satsetup.unicable",
+ "satsetup.unicable_qrg",
+ "satsetup.unicable_scr",
+ "satsetup.unicable_settings",
"satsetup.usegotoxx",
"satsetup.west",
"scantp.fec",
diff --git a/tuxbox/neutrino/src/system/settings.cpp b/tuxbox/neutrino/src/system/settings.cpp
index 0599bb6..3bca8c6 100644
--- a/tuxbox/neutrino/src/system/settings.cpp
+++ b/tuxbox/neutrino/src/system/settings.cpp
@@ -4,6 +4,9 @@
Neutrino-GUI - DBoxII-Project
+ (C) 2002-2012 tuxbox developers
+ (C) 2008-2009, 2013 Stefan Seyfried
+
License: GPL
This program is free software; you can redistribute it and/or modify
@@ -129,7 +132,7 @@ void CScanSettings::toSatList( CZapitClient::ScanSatelliteList& satList) const
satList.push_back(sat);
}
}
- else if (diseqcMode == NO_DISEQC)
+ else if (diseqcMode == NO_DISEQC || diseqcMode == DISEQC_UNICABLE)
{
strncpy(sat.satName, satNameNoDiseqc, 30);
sat.diseqc = 0;
@@ -187,6 +190,8 @@ void CScanSettings::useDefaults(const delivery_system_t _delivery_system)
scanType = CZapitClient::ST_ALL;
diseqcMode = NO_DISEQC;
diseqcRepeat = 0;
+ uni_qrg = 1210;
+ uni_scr = 0;
motorRotationSpeed = 8;
useGotoXX = 0;
@@ -234,6 +239,8 @@ bool CScanSettings::loadSettings(const char * const fileName, const delivery_sys
diseqcMode = (diseqc_t) configfile.getInt32("diseqcMode" , diseqcMode);
diseqcRepeat = configfile.getInt32("diseqcRepeat", diseqcRepeat);
+ uni_qrg = configfile.getInt32("uni_qrg", uni_qrg);
+ uni_scr = configfile.getInt32("uni_scr", uni_scr);
bouquetMode = (CZapitClient::bouquetMode) configfile.getInt32("bouquetMode" , bouquetMode);
scanType=(CZapitClient::scanType) configfile.getInt32("scanType", scanType);
strcpy(satNameNoDiseqc, configfile.getString("satNameNoDiseqc", satNameNoDiseqc).c_str());
@@ -294,6 +301,8 @@ bool CScanSettings::saveSettings(const char * const fileName)
configfile.setInt32( "delivery_system", delivery_system);
configfile.setInt32( "diseqcMode", diseqcMode );
+ configfile.setInt32( "uni_scr", uni_scr );
+ configfile.setInt32( "uni_qrg", uni_qrg );
configfile.setInt32( "diseqcRepeat", diseqcRepeat );
configfile.setInt32( "bouquetMode", bouquetMode );
configfile.setInt32( "scanType", scanType );
diff --git a/tuxbox/neutrino/src/system/settings.h b/tuxbox/neutrino/src/system/settings.h
index ede6d26..b504adc 100644
--- a/tuxbox/neutrino/src/system/settings.h
+++ b/tuxbox/neutrino/src/system/settings.h
@@ -598,6 +598,8 @@ class CScanSettings
t_satellite_position satPosition[MAX_SATELLITES];
char satName[MAX_SATELLITES][30];
delivery_system_t delivery_system;
+ int uni_qrg;
+ int uni_scr;
int scanSectionsd;
commit a547e4575600baa79f0f14cf4b3505e33f3eafba
Author: Stefan Seyfried <se...@tu...>
Date: Thu Mar 7 11:32:20 2013 +0100
pzapit: add option to set unicable parameters
diff --git a/dvb/zapit/src/pzapit.cpp b/dvb/zapit/src/pzapit.cpp
index 52b8522..84a0a47 100644
--- a/dvb/zapit/src/pzapit.cpp
+++ b/dvb/zapit/src/pzapit.cpp
@@ -4,6 +4,7 @@
* simple commandline client for zapit
*
* Copyright (C) 2002 by Andreas Oberritter <ob...@tu...>
+ * Copyright (C) 2007-2010,2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -68,6 +69,7 @@ int usage (const char * basename)
<< "\t--pal\t\t\tswitch to PAL mode" << std::endl
<< "\t-m <cmdtype> <addr> <cmd> <number or params> <param1> <param2>" << std::endl
<< "\t\t\t\tsend DiSEqC 1.2 motor command" << std::endl
+ << "\t-u <scr> <freq>\t\tset unicable parameters" << std::endl
#ifdef HAVE_DBOX_HARDWARE
<< " those require the aviaEXT driver:" << std::endl
<< "\t--iecon\t\t\tactivate IEC" << std::endl
@@ -154,6 +156,8 @@ int main (int argc, char** argv)
uint8_t motorParam2 = 0;
uint8_t motorAddr = 0;
uint32_t diseqc[5];
+ int uni_scr = -1;
+ int uni_qrg = -1;
unsigned int tmp;
/* command line */
@@ -340,6 +344,12 @@ int main (int argc, char** argv)
mute = 0;
continue;
}
+ else if (!strcmp(argv[i], "-u") && i < argc - 2)
+ {
+ uni_scr = atoi(argv[++i]);
+ uni_qrg = atoi(argv[++i]);
+ continue;
+ }
#ifdef HAVE_DBOX_HARDWARE
else if (!strncmp(argv[i], "--iecon", 7))
{
@@ -466,6 +476,13 @@ int main (int argc, char** argv)
return 0;
}
+ if (uni_scr != -1)
+ {
+ zapit.setUnicableParam(uni_scr, uni_qrg);
+ if (diseqcType == -1)
+ return 0;
+ }
+
if (enterStandby)
{
zapit.setStandby(true);
commit bbeb938f65eaf7fa8112d352663055cab0fe701e
Author: Stefan Seyfried <se...@tu...>
Date: Thu Mar 7 11:32:20 2013 +0100
zapit: add unicable support
diff --git a/dvb/zapit/include/zapit/client/msgtypes.h b/dvb/zapit/include/zapit/client/msgtypes.h
index 9d55318..755b321 100644
--- a/dvb/zapit/include/zapit/client/msgtypes.h
+++ b/dvb/zapit/include/zapit/client/msgtypes.h
@@ -158,6 +158,8 @@ class CZapitMessages
CMD_SET_UNCOMMITTED_SWITCH_MODE = 96,
CMD_GET_UNCOMMITTED_SWITCH_MODE = 97,
CMD_LOADSCANSETTINGS = 98,
+ CMD_SET_UNICABLE_OPTS = 99,
+ CMD_GET_UNICABLE_OPTS = 100,
#ifdef HAVE_TRIPLEDRAGON
CMD_SET_ZOOMLEVEL = 120,
@@ -381,6 +383,12 @@ class CZapitMessages
unsigned int channel;
};
+ struct unicableParam
+ {
+ int scr;
+ int qrg;
+ };
+
#ifdef HAVE_TRIPLEDRAGON
struct commandPig
{
diff --git a/dvb/zapit/include/zapit/client/zapitclient.h b/dvb/zapit/include/zapit/client/zapitclient.h
index 22c5acd..733e604 100644
--- a/dvb/zapit/include/zapit/client/zapitclient.h
+++ b/dvb/zapit/include/zapit/client/zapitclient.h
@@ -414,6 +414,10 @@ class CZapitClient:public CBasicClient
/* set diseqcRepeat*/
void setDiseqcRepeat(const uint32_t repeat);
+ /* set the unicable tuning parameters */
+ void setUnicableParam(const int scr, const int qrg);
+ void getUnicableParam(int &scr, int &qrg);
+
/* set diseqcRepeat*/
void setScanBouquetMode(const bouquetMode mode);
diff --git a/dvb/zapit/include/zapit/client/zapittypes.h b/dvb/zapit/include/zapit/client/zapittypes.h
index bc054a0..5edc0e2 100644
--- a/dvb/zapit/include/zapit/client/zapittypes.h
+++ b/dvb/zapit/include/zapit/client/zapittypes.h
@@ -110,13 +110,11 @@ typedef enum {
SMATV_REMOTE_TUNING,
DISEQC_1_0,
DISEQC_1_1,
- DISEQC_1_2
-#if HAVE_DVB_API_VERSION >= 3 && ! defined(HAVE_TRIPLEDRAGON)
- ,
+ DISEQC_1_2,
DISEQC_2_0,
DISEQC_2_1,
- DISEQC_2_2
-#endif
+ DISEQC_2_2,
+ DISEQC_UNICABLE
} diseqc_t;
/* dvb transmission types */
diff --git a/dvb/zapit/include/zapit/frontend.h b/dvb/zapit/include/zapit/frontend.h
index 4b47b5a..aea1a06 100644
--- a/dvb/zapit/include/zapit/frontend.h
+++ b/dvb/zapit/include/zapit/frontend.h
@@ -49,6 +49,9 @@ class CFrontend
int32_t lnbOffsetsLow[MAX_LNBS];
/* high lnb offsets */
int32_t lnbOffsetsHigh[MAX_LNBS];
+ /* unicable frequency and SCR# */
+ int uni_qrg;
+ int uni_scr;
/* current Transponderdata */
TP_params currentTransponder;
#ifndef HAVE_TRIPLEDRAGON
@@ -79,6 +82,7 @@ class CFrontend
void sendDiseqcPowerOn(void);
void sendDiseqcReset(void);
void sendDiseqcSmatvRemoteTuningCommand(const uint32_t frequency);
+ uint32_t TuneUnicable(const uint32_t frequency, const int high_band, const int horizontal, const int bank);
void sendDiseqcStandby(void);
void sendDiseqcZeroByteCommand(const uint8_t frm, const uint8_t addr, const uint8_t cmd);
void sendToneBurst(const fe_sec_mini_cmd_t burst, const uint32_t ms);
@@ -96,6 +100,8 @@ class CFrontend
uint8_t getDiseqcPosition(void) const { return currentTransponder.diseqc; }
uint8_t getDiseqcRepeats(void) const { return diseqcRepeats; }
diseqc_t getDiseqcType(void) const { return diseqcType; }
+ int getUnicableSCR(void) const { return uni_scr; }
+ int getUnicableQRG(void) const { return uni_qrg; }
uint32_t getFrequency(void) const;
void setUncommittedSwitchMode(const int mode);
int getUncommittedSwitchMode(void) const;
@@ -123,6 +129,7 @@ class CFrontend
void setDiseqcRepeats(const uint8_t repeats) { diseqcRepeats = repeats; }
void setDiseqcType(const diseqc_t type);
+ void setUnicable(const int scr, const int qrg) { uni_scr = scr; uni_qrg = qrg; };
void setLnbOffset(const bool high, const uint8_t index, const int offset);
int setParameters(TP_params *TP);
int setParameters(dvb_frontend_parameters *feparams, const uint8_t polarization = VERTICAL, const uint8_t diseqc = 0);
diff --git a/dvb/zapit/lib/zapitclient.cpp b/dvb/zapit/lib/zapitclient.cpp
index 8609e04..8591887 100644
--- a/dvb/zapit/lib/zapitclient.cpp
+++ b/dvb/zapit/lib/zapitclient.cpp
@@ -5,7 +5,7 @@
*
* (C) 2002 by thegoodguy <the...@be...> & the DBoxII-Project
*
- * (C) 2007, 2008, 2009 Stefan Seyfried
+ * (C) 2007-2010, 2013 Stefan Seyfried
*
* License: GPL
*
@@ -763,6 +763,25 @@ void CZapitClient::setDiseqcRepeat(const uint32_t repeat)
close_connection();
}
+void CZapitClient::setUnicableParam(const int scr, const int qrg)
+{
+ CZapitMessages::unicableParam p;
+ p.scr = scr;
+ p.qrg = qrg;
+ send(CZapitMessages::CMD_SET_UNICABLE_OPTS, (const char *) &p, sizeof(p));
+ close_connection();
+}
+
+void CZapitClient::getUnicableParam(int &scr, int &qrg)
+{
+ CZapitMessages::unicableParam p;
+ send(CZapitMessages::CMD_GET_UNICABLE_OPTS);
+ CBasicClient::receive_data((char *) &p, sizeof(p));
+ scr = p.scr;
+ qrg = p.qrg;
+ close_connection();
+}
+
/* set diseqcRepeat*/
void CZapitClient::setScanBouquetMode(const bouquetMode mode)
{
diff --git a/dvb/zapit/src/zapit.cpp b/dvb/zapit/src/zapit.cpp
index f4bc2a1..1be2bea 100644
--- a/dvb/zapit/src/zapit.cpp
+++ b/dvb/zapit/src/zapit.cpp
@@ -5,6 +5,7 @@
*
* (C) 2001, 2002 by Philipp Leusmann <fa...@be...>
* (C) 2002, 2003 by Andreas Oberritter <ob...@tu...>
+ * (C) 2007-2010, 2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -729,6 +730,8 @@ void saveSettings(bool write)
config.setInt32("diseqcRepeats", frontend->getDiseqcRepeats());
config.setInt32("diseqcType", frontend->getDiseqcType());
config.setInt32("uncommitted_switch_mode", frontend->getUncommittedSwitchMode());
+ config.setInt32("uni_qrg", frontend->getUnicableQRG());
+ config.setInt32("uni_scr", frontend->getUnicableSCR());
break;
default:
@@ -2450,6 +2453,23 @@ bool parse_command(CBasicMessage::Header &rmsg, int connfd)
break;
}
+ case CZapitMessages::CMD_SET_UNICABLE_OPTS:
+ {
+ CZapitMessages::unicableParam p;
+ CBasicServer::receive_data(connfd, &p, sizeof(p));
+ frontend->setUnicable(p.scr, p.qrg);
+ break;
+ }
+
+ case CZapitMessages::CMD_GET_UNICABLE_OPTS:
+ {
+ CZapitMessages::unicableParam p;
+ p.scr = frontend->getUnicableSCR();
+ p.qrg = frontend->getUnicableQRG();
+ CBasicServer::send_data(connfd, &p, sizeof(p));
+ break;
+ }
+
#ifdef HAVE_DBOX_HARDWARE
case CZapitMessages::CMD_SET_AE_IEC_ON:
{
@@ -3045,6 +3065,9 @@ void leaveStandby(void)
frontend->setDiseqcRepeats(config.getInt32("diseqcRepeats", 0));
//motorRotationSpeed = scanconfig.getInt32("motorRotationSpeed", 8); // default: 0.8 degrees per second
diseqcType = (diseqc_t)config.getInt32("diseqcType", NO_DISEQC);
+ int uni_scr = config.getInt32("uni_scr", 0);
+ int uni_qrg = config.getInt32("uni_qrg", 0);
+ frontend->setUnicable(uni_scr, uni_qrg);
frontend->setDiseqcType(diseqcType);
for (unsigned int i = 0; i < MAX_LNBS; i++) {
diff --git a/dvb/zapit/src/zapost/frontend.cpp b/dvb/zapit/src/zapost/frontend.cpp
index 05665e1..3433b13 100644
--- a/dvb/zapit/src/zapost/frontend.cpp
+++ b/dvb/zapit/src/zapost/frontend.cpp
@@ -2,6 +2,7 @@
* $Id: frontend.cpp,v 1.72 2012/03/04 08:24:09 rhabarber1848 Exp $
*
* (C) 2002-2003 Andreas Oberritter <ob...@tu...>
+ * (C) 2007-2009, 2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -323,13 +324,16 @@ void CFrontend::setFrontend(const dvb_frontend_parameters *feparams)
if (fd == -1)
return;
- errno = 0;
-
- while ((errno == 0) || (errno == EOVERFLOW))
- quiet_fop(ioctl, FE_GET_EVENT, &event);
-#if HAVE_DVB_API_VERSION < 3
+ /* 'const *' is passed in, but we might need to modify it... */
dvb_frontend_parameters feparams2;
memcpy(&feparams2, feparams, sizeof(dvb_frontend_parameters));
+
+ if (diseqcType == DISEQC_UNICABLE)
+ feparams2.frequency = TuneUnicable(feparams->frequency,
+ currentToneMode == SEC_TONE_ON,
+ currentTransponder.polarization == SEC_VOLTAGE_18,
+ /*!!currentTransponder.diseqc*/ 0); // TODO: mini-a/b switch
+#if HAVE_DVB_API_VERSION < 3
/* the dreambox cable driver likes to get the frequency in kHz */
if (info.type == FE_QAM) {
feparams2.Frequency /= 1000;
@@ -342,10 +346,12 @@ void CFrontend::setFrontend(const dvb_frontend_parameters *feparams)
if (info.type == FE_QAM)
feparams2.u.qam.FEC_inner = FEC_AUTO;
}
- fop(ioctl, FE_SET_FRONTEND, &feparams2);
-#else
- fop(ioctl, FE_SET_FRONTEND, feparams);
#endif
+ errno = 0;
+ while ((errno == 0) || (errno == EOVERFLOW))
+ quiet_fop(ioctl, FE_GET_EVENT, &event);
+
+ fop(ioctl, FE_SET_FRONTEND, &feparams2);
}
#define TIME_STEP 200
@@ -503,7 +509,10 @@ void CFrontend::secSetTone(const fe_sec_tone_mode_t toneMode, const uint32_t ms)
{
TIMER_START();
- if (fop_sec(ioctl, FE_SET_TONE, toneMode) == 0) {
+ if (diseqcType == DISEQC_UNICABLE) {
+ currentToneMode = toneMode;
+ fop_sec(ioctl, FE_SET_TONE, SEC_TONE_OFF); /* just to make sure... */
+ } else if (fop_sec(ioctl, FE_SET_TONE, toneMode) == 0) {
currentToneMode = toneMode;
usleep(1000 * ms);
}
@@ -515,7 +524,10 @@ void CFrontend::secSetVoltage(const fe_sec_voltage_t voltage, const uint32_t ms)
{
TIMER_START();
- if (fop_sec(ioctl, FE_SET_VOLTAGE, voltage) == 0) {
+ if (diseqcType == DISEQC_UNICABLE) {
+ currentTransponder.polarization = voltage;
+ fop_sec(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); /* voltage must not be 18V */
+ } else if (fop_sec(ioctl, FE_SET_VOLTAGE, voltage) == 0) {
currentTransponder.polarization = voltage;
usleep(1000 * ms);
}
@@ -546,8 +558,13 @@ void CFrontend::sendDiseqcCommand(const struct dvb_diseqc_master_cmd *cmd, const
secCommand command;
sequence.miniCommand = SEC_MINI_NONE;
- sequence.continuousTone = currentToneMode;
- sequence.voltage = currentTransponder.polarization;
+ if (diseqcType == DISEQC_UNICABLE) {
+ sequence.continuousTone = SEC_TONE_OFF;
+ sequence.voltage = SEC_VOLTAGE_18;
+ } else {
+ sequence.continuousTone = currentToneMode;
+ sequence.voltage = currentTransponder.polarization;
+ }
command.type = SEC_CMDTYPE_DISEQC_RAW;
command.u.diseqc.cmdtype = cmd->msg[0];
command.u.diseqc.addr = cmd->msg[1];
@@ -641,7 +658,6 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType)
case DISEQC_1_2:
INFO("DISEQC_1_2");
break;
-#if HAVE_DVB_API_VERSION >= 3
case DISEQC_2_0:
INFO("DISEQC_2_0");
break;
@@ -651,7 +667,9 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType)
case DISEQC_2_2:
INFO("DISEQC_2_2");
break;
-#endif
+ case DISEQC_UNICABLE:
+ INFO("DISEQC_UNICABLE");
+ break;
default:
WARN("Invalid DiSEqC type");
return;
@@ -921,6 +939,9 @@ void CFrontend::setSec(const uint8_t sat_no, const uint8_t pol, const bool high_
secSetTone(SEC_TONE_OFF, 1); // this resets currentToneMode!
secSetVoltage(v, 30);
+ if (diseqcType == DISEQC_UNICABLE)
+ goto out; /* shortcut */
+
if ((diseqcType == DISEQC_1_1) && (uncommitted_switch_mode > 0))
{
static uint8_t prevSatNo = 255; // initialised with greater than max Satellites (64)
@@ -989,6 +1010,7 @@ void CFrontend::setSec(const uint8_t sat_no, const uint8_t pol, const bool high_
if (diseqcType == SMATV_REMOTE_TUNING)
sendDiseqcSmatvRemoteTuningCommand(frequency);
+ out:
currentToneMode = t;
if (diseqcType == MINI_DISEQC)
sendToneBurst(b, 15);
@@ -1046,6 +1068,33 @@ void CFrontend::sendDiseqcSmatvRemoteTuningCommand(const uint32_t frequency)
sendDiseqcCommand(&cmd, 15);
}
+uint32_t CFrontend::TuneUnicable(const uint32_t frequency, const int high_band,
+ const int horizontal, const int bank)
+{
+ struct dvb_diseqc_master_cmd cmd = { { 0xe0, 0x10, 0x5a, 0x00, 0x00, 0x00 }, 5 };
+ unsigned int t = (frequency / 1000 + uni_qrg + 2) / 4 - 350;
+ if (t >= 1024 || uni_scr < 0 || uni_scr > 7 || info.type != FE_QPSK)
+ {
+ WARN("ooops. t > 1024? (%d) or uni_scr out of range? (%d)", t, uni_scr);
+ return 0;
+ }
+
+ uint32_t ret = (t + 350) * 4000 - frequency;
+ INFO("[unicable] 18V=%d TONE=%d, freq=%d qrg=%d scr=%d bank=%d ret=%d",
+ horizontal, high_band, frequency, uni_qrg, uni_scr, bank, ret);
+ cmd.msg[3] = (t >> 8) | /* highest 3 bits of t */
+ (uni_scr << 5) | /* adress */
+ (bank << 4) | /* input 0/1 */
+ (horizontal << 3) | /* horizontal == 0x08 */
+ (high_band) << 2; /* high_band == 0x04 */
+ cmd.msg[4] = t & 0xFF;
+ fop_sec(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_18);
+ usleep(15 * 1000); /* en50494 says: >4ms and < 22 ms */
+ sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */
+ fop_sec(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13);
+ return ret;
+}
+
void CFrontend::sendUncommittedSwitchesCommand(uint8_t usCommand)
{
struct dvb_diseqc_master_cmd cmd = {{ 0xe0, 0x10, 0x39, 0x00, 0x00, 0x00 }, 4};
-----------------------------------------------------------------------
Summary of changes:
dvb/zapit/include/zapit/client/msgtypes.h | 8 +++
dvb/zapit/include/zapit/client/zapitclient.h | 4 +
dvb/zapit/include/zapit/client/zapittypes.h | 8 +--
dvb/zapit/include/zapit/frontend.h | 7 ++
dvb/za...
[truncated message content] |