[PATCH 09/10] Connect up serial_ftdi custom serial

Anton Lundin glance at acc.umu.se
Thu Aug 20 15:27:44 PDT 2015


On 21 August, 2015 - Anton Lundin wrote:

> diff --git a/libdivecomputer.c b/libdivecomputer.c
> index 64e76e3..bbabb1c 100644
> --- a/libdivecomputer.c
> +++ b/libdivecomputer.c
> @@ -925,10 +925,17 @@ const char *do_libdivecomputer_import(device_data_t *data)
>  	err = translate("gettextFromC", "Unable to open %s %s (%s)");
>  
>  #if defined(SSRF_CUSTOM_SERIAL)
> -	if (data->bluetooth_mode) {
> -		dc_serial_t *serial_device;
> +	dc_serial_t *serial_device = NULL;
>  
> +	if (data->bluetooth_mode) {
>  		rc = dc_serial_qt_open(&serial_device, data->context, data->devname);
> +#ifdef SERIAL_FTDI
> +	} else if (!strcmp(data->devname, "ftdi")) {
> +		rc = dc_serial_ftdi_open(&serial_device, data->context);
> +#endif
> +	}

Also a bit ugly, but hey, we can figure out how to do this when we got a
ui that might make sense.

For now this is good enough to test it.

This way you can test libftdi based communication on a desktop too.


//Anton


-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list