39 #include <visp3/core/vpConfig.h> 41 #ifdef VISP_HAVE_PARPORT 44 #include <sys/ioctl.h> 46 #include <sys/types.h> 49 #include <visp3/io/vpParallelPort.h> 56 static unsigned char vpParallelPortData;
73 sprintf(device,
"/dev/parport0");
77 unsigned char data = 0;
98 void vpParallelPort::open()
100 fd = ::open(
"/dev/parport0", O_WRONLY);
102 printf(
"Can't open /dev/parport0\n");
103 printf(
"Check if you have write access to /dev/parport0\n");
104 perror(
"Open parallel port");
111 i = PARPORT_MODE_COMPAT;
112 ioctl(fd, PPSETMODE, &i);
113 i = IEEE1284_MODE_COMPAT;
114 ioctl(fd, PPNEGOT, &i);
136 ioctl(fd, PPWDATA, &data);
139 vpParallelPortData = data;
156 void vpParallelPort::close()
158 ioctl(fd, PPRELEASE);
164 printf(
"Can't close the parallel port\n");
169 #elif !defined(VISP_BUILD_SHARED_LIBS) 172 void dummy_vpParallelPort(){};
void sendData(unsigned char &data)
Error that can be emited by the vpParallelPort class and its derivates.