mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 18:40:31 +00:00
get check for fixed USB vendor/product ID to work
This commit is contained in:
parent
65a2040d8d
commit
ca6fe75681
@ -15,8 +15,8 @@ AC_ARG_ENABLE(springboard, [AS_HELP_STRING([--disable-springboard],[Disable disp
|
||||
AC_ARG_ENABLE(launchd, [AS_HELP_STRING([--enable-launchd],[Compiles BTdaemon for use by launchd])], USE_LAUNCHD=$enableval, USE_LAUNCHD="no")
|
||||
AC_ARG_WITH(prefsbundle, [AS_HELP_STRING([--with-prefsbundle],[Compiles iPhone Preferences Bundle])], USE_PREFSBUNDLE=$enableval, USE_PREFSBUNDLE="no")
|
||||
AC_ARG_WITH(iphone-ip, [AS_HELP_STRING([--with-iphone-ip=192.168.1.5], [Specify IP address used by iPhone for installation (not supported yet)])], IPHONE_IP=$withval, IPHONE_IP="")
|
||||
AC_ARG_WITH(vendor-id, [AS_HELP_STRING([--with-vendor-id=vendorID], [Specify USB BT Dongle vendorID])], USB_VENDOR_ID=$withval, USB_VENDOR_ID="")
|
||||
AC_ARG_WITH(product-id, [AS_HELP_STRING([--with-product-id=productID], [Specify USB BT Dongle productID])], USB_PRODUCT_ID=$withval, USB_PRODUCT_ID="")
|
||||
AC_ARG_WITH(vendor-id, [AS_HELP_STRING([--with-vendor-id=vendorID], [Specify USB BT Dongle vendorID])], USB_VENDOR_ID=$withval, USB_VENDOR_ID="0")
|
||||
AC_ARG_WITH(product-id, [AS_HELP_STRING([--with-product-id=productID], [Specify USB BT Dongle productID])], USB_PRODUCT_ID=$withval, USB_PRODUCT_ID="0")
|
||||
AC_ARG_ENABLE(ldid, [AS_HELP_STRING([--enable-ldid], [Code sign binaries with ldid])], USE_LDID=$enableval, USE_LDID_ID="no")
|
||||
AC_ARG_WITH(developer-path, [AS_HELP_STRING([--with-developer-path=path],
|
||||
[Specify toolchain path])], DEVELOPER_PATH=$withval, DEVELOPER_PATH="/Developer/Platforms/iPhoneOS.platform/Developer")
|
||||
|
@ -66,6 +66,10 @@
|
||||
#include "hci_transport.h"
|
||||
#include "hci_dump.h"
|
||||
|
||||
#if (USB_VENDOR_ID != 0) && (USB_PRODUCT_ID != 0)
|
||||
#define HAVE_USB_VENDOR_ID_AND_PRODUCT_ID
|
||||
#endif
|
||||
|
||||
// prototypes
|
||||
static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size);
|
||||
static int usb_close(void *transport_config);
|
||||
@ -87,7 +91,7 @@ static hci_transport_t * hci_transport_usb = NULL;
|
||||
static void (*packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size) = dummy_handler;
|
||||
|
||||
// libusb
|
||||
#if !USB_VENDOR_ID || !USB_PRODUCT_ID
|
||||
#ifndef HAVE_USB_VENDOR_ID_AND_PRODUCT_ID
|
||||
static struct libusb_device_descriptor desc;
|
||||
static libusb_device * dev;
|
||||
#endif
|
||||
@ -122,7 +126,7 @@ static int acl_in_addr;
|
||||
static int acl_out_addr;
|
||||
|
||||
|
||||
#if !USB_VENDOR_ID || !USB_PRODUCT_ID
|
||||
#ifndef HAVE_USB_VENDOR_ID_AND_PRODUCT_ID
|
||||
void scan_for_bt_endpoints(void) {
|
||||
int r;
|
||||
|
||||
@ -201,7 +205,7 @@ static void queue_transfer(struct libusb_transfer *transfer){
|
||||
// Walk to end of list and add current packet there
|
||||
struct libusb_transfer *temp = handle_packet;
|
||||
while (temp->user_data) {
|
||||
temp = (libusb_transfer*)temp->user_data;
|
||||
temp = (struct libusb_transfer*)temp->user_data;
|
||||
}
|
||||
temp->user_data = transfer;
|
||||
}
|
||||
@ -307,7 +311,7 @@ static int usb_process_ds(struct data_source *ds) {
|
||||
|
||||
// Move to next in the list of packets to handle
|
||||
if (next) {
|
||||
handle_packet = (libusb_transfer*)next;
|
||||
handle_packet = (struct libusb_transfer*)next;
|
||||
} else {
|
||||
handle_packet = NULL;
|
||||
}
|
||||
@ -342,7 +346,7 @@ void usb_process_ts(timer_source_t *timer) {
|
||||
|
||||
static int usb_open(void *transport_config){
|
||||
int r,c;
|
||||
#if !USB_VENDOR_ID || !USB_PRODUCT_ID
|
||||
#ifndef HAVE_USB_VENDOR_ID_AND_PRODUCT_ID
|
||||
libusb_device * aDev;
|
||||
libusb_device **devs;
|
||||
ssize_t cnt;
|
||||
@ -364,7 +368,7 @@ static int usb_open(void *transport_config){
|
||||
// configure debug level
|
||||
libusb_set_debug(NULL,1);
|
||||
|
||||
#if USB_VENDOR_ID && USB_PRODUCT_ID
|
||||
#ifdef HAVE_USB_VENDOR_ID_AND_PRODUCT_ID
|
||||
// Use a specified device
|
||||
log_info("Want vend: %04x, prod: %04x", USB_VENDOR_ID, USB_PRODUCT_ID);
|
||||
handle = libusb_open_device_with_vid_pid(NULL, USB_VENDOR_ID, USB_PRODUCT_ID);
|
||||
@ -439,7 +443,7 @@ static int usb_open(void *transport_config){
|
||||
libusb_state = LIB_USB_INTERFACE_CLAIMED;
|
||||
log_info("claimed interface 0");
|
||||
|
||||
#if !USB_VENDOR_ID || !USB_PRODUCT_ID
|
||||
#ifndef HAVE_USB_VENDOR_ID_AND_PRODUCT_ID
|
||||
scan_for_bt_endpoints();
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user