/* atmtest1.c */ /* This program reads one register from the "control region" */ /* (local address base 0x04000000) of the APE 25 */ #include #include #include "atmuser.h" int iobuf[1024]; void main( int argc, char **argv) { int fd; int regid; int count = 1; int i; int rc; fd = open("/dev/ape25", O_RDWR); if (fd < 0) { printf("Device /dev/ape25 could not be opened. \n"); exit(1); } if (argc < 2) { printf("This program initiates a transmission... \n"); printf("You must give vci number in decimal as parm 1. \n"); printf("You may give repetition number in decimal as parm 2\n"); exit(1); } sscanf(argv[1], "%d", iobuf + 0); /* Id of reg to read */ if (argc > 2) sscanf(argv[2], "%d", &count); for (i = 0; i < count; i++) { rc = ioctl(fd, AIO_SEND, iobuf); if (rc) { printf("Send returned %d \n", rc); break; } } }