Switch off lamp after scan

DEVEL_2_0_BRANCH-1
Peter Kirchgessner 2001-02-04 17:36:26 +00:00
rodzic ce819d5714
commit 90cafb8935
3 zmienionych plików z 22 dodań i 14 usunięć

Wyświetl plik

@ -155,16 +155,19 @@ hp_handle_stopScan (HpHandle this)
close(this->pipefd);
this->reader_pid = 0;
if (WIFSIGNALED(info)
&& !FAILED( sanei_hp_scsi_new(&scsi, this->dev->sanedev.name) ))
if ( !FAILED( sanei_hp_scsi_new(&scsi, this->dev->sanedev.name)) )
{
if (WIFSIGNALED(info))
{
/*
sanei_hp_scl_set(scsi, SCL_CLEAR_ERRORS, 0);
sanei_hp_scl_errcheck(scsi);
*/
sanei_hp_scl_reset(scsi);
sanei_hp_scsi_destroy(scsi,0);
}
}
sanei_hp_scl_set(scsi, SCL_LAMPTEST, 0); /* Switch off lamp */
sanei_hp_scsi_destroy(scsi,0);
}
}
else
{
@ -554,20 +557,21 @@ sanei_hp_handle_read (HpHandle this, void * buf, size_t *lengthp)
status = this->bytes_left ? SANE_STATUS_IO_ERROR : SANE_STATUS_EOF;
RETURN_IF_FAIL( hp_handle_stopScan(this) );
/* Check unload after scan */
/* Switch off lamp and check unload after scan */
if (status == SANE_STATUS_EOF)
{
const HpDeviceInfo *hpinfo;
hpinfo = sanei_hp_device_info_get ( this->dev->sanedev.name );
if ( hpinfo && hpinfo->unload_after_scan )
HpScsi scsi;
if ( sanei_hp_scsi_new(&scsi, this->dev->sanedev.name) == SANE_STATUS_GOOD )
{
HpScsi scsi;
if ( sanei_hp_scsi_new(&scsi, this->dev->sanedev.name)
== SANE_STATUS_GOOD )
{
sanei_hp_scl_set(scsi, SCL_LAMPTEST, 0);
hpinfo = sanei_hp_device_info_get ( this->dev->sanedev.name );
if ( hpinfo && hpinfo->unload_after_scan )
sanei_hp_scl_set(scsi, SCL_UNLOAD, 0);
sanei_hp_scsi_destroy(scsi,0);
}
sanei_hp_scsi_destroy(scsi,0);
}
}
return status;

Wyświetl plik

@ -80,6 +80,7 @@
#define SCL_PRELOAD_ADF HP_SCL_CONTROL(10468, 'f', 'C')
#define SCL_MEDIA HP_SCL_CONTROL(10469, 'f', 'D')
#define SCL_10470 HP_SCL_CONTROL(10470, 'f', 'E')
#define SCL_LAMPTEST HP_SCL_CONTROL(10477, 'f', 'L')
#define SCL_X_EXTENT HP_SCL_CONTROL(10481, 'f', 'P')
#define SCL_Y_EXTENT HP_SCL_CONTROL(10482, 'f', 'Q')
#define SCL_START_SCAN HP_SCL_COMMAND('f', 'S')

Wyświetl plik

@ -43,9 +43,12 @@
HP Scanner Control Language (SCL).
*/
static char *hp_backend_version = "0.93";
static char *hp_backend_version = "0.94";
/* Changes:
V 0.94, 31-Dec-2000, PK (peter@kirchgessner.net)
- always switch off lamp after scan
V 0.93, 04-Dec-2000, PK (peter@kirchgessner.net)
- fix problem with ADF-support on ScanJet 6350 (and maybe others)