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>
54 static unsigned char vpParallelPortData;
71 device =
"/dev/parport0";
75 unsigned char data = 0;
96 void vpParallelPort::open()
98 fd = ::open(device.c_str(), O_WRONLY);
100 printf(
"Can't open /dev/parport0\n");
101 printf(
"Check if you have write access to /dev/parport0\n");
102 perror(
"Open parallel port");
109 i = PARPORT_MODE_COMPAT;
110 ioctl(fd, PPSETMODE, &i);
111 i = IEEE1284_MODE_COMPAT;
112 ioctl(fd, PPNEGOT, &i);
131 ioctl(fd, PPWDATA, &data);
134 vpParallelPortData = data;
151 void vpParallelPort::close()
153 ioctl(fd, PPRELEASE);
159 printf(
"Can't close the parallel port\n");
164 #elif !defined(VISP_BUILD_SHARED_LIBS)
166 void dummy_vpParallelPort() { };
Error that can be emitted by the vpParallelPort class and its derivates.
virtual ~vpParallelPort()
void sendData(unsigned char &data)