eDVBLocalTimeHandler::getInstance()->updateTime(error, chan, ++update_count);
}
-int TDT::createTable(int nr, const __u8 *data, unsigned int max)
+int TDT::createTable(unsigned int nr, const __u8 *data, unsigned int max)
{
if ( data && data[0] == 0x70 || data[0] == 0x73 )
{
if ( length >= 5 )
{
time_t tptime = parseDVBtime(data[3], data[4], data[5], data[6], data[7]);
- eDVBLocalTimeHandler::getInstance()->updateTime(tptime, chan, update_count);
+ if (tptime && tptime != -1)
+ eDVBLocalTimeHandler::getInstance()->updateTime(tptime, chan, update_count);
error=0;
return 1;
}
if (!res_mgr)
eDebug("[eDVBLocalTimerHandler] no resource manager !!!!!!!");
else
+ {
res_mgr->connectChannelAdded(slot(*this,&eDVBLocalTimeHandler::DVBChannelAdded), m_chanAddedConn);
+ time_t now = time(0);
+ if ( now < 1072224000 ) // 01.01.2004
+ eDebug("RTC not ready... wait for transponder time");
+ else // inform all who's waiting for valid system time..
+ {
+ eDebug("Use valid Linux Time :) (RTC?)");
+ m_time_ready = true;
+ /*emit*/ m_timeUpdated();
+ }
+ }
}
eDVBLocalTimeHandler::~eDVBLocalTimeHandler()
instance=0;
for (std::map<iDVBChannel*, channel_data>::iterator it=m_knownChannels.begin(); it != m_knownChannels.end(); ++it)
delete it->second.tdt;
+ if (ready())
+ {
+ eDebug("set RTC to previous valid time");
+ setRTC(nowTime());
+ }
}
void eDVBLocalTimeHandler::readTimeOffsetData( const char* filename )
now.tm_min,
now.tm_sec);
m_time_difference = rtc_time - linuxTime;
- eDebug("[eDVBLocalTimerHandler] RTC to Receiver time difference is %d seconds", nowTime - rtc_time );
+ eDebug("[eDVBLocalTimerHandler] RTC to Receiver time difference is %ld seconds", nowTime - rtc_time );
if ( abs(m_time_difference) > 59 )
{
eDebug("[eDVBLocalTimerHandler] set Linux Time to RTC Time");
time_t rtc=getRTC();
m_timeOffsetMap[chan->getChannelID()] = rtc-tp_time;
new_diff = rtc-nowTime; // set enigma time to rtc
- eDebug("[eDVBLocalTimerHandler] update stored correction to %d (calced against RTC time)", rtc-tp_time );
+ eDebug("[eDVBLocalTimerHandler] update stored correction to %ld (calced against RTC time)", rtc-tp_time );
}
else if ( abs(ddiff) <= 120 )
{