[sane-devel] Error in HP LaserJet M1005 Backend

m. allan noah kitno455 at gmail.com
Tue Jan 29 17:13:24 UTC 2008


Yes- the standard says that the backend should not assume that
sane_get_devices will be called before sane_open. a better fix might
be to check for this condition, could you try this instead?

SANE_Status
sane_open (SANE_String_Const name, SANE_Handle * h)
{
  struct device_s *dev;
  int ret;

  if(!devlist_head)
    sane_get_devices(NULL,(SANE_Bool)0);

  dev = devlist_head;

  if (strlen (name))
...

if this works, and meets with the AUTHOR's approval, i will put this
in SANE CVS before release...

allan

On Jan 27, 2008 9:44 PM, tropos <tropos at rambler.ru> wrote:
>
> Hello
>
> Commands:
> scanimage -d hpljm1005:libusb:1:5 ....
> or
> scanimage -d net:host:hpljm1005:libusb:1:5 ....
>
> return error:
>  "...open... invalid argument"
>
> Help such dirty workarround:
>
> hpljm1005.c on current sane CVS:
>
> SANE_Status
> sane_init (SANE_Int * version_code,
>            SANE_Auth_Callback __sane_unused__ authorize)
> {
>   SANE_Bool local_only; #by tropos
>
>   if (version_code != NULL)
>     *version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, BUILD);
>
>   DBG_INIT();
>
>   sanei_usb_init ();
>
>   DBG(1,"in sane_init\n");
>
>   sane_get_devices(NULL,local_only); #by tropos
>
>   return SANE_STATUS_GOOD;
> }
>
> Regards, tropos
> --
> View this message in context: http://www.nabble.com/Error-in-HP-LaserJet-M1005-Backend-tp15127315p15127315.html
> Sent from the SANE - Dev mailing list archive at Nabble.com.
>
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>              to sane-devel-request at lists.alioth.debian.org
>



-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list