#include #include #include #include #include #define TUNER #include #include #define SIZE256 main(int ac, char **av) { intx; chars[ SIZE ]; inttuner; struct eePromeeProm; u_char*p; into; intc; if ( ac != 3 ) exit( 1 ); o = eeProm.offset = atoi( av[ 1 ] ); c = eeProm.count = atoi( av[ 2 ] ); if ((tuner = open( "/dev/tuner0", O_RDONLY)) < 0 ) exit( 1 ); if ( ioctl(tuner, BT848_REEPROM, &eeProm) < 0 ) exit( 1 ); printf( "\nEEProm contents, 0x%02x thru 0x%02x:\n", eeProm.offset, (eeProm.offset + eeProm.count) - 1 ); for ( p = &eeProm.bytes[ 0 ], x = 0; x < c; ++x ) { if ( !(x & 0xf) ) printf( "\n" ); printf( " %02x", p[ x ] ); } printf( "\n\n" ); exit( 0 ); }