Re: femon cleanup/SVDRP enhancement

Message ID 20060618195657.GA5046@MAIL.13thfloor.at
State New
Headers

Commit Message

Herbert Poetzl June 18, 2006, 7:56 p.m. UTC
  On Sun, Jun 18, 2006 at 01:01:36AM +0200, Herbert Poetzl wrote:
> 
> Hi Rolf! Folks!
> 
> the first patch moves most of the value-to-string
> conversions from femonosd.c to femontools.c and 
> declares them properly in the femontools.h file.
> the osd part is updated to utilize them.
> 
> the second patch extends the SVDRP interface of
> femon by a basic INFO command (which can easily 
> be extended in the future), giving output like
> this:
> 
> PLUG femon INFO
> 900- Frequency:   11158 Mhz    Source:       S13.0E
> 900- Srate:       27500        Polarization: V
> 900- Inversion:   Auto         Coderate: Auto, Auto
> 900- Vpid:   369  Ppid:   369  Tpid:     0
> 900- Sid:  13108  Nid:      0  Tid:      0  Rid:     0
> 900- Apid:   370
> 900- Dpid:     0
> 900  CA:    1801
> 
> would be nice to get some feedback
> 
> TIA,
> Herbert
> 
> [patch zapped]

here is a small but important fix to the previous
patches, which showed up while testing channels
with more than one *pid

best,
Herbert
  

Patch

--- femon-1.0.1.2/femontools.c	2006-06-18 21:49:57.000000000 +0200
+++ femon-1.0.1.3/femontools.c	2006-06-18 21:36:31.000000000 +0200
@@ -41,19 +41,16 @@  cString getFrontendInfo(int cardIndex)
   int freq = channel->Frequency();
   while (freq > 20000) freq /= 1000;
 
-  cString apid_str = cString::sprintf("%5d", channel->Apid(0));
-  value = 1;
-  while (channel->Apid(value) && (value < MAXAPIDS))
+  cString apid_str = cString::sprintf("%5d", channel->Apid(value=0));
+  while (channel->Apid(++value) && (value < MAXAPIDS))
     apid_str = cString::sprintf("%s, %d", *apid_str, channel->Apid(value));
 
-  cString dpid_str = cString::sprintf("%5d", channel->Dpid(0));
-  value = 1;
-  while (channel->Dpid(value) && (value < MAXDPIDS))
+  cString dpid_str = cString::sprintf("%5d", channel->Dpid(value=0));
+  while (channel->Dpid(++value) && (value < MAXDPIDS))
     dpid_str = cString::sprintf("%s, %d", *dpid_str, channel->Dpid(value));
 
-  cString ca_str = cString::sprintf(" %04x", channel->Ca(0));
-  value = 1;
-  while (channel->Ca(value) && (value < MAXCAIDS))
+  cString ca_str = cString::sprintf(" %04x", channel->Ca(value=0));
+  while (channel->Ca(++value) && (value < MAXCAIDS))
     ca_str = cString::sprintf("%s, %04x", *ca_str, channel->Ca(value));
   
   return cString::sprintf(