Re: [vdr] check cam status [writing plugin help needed]

2010-09-05 Thread Klaus Schmidinger
On 09/01/10 22:20, Simon Baxter wrote:
>>> I'd like to write a plugin which can provide the displayed Setup>CAM
>>> status via an SVDRP command, and maybe check the CAM menu can be
>>> accessed.
> 
> Had no response on this - guess we have no plugin writers with time on
> their hands to help?
> 
> Can I use these functions in ci.h?
> 
>  virtual bool Reset(int Slot) = 0;
>   ///< Resets the CAM in the given Slot.
>   ///< Returns true if the operation was successful.
>  virtual eModuleStatus ModuleStatus(int Slot) = 0;
>   ///< Returns the status of the CAM in the given Slot.
> 
> I just need a very simple svdrp plugin that will 1) check the status of
> a CAM in a given slot via an svdrp command   and 2) reset that cam via
> another svdrp command
> 
> What core vdr files do I need to include?  How do I reference or call
> functions within those core files?

Just include  and do things like in cMenuSetupCAM.

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] check cam status [writing plugin help needed]

2010-09-01 Thread Simon Baxter
I'd like to write a plugin which can provide the displayed Setup>CAM 
status via an SVDRP command, and maybe check the CAM menu can be 
accessed.


Had no response on this - guess we have no plugin writers with time on their 
hands to help?


Can I use these functions in ci.h?

 virtual bool Reset(int Slot) = 0;
  ///< Resets the CAM in the given Slot.
  ///< Returns true if the operation was successful.
 virtual eModuleStatus ModuleStatus(int Slot) = 0;
  ///< Returns the status of the CAM in the given Slot.

I just need a very simple svdrp plugin that will 1) check the status of a 
CAM in a given slot via an svdrp command   and 2) reset that cam via another 
svdrp command


What core vdr files do I need to include?  How do I reference or call 
functions within those core files?





___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] check cam status [writing plugin help needed]

2010-08-17 Thread Simon Baxter
I'd like to write a plugin which can provide the displayed Setup>CAM 
status via an SVDRP command, and maybe check the CAM menu can be accessed.


As a beginner to such things, can someone help?


I basically want to implement bits of menu.c (the CAM status and menu 
accessing parts) via SVDRP.

Can someone please help?


If I pull some of the following from menu.c I think this should give me 
what I want:


Get list of availablecams:
void cMenuCam::GenerateTitle(const char *s)
{
 SetTitle(cString::sprintf("CAM %d - %s", camSlot->SlotNumber(), (s && *s) 
? s : camSlot->GetCamName()));

}

Get the CAM status (being Ready, Present, -, or "Alphacrypt" etc:
bool cMenuSetupCAMItem::Changed(void)
{
 char buffer[32];
 const char *CamName = camSlot->GetCamName();
 if (!CamName) {
switch (camSlot->ModuleStatus()) {
  case msReset:   CamName = tr("CAM reset"); break;
  case msPresent: CamName = tr("CAM present"); break;
  case msReady:   CamName = tr("CAM ready"); break;
  default:CamName = "-"; break;
  }
}
 snprintf(buffer, sizeof(buffer), " %d %s", camSlot->SlotNumber(), 
CamName);

 if (strcmp(buffer, Text()) != 0) {
SetText(buffer);
return true;
}
 return false;
}



___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] check cam status [writing plugin help needed]

2010-08-06 Thread Simon Baxter
Ideally, I'd like a way to "ask vdr" the status of the CAM from a script. 
I know this is available on the OSD by going into the "SETUP > CAM" menu 
where the CAM is displayed as "CAM Ready", "CAM Present" or "Alhpacrypt" 
but I need to do this outside the OSD.


Anyone have any ideas how to do this?


I'd like to write a plugin which can provide the displayed Setup>CAM status 
via an SVDRP command, and maybe check the CAM menu can be accessed.


As a beginner to such things, can someone help?

I want to use svdrpdemo as the starting point.  What else do I need to 
include in this?

#include "menu.h"
#include "svdrpservice.h" (from femon plugin)
??

If I pull some of the following from menu.c I think this should give me what 
I want:


Get list of availablecams:
void cMenuCam::GenerateTitle(const char *s)
{
 SetTitle(cString::sprintf("CAM %d - %s", camSlot->SlotNumber(), (s && *s) 
? s : camSlot->GetCamName()));

}

Get the CAM status (being Ready, Present, -, or "Alphacrypt" etc:
bool cMenuSetupCAMItem::Changed(void)
{
 char buffer[32];
 const char *CamName = camSlot->GetCamName();
 if (!CamName) {
switch (camSlot->ModuleStatus()) {
  case msReset:   CamName = tr("CAM reset"); break;
  case msPresent: CamName = tr("CAM present"); break;
  case msReady:   CamName = tr("CAM ready"); break;
  default:CamName = "-"; break;
  }
}
 snprintf(buffer, sizeof(buffer), " %d %s", camSlot->SlotNumber(), 
CamName);

 if (strcmp(buffer, Text()) != 0) {
SetText(buffer);
return true;
}
 return false;
}


Can anyone help me on this? 



___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr