From 64fb73beee18ef8dcabe626b7edb57b8590605cc Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 10 Mar 2014 13:52:00 +0400 Subject: [PATCH] zapit/include/zapit/satconfig.h: add macros for cable/terrestrial positions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fd57dace0eb055f8a9bd8026c530922f062a77f3 Author: [CST] Focus Date: 2014-03-10 (Mon, 10 Mar 2014) --- src/zapit/include/zapit/satconfig.h | 3 +++ src/zapit/src/femanager.cpp | 4 ++-- src/zapit/src/getservices.cpp | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/zapit/include/zapit/satconfig.h b/src/zapit/include/zapit/satconfig.h index 5dc5c2f3f..06abb71d5 100644 --- a/src/zapit/include/zapit/satconfig.h +++ b/src/zapit/include/zapit/satconfig.h @@ -46,6 +46,9 @@ typedef enum diseqc_cmd_order { COMMITED_FIRST } 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 satellite_pair_t; typedef std::map satellite_map_t; typedef std::map::iterator sat_iterator_t; diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 9838b8ade..c1ba1cfd6 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -676,12 +676,12 @@ CFrontend * CFEManager::getScanFrontend(t_satellite_position satellitePosition) for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { CFrontend * mfe = it->second; 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; break; } } 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; break; } diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index f9bb9748d..289e2f67b 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -821,9 +821,9 @@ void CServiceManager::CopyFile(char * from, char * to) void CServiceManager::WriteSatHeader(FILE * fd, sat_config_t &config) { /* FIXME hack */ - if ((config.position & 0xF00) == 0xF00) + if (SAT_POSITION_CABLE(config.position)) config.deltype = FE_QAM; - else if ((config.position & 0xF00) == 0xE00) + else if (SAT_POSITION_TERR(config.position)) config.deltype = FE_OFDM; switch (config.deltype) {