- improved scan error handling
[enigma2.git] / lib / components / scan.cpp
index 8fb60b5..ad2e4d1 100644 (file)
@@ -59,7 +59,9 @@ int eComponentScan::start()
        ePtr<eDVBResourceManager> mgr;
        
        eDVBResourceManager::getInstance(mgr);
-       
+
+       eDVBFrontendParameters *fe = new eDVBFrontendParameters();
+#if 0  
        eDVBFrontendParametersSatellite fesat;
                
        fesat.frequency = 11817000; // 12070000;
@@ -69,14 +71,28 @@ int eComponentScan::start()
        fesat.inversion = eDVBFrontendParametersSatellite::Inversion::Off;
        fesat.orbital_position = 192;
 
-       eDVBFrontendParameters *fe = new eDVBFrontendParameters();
        
        fe->setDVBS(fesat);
+#endif
+
+       eDVBFrontendParametersTerrestrial fet;
+       fet.frequency = 626000000;
+       fet.inversion = eDVBFrontendParametersTerrestrial::Inversion::Unknown;
+       fet.bandwidth = eDVBFrontendParametersTerrestrial::Bandwidth::Bw8MHz;
+       fet.code_rate_HP = fet.code_rate_LP = eDVBFrontendParametersTerrestrial::FEC::fAuto;
+       fet.modulation = eDVBFrontendParametersTerrestrial::Modulation::QAM16;
+       fet.transmission_mode = eDVBFrontendParametersTerrestrial::TransmissionMode::TM8k;
+       fet.guard_interval = eDVBFrontendParametersTerrestrial::GuardInterval::GI_1_32;
+       fet.hierarchy = eDVBFrontendParametersTerrestrial::Hierarchy::HNone;
+       fe->setDVBT(fet);
        
        ePtr<iDVBChannel> channel;
 
        if (mgr->allocateRawChannel(channel))
+       {
                eDebug("scan: allocating raw channel failed!");
+               return -1;
+       }
 
        std::list<ePtr<iDVBFrontendParameters> > list;
                
@@ -85,7 +101,7 @@ int eComponentScan::start()
        m_scan = new eDVBScan(channel);
        m_scan->connectEvent(slot(*this, &eComponentScan::scanEvent), m_scan_event_connection);
        m_scan->start(list);
-
+       
        return 0;
 }
 
@@ -113,3 +129,8 @@ int eComponentScan::isDone()
 {
        return m_done;
 }
+
+int eComponentScan::getError()
+{
+       return m_failed;
+}