Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Feb 2002 22:35:50 -0500
From:      Randall Hopper <aa8vb@nc.rr.com>
To:        multimedia@freebsd.org
Subject:   Re: Msg for "Teardrop Sky" (Fwd: Re: fxtv remote (shell) controller)
Message-ID:  <20020215223550.A3589@nc.rr.com>
In-Reply-To: <20020215223427.A3488@nc.rr.com>; from aa8vb@nc.rr.com on Fri, Feb 15, 2002 at 10:34:27PM -0500
References:  <20020215223427.A3488@nc.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Randall Hopper:
 |     Hopefully he monitors this list (he mailed me for fxtv help with what
 |seems to be a bogus e-mail address...)
...
 |Randall Hopper:
 |> Compile the attached program (cc -o setchannel setchannel.c) and then just
 |> provide a channel number on the command line (e.g. setchannel 40).

Darn.  Deleted the attachment before mailing.  Here it is.

Randall

-- 
Randall Hopper
aa8vb@nc.rr.com

--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="setchannel.c"

#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <machine/ioctl_bt848.h>

/****************************************************************************/
/*  setchannel.c  -  Set the channel of the bktr tuner card.                */
/*                                                                          */
/*  COMPILE WITH:  cc -o setchannel setchannel.c                            */
/****************************************************************************/

int main( int argc, char *argv[] )
{
  int  tfd;
  long channel;

  if ( argc != 2 ) {
    fprintf( stderr, "Must specify channel number on command line\n" );
    exit(1);
  }
  
  channel = atoi( argv[1] );

  tfd = open( "/dev/tuner0", O_RDONLY );
  if ( tfd < 0 ) {
    perror( "open() of /dev/tuner0 failed." );
    exit(1);
  }

  if ( ioctl( tfd, TVTUNER_SETCHNL, &channel ) < 0 ) {
    perror( "ioctl( tfd, TVTUNER_SETCHNL ) failed." );
    return;
  }

  close( tfd );
}

--d6Gm4EdcadzBjdND--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020215223550.A3589>