add document presence detection request to gt6816

merge-requests/1/head
Stphane Voltz 2009-11-30 06:58:42 +01:00
rodzic ed35562ea2
commit 409e1d29d2
4 zmienionych plików z 43 dodań i 4 usunięć

Wyświetl plik

@ -86,7 +86,8 @@ static GT68xx_Command_Set mustek_gt6816_command_set = {
gt68xx_generic_set_afe,
gt68xx_generic_set_exposure_time,
gt68xx_generic_get_id,
/* gt68xx_generic_move_paper */ NULL
/* gt68xx_generic_move_paper */ NULL,
/* gt6816_document_present */ NULL
};
static GT68xx_Command_Set mustek_gt6816_sheetfed_command_set = {
@ -126,7 +127,8 @@ static GT68xx_Command_Set mustek_gt6816_sheetfed_command_set = {
gt68xx_generic_set_afe,
gt68xx_generic_set_exposure_time,
gt68xx_generic_get_id,
gt68xx_generic_move_paper
gt68xx_generic_move_paper,
gt6816_document_present
};
static GT68xx_Command_Set mustek_gt6801_command_set = {
@ -167,7 +169,8 @@ static GT68xx_Command_Set mustek_gt6801_command_set = {
gt68xx_generic_set_afe,
gt68xx_generic_set_exposure_time,
gt68xx_generic_get_id,
/* gt68xx_generic_move_paper */ NULL
/* gt68xx_generic_move_paper */ NULL,
/* gt6816_document_present */ NULL
};
static GT68xx_Command_Set plustek_gt6801_command_set = {
@ -207,7 +210,8 @@ static GT68xx_Command_Set plustek_gt6801_command_set = {
gt68xx_generic_set_afe,
/* set_exposure_time */ NULL,
gt68xx_generic_get_id,
/* gt68xx_generic_move_paper */ NULL
/* gt68xx_generic_move_paper */ NULL,
/* gt6816_document_present */ NULL
};
static GT68xx_Model unknown_model = {

Wyświetl plik

@ -236,3 +236,28 @@ gt6816_stop_scan (GT68xx_Device * dev)
return gt68xx_device_small_req (dev, req, req);
}
SANE_Status
gt6816_document_present (GT68xx_Device * dev, SANE_Bool * present)
{
SANE_Status status;
GT68xx_Packet req;
memset (req, 0, sizeof (req));
req[0] = 0x59;
req[1] = 0x01;
RIE (gt68xx_device_req (dev, req, req));
if (req[0] == 0x00 && req[1] == 0x59)
{
if (req[2] == 0)
*present = SANE_FALSE;
else
*present = SANE_TRUE;
}
else
return SANE_STATUS_IO_ERROR;
return SANE_STATUS_GOOD;
}

Wyświetl plik

@ -67,4 +67,6 @@ static SANE_Status gt6816_carriage_home (GT68xx_Device * dev);
static SANE_Status gt6816_stop_scan (GT68xx_Device * dev);
static SANE_Status gt6816_document_present (GT68xx_Device * dev, SANE_Bool * present);
#endif /* not GT68XX_GT6816_H */

Wyświetl plik

@ -399,6 +399,14 @@ struct GT68xx_Command_Set
*/
SANE_Status (*move_paper) (GT68xx_Device * dev,
GT68xx_Scan_Request * request);
/** Detect if a document is inserted in the feeder
*
* @param dev Device object.
* @param present
*/
SANE_Status (*document_present) (GT68xx_Device * dev,
SANE_Bool *present);
/*@} */
};