How to access the Sleep Timer from a Script

TAPs für die SRP- und CRP-Serie
Antworten
keith_leitch
Erfahrener Benutzer
Erfahrener Benutzer
Beiträge: 141
Registriert: Mo 29. Apr 2013, 06:05

How to access the Sleep Timer from a Script

#1

Beitrag von keith_leitch »

I am not sure which forum is best to post this question.

I am looking for a way to read the value of the Sleep timer: Disabled, 10 min, 1 min, etc.

It would be best to do this in a Shell Script, but any clues might help me.

I have tried to use DMC's Webcontrol API calls. There is no option for this.
Zuletzt geändert von keith_leitch am Sa 8. Jul 2017, 01:53, insgesamt 1-mal geändert.
Benutzeravatar
FireBird
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Beiträge: 25358
Registriert: Fr 9. Dez 2005, 09:59

AW: Übersicht SRP TAPs

#2

Beitrag von FireBird »

The FireBirdLib contains the function

Code: Alles auswählen

FlashTimeGetInfo(tFlashTimeInfo *TimeInfo)
and the struct TimeInfo contains the field

Code: Alles auswählen

word SleepTimer
The following TAP Code would write the current sleep time to a Telnet console whenever it changes.

Code: Alles auswählen

tFlashTimeInfo  TimeInfo;
static word     LastSleepTimer;

FlashTimeGetInfo(&TimeInfo);
if(TimeInfo.SleepTimer != LastSleepTimer)
{
  TAP_PrintNet("SleepTimer = %d\n", TimeInfo.SleepTimer);
  LastSleepTimer = TimeInfo.SleepTimer;
}
keith_leitch
Erfahrener Benutzer
Erfahrener Benutzer
Beiträge: 141
Registriert: Mo 29. Apr 2013, 06:05

AW: Übersicht SRP TAPs

#3

Beitrag von keith_leitch »

Great information; thanks for your reply. Does it need to be TAP code, or is there a C interpreter I could use to include the library and run it from a script?
Benutzeravatar
FireBird
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Beiträge: 25358
Registriert: Fr 9. Dez 2005, 09:59

AW: Übersicht SRP TAPs

#4

Beitrag von FireBird »

The library is accessing specific RAM locations and to be able to do that, the code has to run within the pvr process. In other words, it has to be a TAP. But there are many ways to communicate that information to the outside world. That TAP could for example monitor the sleep timer and write the result to a file whenever the sleep time changes. This way, a simple script would have access to the current sleep timer timeout. Of course there are other ways.

And I think that I'll move these posts to a separate thread.
keith_leitch
Erfahrener Benutzer
Erfahrener Benutzer
Beiträge: 141
Registriert: Mo 29. Apr 2013, 06:05

AW: How to access the Sleep Timer from a Script

#5

Beitrag von keith_leitch »

Makes sense; thanks for the education.
keith_leitch
Erfahrener Benutzer
Erfahrener Benutzer
Beiträge: 141
Registriert: Mo 29. Apr 2013, 06:05

AW: How to access the Sleep Timer from a Script

#6

Beitrag von keith_leitch »

DMC has added the property to Webcontrol's status get API, so that is a good outcome.
Benutzeravatar
FireBird
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Beiträge: 25358
Registriert: Fr 9. Dez 2005, 09:59

AW: How to access the Sleep Timer from a Script

#7

Beitrag von FireBird »

Great! :)
Antworten

Zurück zu „SRP/CRP TAP-Bereich“