zapit/include/zapit/satconfig.h: add macros for cable/terrestrial positions

Origin commit data
------------------
Commit: fd57dace0e
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-03-10 (Mon, 10 Mar 2014)
This commit is contained in:
[CST] Focus
2014-03-10 13:52:00 +04:00
parent 3e159995f1
commit 64fb73beee
3 changed files with 7 additions and 4 deletions

View File

@@ -46,6 +46,9 @@ typedef enum diseqc_cmd_order {
COMMITED_FIRST COMMITED_FIRST
} diseqc_cmd_order_t; } diseqc_cmd_order_t;
#define SAT_POSITION_CABLE(satellitePosition) ((satellitePosition > 0) && ((satellitePosition & 0xF00) == 0xF00))
#define SAT_POSITION_TERR(satellitePosition) ((satellitePosition > 0) && ((satellitePosition & 0xF00) == 0xE00))
typedef std::pair<t_satellite_position, sat_config_t> satellite_pair_t; typedef std::pair<t_satellite_position, sat_config_t> satellite_pair_t;
typedef std::map<t_satellite_position, sat_config_t> satellite_map_t; typedef std::map<t_satellite_position, sat_config_t> satellite_map_t;
typedef std::map<t_satellite_position, sat_config_t>::iterator sat_iterator_t; typedef std::map<t_satellite_position, sat_config_t>::iterator sat_iterator_t;

View File

@@ -676,12 +676,12 @@ CFrontend * CFEManager::getScanFrontend(t_satellite_position satellitePosition)
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
CFrontend * mfe = it->second; CFrontend * mfe = it->second;
if (mfe->isCable()) { if (mfe->isCable()) {
if ((mfe->getMode() != CFrontend::FE_MODE_UNUSED) && ((satellitePosition & 0xF00) == 0xF00)) { if ((mfe->getMode() != CFrontend::FE_MODE_UNUSED) && SAT_POSITION_CABLE(satellitePosition)) {
frontend = mfe; frontend = mfe;
break; break;
} }
} else if (mfe->isTerr()) { } else if (mfe->isTerr()) {
if ((mfe->getMode() != CFrontend::FE_MODE_UNUSED) && (satellitePosition & 0xF00) == 0xE00) { if ((mfe->getMode() != CFrontend::FE_MODE_UNUSED) && SAT_POSITION_TERR(satellitePosition)) {
frontend = mfe; frontend = mfe;
break; break;
} }

View File

@@ -821,9 +821,9 @@ void CServiceManager::CopyFile(char * from, char * to)
void CServiceManager::WriteSatHeader(FILE * fd, sat_config_t &config) void CServiceManager::WriteSatHeader(FILE * fd, sat_config_t &config)
{ {
/* FIXME hack */ /* FIXME hack */
if ((config.position & 0xF00) == 0xF00) if (SAT_POSITION_CABLE(config.position))
config.deltype = FE_QAM; config.deltype = FE_QAM;
else if ((config.position & 0xF00) == 0xE00) else if (SAT_POSITION_TERR(config.position))
config.deltype = FE_OFDM; config.deltype = FE_OFDM;
switch (config.deltype) { switch (config.deltype) {