aboutsummaryrefslogtreecommitdiffstats
path: root/dvb-t/uk-Chatton
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2013-08-07 00:18:13 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2013-08-07 00:18:13 +0100
commitd01de06fc92ddf51e2b3085ed00d2999a9e2055d (patch)
tree17d0da6d8b0eae51c07b7de18b395e61b515a6c4 /dvb-t/uk-Chatton
parent62407a091735b201caebf7005ccc80da1540f459 (diff)
downloaddtv-scan-tables-d01de06fc92ddf51e2b3085ed00d2999a9e2055d.tar.gz
Imported Upstream version 0+git20130622.edc0bc3upstream/0+git20130622.edc0bc3
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
ight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Test switching the 22kHz tone signal on and off on a SAT frontend.
 * (Note: DiSEqC equipment ignores this after it has once seen a diseqc
 *  sequence; reload the driver or unplug/replug the SAT cable to reset.)
 *
 * usage: FRONTEND=/dev/dvb/adapterX/frontendX set22k {on|off}
 */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include <linux/dvb/frontend.h>


int main (int argc, char **argv)
{
   char *fedev = "/dev/dvb/adapter0/frontend0";
   int fd, r;

   if (argc != 2 || (strcmp(argv[1], "on") && strcmp(argv[1], "off"))) {
      fprintf (stderr, "usage: %s <on|off>\n", argv[0]);
      return 1;
   }
   if (getenv("FRONTEND"))
	   fedev = getenv("FRONTEND");
   printf("set22k: using '%s'\n", fedev);

   if ((fd = open (fedev, O_RDWR)) < 0) {
      perror ("open");
      return 1;
   }

   if (strcmp(argv[1], "on") == 0)
      r = ioctl (fd, FE_SET_TONE, SEC_TONE_ON);
   else
      r = ioctl (fd, FE_SET_TONE, SEC_TONE_OFF);
   if (r == -1)
	   perror("ioctl FE_SET_TONE");

   close (fd);

   return 0;
}