#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>

/* program to test the i-bus2.x.c program by reading in a value */
/* to compile, just cc and run the a.out */

int main(int argc, char **argv)
{
  int fd;
  int arg;
  int count;

  fd = open("/dev/ibus0", O_RDWR);
  if(fd == -1) {
    fprintf(stderr, "Error: could not open /dev/ibus0 for reading.\n");
    exit(1);
  }

  do {
      read(fd,&arg,1);
      printf("number read %x \n",arg & 0xff);
//  }while (arg);
  }while (1);

  close(fd);
  return 0;
}

