this looks suspiciously easy

Dirk Hohndel dirk at hohndel.org
Wed Apr 18 23:37:53 PDT 2018


On Thu, Apr 19, 2018 at 08:13:23AM +0200, Jef Driesen wrote:
> 
> You can also get the mask with the built-in transports from libdivecomputer
> with the dc_context_get_transports() function. With the above, you'll for
> example show usb or usbhid devices even when libdivecomputer was build
> without usb or usbhid support.
> 
> For transports where subsurface uses a custom I/O implementation (bluetooth
> and ble), you of course need to set the bits as above.

Cool - that's even better.
Of course I first wondered... darn, where do I get the context from in
this part of my code. Then I looked at the sources of libdivecomputer...

unsigned int
dc_context_get_transports (dc_context_t *context)
{
        UNUSED(context);

        return DC_TRANSPORT_SERIAL
#if defined(HAVE_LIBUSB)
                | DC_TRANSPORT_USB
#endif
...

OK, I guess I'll just pass in a NULL pointer :-)

/D


More information about the subsurface mailing list