Hello
I'm needing to reset my CAM periodically, and in order to do this I need to check it's status from outside VDR.
I've been doing the following, which is not ideal: if [ $((`tail -n $LINES /var/log/messages | grep 'vdr:' | grep 'ERROR' | grep 'CI' | wc -l`)) = 0 ] to test for: "May 22 00:49:45 freddy vdr: [9061] ERROR: can't write to CI adapter on device 1: Input/output error " messages
and then: "while [ $((`tail -n $LINES /var/log/messages | grep 'dvb_ca adapter 1: DVB CAM detected and initialised successfully' | wc -l`)) = 0 ]" to test it's recovered
Does anyone have any better suggestions???
I'm needing to reset my CAM periodically, and in order to do this I need to check it's status from outside VDR.
I've been doing the following, which is not ideal: if [ $((`tail -n $LINES /var/log/messages | grep 'vdr:' | grep 'ERROR' | grep 'CI' | wc -l`)) = 0 ] to test for: "May 22 00:49:45 freddy vdr: [9061] ERROR: can't write to CI adapter on device 1: Input/output error " messages
and then: "while [ $((`tail -n $LINES /var/log/messages | grep 'dvb_ca adapter 1: DVB CAM detected and initialised successfully' | wc -l`)) = 0 ]" to test it's recovered
Does anyone have any better suggestions???
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.
Any ideas?
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?
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?
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; }
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?
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 <vdr/ci.h> and do things like in cMenuSetupCAM.
Klaus