discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Internal error message from usrp_prims.cc


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Internal error message from usrp_prims.cc
Date: Mon, 14 Jul 2008 08:23:48 -0700
User-agent: Mutt/1.5.17 (2007-11-01)

On Sat, Jul 12, 2008 at 09:36:27AM -0400, Philip Balister wrote:
> Well, hacking the hack so the code compiles still gets me the internal
> error message. Does anyone understand what this code is trying to do?
> Can I just remove these tests? I'm trying to get the usrp code running
> with the development version of libusb.
> 
> static struct usb_dev_handle *
> usrp_open_interface (struct usb_device *dev, int interface, int altinterface)
> {
>   struct usb_dev_handle *udh = usb_open (dev);
>   if (udh == 0)
>     return 0;
> 
>   if (dev != dev_handle_to_dev (udh)){
>     fprintf (stderr, "%s:%d: internal error!\n", __FILE__, __LINE__);
>     abort ();
>   }
> 
> Philip

Hi Philip,

This code is checking (in a rather primitive way) if the structure is
laid out in the way that we think it's laid out in.  At least last
time I looked (> 1 yr ago), libusb didn't install usbi.h (or something
like that).  We need a way to retrieve the device handle give a
device.  It's stored in the opaque usb_dev_handle.  Thus the kludge to
retrieve it.  We also assume, some place else in the code, that the
file descriptor is stored in the first word of some opaque structure.

These kludges could be cleaned up if libusb either exported accessors
to fetch the values or installed usbi.h

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]