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.

Parameters:
scannerthe scanner device to be closed
Returns:
0 if successful, <0 otherwise
Return values:
-EINVALif the device is already closed
-ENOSYSif there is no connection method to communicate with the device

Definition at line 192 of file artec_eplus48u.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);
                  break;
      }
      if (result == 0)
            scanner->is_open = 0;
      return result;
}

Generated by  Doxygen 1.6.0   Back to index