Make usb_set_configuration() optional upon backend choice, disable it for FUNcude dongle

The call to usb_set_configuration() looks troublesome for the setup
for the FUNcube dongle on Win32 target. In fact it appears not to be
necessary (TBC). Make that call optional per backend choice.
(cherry picked from commit 7b73db7c1f)
Hamlib-1.2.13.1
Stephane Fillod 2011-04-11 23:24:44 +02:00 zatwierdzone przez Nate Bargmann
rodzic e3e6465974
commit 7135574965
3 zmienionych plików z 9 dodań i 8 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
/*
* Hamlib KIT backend - FUNcube Dongle USB tuner description
* Copyright (c) 2009-2010 by Stephane Fillod
* Copyright (c) 2009-2011 by Stephane Fillod
*
* Derived from usbsoftrock-0.5:
* Copyright (C) 2009 Andrew Nilsson (andrew.nilsson@gmail.com)
@ -69,7 +69,7 @@ int set_freq_v1(usb_dev_handle *udh, unsigned int f, int timeout);
*/
struct funcube_priv_data {
int freq; /* Hz */
freq_t freq; /* Hz */
};
/*
@ -84,7 +84,7 @@ const struct rig_caps funcube_caps = {
.rig_model = RIG_MODEL_FUNCUBEDONGLE,
.model_name = "FUNcube Dongle",
.mfg_name = "AMSAT-UK",
.version = "0.1",
.version = "0.2",
.copyright = "GPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TUNER,

Wyświetl plik

@ -1,6 +1,6 @@
/*
* Hamlib KIT backend - FUNcube Dongle USB tuner description
* Copyright (c) 2009-2010 by Stephane Fillod
* Copyright (c) 2009-2011 by Stephane Fillod
*
* Derived from usbsoftrock-0.5:
* Copyright (C) 2009 Andrew Nilsson (andrew.nilsson@gmail.com)
@ -31,7 +31,7 @@
#define PRODUCT_NAME "FunCube Dongle"
#define FUNCUBE_INTERFACE 0x02
#define FUNCUBE_CONFIGURATION 0x00
#define FUNCUBE_CONFIGURATION -1 /* no setup */
#define FUNCUBE_ALTERNATIVE_SETTING 0x00
#define INPUT_ENDPOINT 0x82

Wyświetl plik

@ -1,6 +1,6 @@
/*
* Hamlib Interface - USB communication low-level support
* Copyright (c) 2000-2010 by Stephane Fillod
* Copyright (c) 2000-2011 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or modify
@ -230,7 +230,8 @@ int usb_port_open(hamlib_port_t *port)
if (port->parm.usb.iface >= 0) {
#ifdef _WIN32
if (usb_set_configuration (udh, port->parm.usb.conf) < 0){
if (port->parm.usb.conf >= 0 &&
usb_set_configuration (udh, port->parm.usb.conf) < 0){
rig_debug(RIG_DEBUG_ERR, "%s: usb_set_configuration: failed conf %d: %s\n",
__func__,port->parm.usb.conf, usb_strerror());
usb_close (udh);
@ -293,4 +294,4 @@ int usb_port_close(hamlib_port_t *port)
#endif /* defined(HAVE_LIBUSB) && defined(HAVE_USB_H) */
/** @} */
/** @} */