Kan man kontrollere printerporten fra perl i Freebsd, eller skal man gøre
det i c?
To present the value 0x5a to the data port, drive STROBE low and then
high again, the following code fragment can be used:
int fd;
u_int8_t val;
val = 0x5a;
ioctl(fd, PPISDATA, &val);
ioctl(fd, PPIGCTRL, &val);
val |= STROBE;
ioctl(fd, PPISCTRL, &val);
val &= ~STROBE;
ioctl(fd, PPISCTRL, &val);
Måske blot
ioctl FILEHANDLE,FUNCTION,SCALAR
?
Leif
|