diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-09-10 13:55:08 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-09-10 13:55:08 +0200 |
commit | 78e89efee8a54d4343183fc98a34d13f9e0ef478 (patch) | |
tree | 6b582833e0699e0e08abc97e3445d7b5a81e6746 /dvbdevice.c | |
parent | 873b14ac0c5e6ee53c61f3e08df2ce2ee7d9268f (diff) | |
download | vdr-78e89efee8a54d4343183fc98a34d13f9e0ef478.tar.gz vdr-78e89efee8a54d4343183fc98a34d13f9e0ef478.tar.bz2 |
The DiSEqC codes are now copied in the call to cDiseqc::Execute()
Diffstat (limited to 'dvbdevice.c')
-rw-r--r-- | dvbdevice.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/dvbdevice.c b/dvbdevice.c index a97f2749..4aea70e5 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 2.43 2011/08/26 12:57:34 kls Exp $ + * $Id: dvbdevice.c 2.44 2011/09/10 13:34:02 kls Exp $ */ #include "dvbdevice.h" @@ -509,30 +509,24 @@ bool cDvbTuner::SetFrontend(void) if (frontendType == SYS_DVBS || frontendType == SYS_DVBS2) { unsigned int frequency = channel.Frequency(); if (Setup.DiSEqC) { - const cDiseqc *diseqc = Diseqcs.Get(device, channel.Source(), channel.Frequency(), dtp.Polarization()); + const cDiseqc *diseqc = Diseqcs.Get(device, channel.Source(), frequency, dtp.Polarization()); if (diseqc) { if (diseqc->Commands() && (!diseqcCommands || strcmp(diseqcCommands, diseqc->Commands()) != 0)) { - cDiseqc::eDiseqcActions da; - for (const char *CurrentAction = NULL; (da = diseqc->Execute(&CurrentAction)) != cDiseqc::daNone; ) { + struct dvb_diseqc_master_cmd cmd; + const char *CurrentAction = NULL; + for (;;) { + cmd.msg_len = sizeof(cmd.msg); + cDiseqc::eDiseqcActions da = diseqc->Execute(&CurrentAction, cmd.msg, &cmd.msg_len); + if (da == cDiseqc::daNone) + break; switch (da) { - case cDiseqc::daNone: break; case cDiseqc::daToneOff: CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)); break; case cDiseqc::daToneOn: CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON)); break; case cDiseqc::daVoltage13: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); break; case cDiseqc::daVoltage18: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break; case cDiseqc::daMiniA: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break; case cDiseqc::daMiniB: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break; - case cDiseqc::daCodes: { - int n = 0; - const uchar *codes = diseqc->Codes(n); - if (codes) { - struct dvb_diseqc_master_cmd cmd; - cmd.msg_len = min(n, int(sizeof(cmd.msg))); - memcpy(cmd.msg, codes, cmd.msg_len); - CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); - } - } - break; + case cDiseqc::daCodes: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); break; default: esyslog("ERROR: unknown diseqc command %d", da); } } |