108 if (--fh->
used <= 0) {
153 fi->SetStatus(
false);
174 pollfd pfd[NumFilters];
177 pfd[i].fd = fh->handle;
178 pfd[i].events = POLLIN;
184 if (poll(pfd, NumFilters, 1000) > 0) {
188 for (
int i = 0; i < NumFilters; i++) {
189 if (pfd[i].revents & POLLIN) {
195 if (pfd[i].fd == fh->
handle)
200 unsigned char buf[4096];
205 int len = (((buf[1] & 0x0F) << 8) | (buf[2] & 0xFF)) + 3;
211 if (fi->Matches(pid, tid))
212 fi->Process(pid, tid, buf, len);
216 dsyslog(
"read incomplete section - len = %d, r = %d", len, r);
void SetDescription(const char *Description,...) __attribute__((format(printf
cList< cFilterHandle > filterHandles
void Add(cListObject *Object, cListObject *After=NULL)
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask)
Opens a file handle for the given filter data.
const cChannel * Channel(void)
virtual int ReadFilter(int Handle, void *Buffer, size_t Length)
Reads data from a handle for the given filter.
virtual ~cSectionHandler()
void Detach(cFilter *Filter)
void Add(const cFilterData *FilterData)
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
void SetChannel(const cChannel *Channel)
T * Next(const T *object) const
cSectionHandler(cDevice *Device)
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
virtual bool HasLock(int TimeoutMs=0) const
Returns true if the device has a lock on the requested transponder.
static void SleepMs(int TimeoutMs)
Creates a cCondWait object and uses it to sleep for TimeoutMs milliseconds, immediately giving up the...
void bool Start(void)
Sets the description of this thread, which will be used when logging starting or stopping of the thre...
cSectionHandler * sectionHandler
bool Running(void)
Returns false if a derived cThread object shall leave its Action() function.
bool Is(u_short Pid, u_char Tid, u_char Mask)
virtual void CloseFilter(int Handle)
Closes a file handle that has previously been opened by OpenFilter().
int CardIndex(void) const
Returns the card index of this device (0 ... MAXDEVICES - 1).
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
void Del(cListObject *Object, bool DeleteObject=true)
time_t lastIncompleteSection
cSectionHandlerPrivate * shp
void Attach(cFilter *Filter)
cFilterHandle(const cFilterData &FilterData)
void Cancel(int WaitSeconds=0)
Cancels the thread by first setting 'running' to false, so that the Action() loop can finish in an or...
The cDevice class is the base from which actual devices can be derived.
void Del(const cFilterData *FilterData)