Skip to content

Commit

Permalink
update new (#26)
Browse files Browse the repository at this point in the history
-modified to terminate if the option is empty
-Transmission mode case statement 4K/8K string literals switched
-add FE_CAN_2G_MODULATION in DVB-T2 support
  • Loading branch information
Dima73 committed May 14, 2023
1 parent e8b3d5e commit 7c6a6b2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions config.cpp
Expand Up @@ -443,8 +443,8 @@ std::string satipConfig::getTuningData()
switch (m_transmode)
{
case TRANSMISSION_MODE_2K: oss_data << "&tmode=2k"; break;
case TRANSMISSION_MODE_8K: oss_data << "&tmode=4k"; break;
case TRANSMISSION_MODE_4K: oss_data << "&tmode=8k"; break;
case TRANSMISSION_MODE_8K: oss_data << "&tmode=8k"; break;
case TRANSMISSION_MODE_4K: oss_data << "&tmode=4k"; break;
case TRANSMISSION_MODE_1K: oss_data << "&tmode=1k"; break;
case TRANSMISSION_MODE_16K: oss_data << "&tmode=16k"; break;
case TRANSMISSION_MODE_32K: oss_data << "&tmode=32k"; break;
Expand Down
6 changes: 4 additions & 2 deletions main.cpp
Expand Up @@ -115,10 +115,12 @@ int main(int argc, char** argv)

signal(SIGINT, sigint_handler);
signal(SIGTERM, sigint_handler);
signal(SIGKILL, sigint_handler);

sessionManager* vtmng = sessionManager::getInstance();
vtmng->satipStart();
pause();
int res = vtmng->satipStart();
if (!res)
pause();

DEBUG(MSG_MAIN,"End MAIN\n");

Expand Down
21 changes: 11 additions & 10 deletions manager.cpp
Expand Up @@ -45,21 +45,22 @@ sessionManager::~sessionManager()
}
}

void sessionManager::satipStart()
int sessionManager::satipStart()
{
if (!m_satip_opt.isEmpty())
{
std::map<int, vtunerOpt> *data = m_satip_opt.getData();
if (m_satip_opt.isEmpty())
return -1;

for (std::map<int, vtunerOpt>::iterator it(data->begin()); it!=data->end(); it++)
std::map<int, vtunerOpt> *data = m_satip_opt.getData();
for (std::map<int, vtunerOpt>::iterator it(data->begin()); it!=data->end(); it++)
{
if (it->second.isAvailable())
{
if (it->second.isAvailable())
{
DEBUG(MSG_MAIN, "try connect : [%d] type : %s, ip : %s, fe_type : %d\n", it->first, it->second.m_vtuner_type.c_str(), it->second.m_ipaddr.c_str(), it->second.m_fe_type);
satipSessionCreate(it->second.m_ipaddr.c_str(), it->second.m_fe_type, it->second.m_port.c_str(), &(it->second));
}
DEBUG(MSG_MAIN, "try connect : [%d] type : %s, ip : %s, fe_type : %d\n", it->first, it->second.m_vtuner_type.c_str(), it->second.m_ipaddr.c_str(), it->second.m_fe_type);
satipSessionCreate(it->second.m_ipaddr.c_str(), it->second.m_fe_type, it->second.m_port.c_str(), &(it->second));
}
}

return 0;
}

int sessionManager::satipSessionCreate(const char* ipaddr, int fe_type, const char *port, vtunerOpt* settings)
Expand Down
2 changes: 1 addition & 1 deletion manager.h
Expand Up @@ -43,7 +43,7 @@ class sessionManager
sessionManager();
virtual ~sessionManager();

void satipStart();
int satipStart();
void sessionStart();
void sessionJoin();
void sessionStop();
Expand Down
2 changes: 1 addition & 1 deletion vtuner.cpp
Expand Up @@ -187,7 +187,7 @@ int satipVtuner::openVtuner()
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QPSK |
FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO |
FE_CAN_HIERARCHY_AUTO | FE_CAN_RECOVER);
FE_CAN_HIERARCHY_AUTO | FE_CAN_RECOVER | FE_CAN_2G_MODULATION);
break;

default:
Expand Down

0 comments on commit 7c6a6b2

Please sign in to comment.