Logo Search packages:      
Sourcecode: scanbuttond version File versions  Download package

int scanbtnd_close ( scanner_t *  scanner  ) 

Closes the given scanner device. This function must be called when you've finished querying the scanner button status using scanbtnd_get_button(). After calling this function, other processes may access the device again.

scanner the scanner device to be closed
0 if successful, <0 otherwise
Return values:
-EINVAL if the device is already closed
-ENOSYS if there is no connection method to communicate with the device

Definition at line 207 of file epson.c.

      int result = -ENOSYS;
      if (!scanner->is_open)
            return -EINVAL;
      switch (scanner->connection) {
            case CONNECTION_LIBUSB:
                  result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
      if (result == 0)
            scanner->is_open = 0;
      return result;

Generated by  Doxygen 1.6.0   Back to index