#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include "../driver/bttv.h"

int fbttv;
char *bttvname="/dev/video";
unsigned char tvee[256];

main()
{
  int i;
  
  if ((fbttv=open(bttvname,O_RDWR)) < 0) {
    printf("Cannot open %s\n", bttvname);
    exit(1);
  }
  ioctl(fbttv, BTTV_READEE, tvee);

  /* On my card only the first 40 bytes are interesting */
  printf ("unsigned char tvee[256] = {");
  for (i=0; i<256; i++) {
    if (!(i&7))
      printf ("\n");
    printf ("0x%02x, ", tvee[i]);
  }
  printf ("\n};\n");
}


