Fix linux build caused by pull request #58
This commit is contained in:
parent
b30bf6ac30
commit
c325b5e80a
|
@ -43,7 +43,11 @@ static device_t fet_open_rf2500(const struct device_args *args)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
trans = rf2500hidapi_open(args->path, args->requested_serial);
|
||||||
|
#else
|
||||||
trans = rf2500_open(args->path, args->requested_serial);
|
trans = rf2500_open(args->path, args->requested_serial);
|
||||||
|
#endif
|
||||||
if (!trans)
|
if (!trans)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,7 @@ static const struct transport_class rf2500_transport = {
|
||||||
.set_modem = usbtr_set_modem
|
.set_modem = usbtr_set_modem
|
||||||
};
|
};
|
||||||
|
|
||||||
transport_t rf2500_libusb_open(const char *devpath, const char *requested_serial)
|
transport_t rf2500_open(const char *devpath, const char *requested_serial)
|
||||||
{
|
{
|
||||||
struct rf2500_transport *tr = malloc(sizeof(*tr));
|
struct rf2500_transport *tr = malloc(sizeof(*tr));
|
||||||
struct usb_device *dev;
|
struct usb_device *dev;
|
||||||
|
|
|
@ -28,6 +28,6 @@
|
||||||
* A particular device may be specified in bus:dev form.
|
* A particular device may be specified in bus:dev form.
|
||||||
*/
|
*/
|
||||||
transport_t rf2500_open(const char *dev_path, const char *requested_serial);
|
transport_t rf2500_open(const char *dev_path, const char *requested_serial);
|
||||||
transport_t rf2500_libusb_open(const char *dev_path, const char *requested_serial);
|
transport_t rf2500hidapi_open(const char *dev_path, const char *requested_serial);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -161,7 +161,7 @@ static const wchar_t * get_wc(const char *c)
|
||||||
return wc;
|
return wc;
|
||||||
}
|
}
|
||||||
|
|
||||||
transport_t rf2500_open(const char *devpath, const char *requested_serial)
|
transport_t rf2500hidapi_open(const char *devpath, const char *requested_serial)
|
||||||
{
|
{
|
||||||
struct rf2500_transport *tr = malloc(sizeof(*tr));
|
struct rf2500_transport *tr = malloc(sizeof(*tr));
|
||||||
hid_device *handle;
|
hid_device *handle;
|
||||||
|
@ -197,7 +197,7 @@ transport_t rf2500_open(const char *devpath, const char *requested_serial)
|
||||||
free(tr);
|
free(tr);
|
||||||
hid_exit();
|
hid_exit();
|
||||||
printc_err("rf2500: fallback to libusb backend\n");
|
printc_err("rf2500: fallback to libusb backend\n");
|
||||||
return rf2500_libusb_open(devpath, requested_serial);
|
return rf2500_open(devpath, requested_serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
tr->handle = handle;
|
tr->handle = handle;
|
||||||
|
|
Loading…
Reference in New Issue