* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Open things:
- * - TODO: collision dectection
- * when a en50494-command wasn't executed succesful, retry.
- * delay time is easly random, but in standard is special (complicated) way described (cap. 8).
+ * - TODO: collision detection
+ * * compare transport-stream-id from stream with id in config
+ * * check continuity of the pcr-counter
+ * * when one point is given -> retry
+ * * delay time is easily random, but in standard is special (complicated) way described (cap. 8).
*/
#include "tvheadend.h"
#define LINUXDVB_EN50494_NOPIN 256
#define LINUXDVB_EN50494_FRAME 0xE0
-/* adresses 0x00, 0x10 and 0x11 are possible */
+/* addresses 0x00, 0x10 and 0x11 are possible */
#define LINUXDVB_EN50494_ADDRESS 0x10
#define LINUXDVB_EN50494_CMD_NORMAL 0x5A
linuxdvb_en50494_t *le = (linuxdvb_en50494_t*) ld;
linuxdvb_lnb_t *lnb = sc->lse_lnb;
- /* band & polarisation */
+ /* band & polarization */
uint8_t pol = lnb->lnb_pol(lnb, lm);
uint8_t band = lnb->lnb_band(lnb, lm);
uint32_t freq = lnb->lnb_freq(lnb, lm);
/* 2 data fields (16bit) */
uint8_t data1, data2;
data1 = (le->le_id & 7) << 5; /* 3bit user-band */
- data1 |= (le->le_position & 1) << 4; /* 1bit position (satelitte A(0)/B(1)) */
- data1 |= (pol & 1) << 3; /* 1bit polarisation v(0)/h(1) */
+ data1 |= (le->le_position & 1) << 4; /* 1bit position (satellite A(0)/B(1)) */
+ data1 |= (pol & 1) << 3; /* 1bit polarization v(0)/h(1) */
data1 |= (band & 1) << 2; /* 1bit band lower(0)/upper(1) */
data1 |= (t >> 8) & 3; /* 2bit transponder value bit 1-2 */
data2 = t & 0xFF; /* 8bit transponder value bit 3-10 */
// TODO: really need to understand whether or not we need to pre configure
// and/or re-affirm the switch
- /* Disable tone */
- if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, SEC_TONE_OFF)) {
- tvherror("diseqc", "failed to disable tone");
- return -1;
+ /* Disable tone (en50494 don't use tone) */
+ if (!lse->lse_en50494) {
+ if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, SEC_TONE_OFF)) {
+ tvherror("diseqc", "failed to disable tone");
+ return -1;
+ }
}
/* Diseqc */
&lse->lse_parent->ls_orbital_pos,
&lse->lse_parent->ls_orbital_dir);
- /* Set the tone */
- b = lse->lse_lnb->lnb_band(lse->lse_lnb, lm);
- tvhtrace("disqec", "set diseqc tone %s", b ? "on" : "off");
- if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, b ? SEC_TONE_ON : SEC_TONE_OFF)) {
- tvherror("diseqc", "failed to set diseqc tone (e=%s)", strerror(errno));
- return -1;
+ /* Set the tone (en50494 don't use tone) */
+ if (!lse->lse_en50494) {
+ b = lse->lse_lnb->lnb_band(lse->lse_lnb, lm);
+ tvhtrace("disqec", "set diseqc tone %s", b ? "on" : "off");
+ if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, b ? SEC_TONE_ON : SEC_TONE_OFF)) {
+ tvherror("diseqc", "failed to set diseqc tone (e=%s)", strerror(errno));
+ return -1;
+ }
+ usleep(20000); // Allow LNB to settle before tuning
}
- usleep(20000); // Allow LNB to settle before tuning
/* Frontend */
/* use en50494 tuning frequency, if needed (not channel frequency) */
// Note: basically this ensures the tuning params are acceptable
// for the FE, so that if they're not we don't have to wait
// for things like rotors and switches
+ // the en50494 have to skip this test
if (!lse->lse_lnb)
return SM_CODE_TUNING_FAILED;
f = lse->lse_lnb->lnb_freq(lse->lse_lnb, lm);
if (f == (uint32_t)-1)
return SM_CODE_TUNING_FAILED;
- r = linuxdvb_frontend_tune0(lfe, mmi, f);
- if (r) return r;
+ if (!lse->lse_en50494) {
+ r = linuxdvb_frontend_tune0(lfe, mmi, f);
+ if (r) return r;
+ }
/* Diseqc */
ls->ls_mmi = mmi;