Quote Originally Posted by high_flyer
Well, yes and no.
The 'problem' with the parallel port is that you can (and usually want to) manipulate individual pins. not just (or nesseseraly) transmit data.
Qt Code:
  1. void ParalellPort::setPin(int pin, int value)
  2. {
  3. int oldValue = getChar(pin);
  4. if (value != 0) {
  5. putChar(oldValue | 1 << pin);
  6. } else {
  7. putChar(oldValue & (~ (1 << pin)) );
  8. }
  9. }
  10.  
  11. int ParalellPort::getPin(int pin)
  12. {
  13. return (getChar() & (1 << pin)) ? 1 ? 0;
  14. }
To copy to clipboard, switch view to plain text mode