mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-15 23:42:52 +00:00
substitute HAVE_SCO with HAVE_SCO_OVER_HCI
This commit is contained in:
parent
7627e142e1
commit
c27652aa6a
@ -39,7 +39,7 @@
|
||||
//
|
||||
// Minimal test for HSP Headset (!! UNDER DEVELOPMENT !!)
|
||||
//
|
||||
// Requires HAVE_SCO and HAVE_SCO_OVER_HCI to be defined
|
||||
// Requires HAVE_SCO_OVER_HCI to be defined
|
||||
//
|
||||
// Tested working setups:
|
||||
// - Ubuntu 14 64-bit, CC2564B connected via FTDI USB-2-UART adapter, 921600 baud
|
||||
|
@ -21,7 +21,6 @@
|
||||
#define HAVE_HCI_DUMP
|
||||
#define SDP_DES_DUMP
|
||||
|
||||
#define HAVE_SCO
|
||||
#define HAVE_SCO_OVER_HCI
|
||||
|
||||
#endif
|
||||
|
@ -13,7 +13,6 @@
|
||||
#define HAVE_SDP
|
||||
#define HAVE_SO_NOSIGPIPE
|
||||
#define HAVE_TIME
|
||||
#define HAVE_SCO
|
||||
#define HAVE_SCO_OVER_HCI
|
||||
#define HCI_ACL_PAYLOAD_SIZE (1691 + 4)
|
||||
#define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof BNEP header, avoid memcpy
|
||||
|
@ -13,7 +13,6 @@
|
||||
#define HAVE_SDP
|
||||
#define HAVE_SO_NOSIGPIPE
|
||||
#define HAVE_TIME
|
||||
#define HAVE_SCO
|
||||
#define HAVE_SCO_OVER_HCI
|
||||
#define HCI_ACL_PAYLOAD_SIZE (1691 + 4)
|
||||
#define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof BNEP header, avoid memcpy
|
||||
|
@ -136,10 +136,10 @@ static struct libusb_transfer *acl_out_transfer;
|
||||
static struct libusb_transfer *event_in_transfer[ASYNC_BUFFERS];
|
||||
static struct libusb_transfer *acl_in_transfer[ASYNC_BUFFERS];
|
||||
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
|
||||
#ifdef _WIN32
|
||||
#error "SCO not working on Win32 (Windows 8, libusb 1.0.19, Zadic WinUSB), please uncomment HAVE_SCO in btstack-config.h for now"
|
||||
#error "SCO not working on Win32 (Windows 8, libusb 1.0.19, Zadic WinUSB), please uncomment HAVE_SCO_OVER_HCI in btstack-config.h for now"
|
||||
#endif
|
||||
|
||||
// incoming SCO
|
||||
@ -183,7 +183,7 @@ static int acl_out_addr;
|
||||
static int sco_in_addr;
|
||||
static int sco_out_addr;
|
||||
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
static void sco_ring_init(void){
|
||||
sco_ring_write = 0;
|
||||
sco_ring_transfers_active = 0;
|
||||
@ -191,7 +191,7 @@ static void sco_ring_init(void){
|
||||
#endif
|
||||
|
||||
static int sco_ring_have_space(void){
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
return sco_ring_transfers_active < SCO_RING_BUFFER_COUNT;
|
||||
#else
|
||||
return 0;
|
||||
@ -251,7 +251,7 @@ static void LIBUSB_CALL async_callback(struct libusb_transfer *transfer) {
|
||||
|
||||
|
||||
static int usb_send_sco_packet(uint8_t *packet, int size){
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
int r;
|
||||
|
||||
if (libusb_state != LIB_USB_TRANSFERS_ALLOCATED) return -1;
|
||||
@ -291,7 +291,7 @@ static int usb_send_sco_packet(uint8_t *packet, int size){
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
static void sco_state_machine_init(void){
|
||||
sco_state = H2_W4_SCO_HEADER;
|
||||
sco_read_pos = 0;
|
||||
@ -342,7 +342,7 @@ static void handle_completed_transfer(struct libusb_transfer *transfer){
|
||||
packet_handler(HCI_ACL_DATA_PACKET, transfer-> buffer, transfer->actual_length);
|
||||
resubmit = 1;
|
||||
} else if (transfer->endpoint == sco_in_addr) {
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
// log_info("handle_completed_transfer for SCO IN! num packets %u", transfer->NUM_ISO_PACKETS);
|
||||
int i;
|
||||
for (i = 0; i < transfer->num_iso_packets; i++) {
|
||||
@ -368,7 +368,7 @@ static void handle_completed_transfer(struct libusb_transfer *transfer){
|
||||
usb_acl_out_active = 0;
|
||||
signal_done = 1;
|
||||
} else if (transfer->endpoint == sco_out_addr){
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
log_info("sco out done, {{ %u/%u (%x)}, { %u/%u (%x)}, { %u/%u (%x)}}",
|
||||
transfer->iso_packet_desc[0].actual_length, transfer->iso_packet_desc[0].length, transfer->iso_packet_desc[0].status,
|
||||
transfer->iso_packet_desc[1].actual_length, transfer->iso_packet_desc[1].length, transfer->iso_packet_desc[1].status,
|
||||
@ -622,7 +622,7 @@ static int prepare_device(libusb_device_handle * aHandle){
|
||||
return r;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
log_info("claiming interface 1...");
|
||||
r = libusb_claim_interface(aHandle, 1);
|
||||
if (r < 0) {
|
||||
@ -648,7 +648,7 @@ static int prepare_device(libusb_device_handle * aHandle){
|
||||
static int usb_open(void *transport_config){
|
||||
int r;
|
||||
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
sco_state_machine_init();
|
||||
sco_ring_init();
|
||||
#endif
|
||||
@ -774,7 +774,7 @@ static int usb_open(void *transport_config){
|
||||
|
||||
libusb_state = LIB_USB_TRANSFERS_ALLOCATED;
|
||||
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
|
||||
// incoming
|
||||
for (c = 0 ; c < ASYNC_BUFFERS ; c++) {
|
||||
@ -884,7 +884,7 @@ static int usb_close(void *transport_config){
|
||||
for (c = 0 ; c < ASYNC_BUFFERS ; c++) {
|
||||
libusb_cancel_transfer(event_in_transfer[c]);
|
||||
libusb_cancel_transfer(acl_in_transfer[c]);
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
libusb_cancel_transfer(sco_in_transfer[c]);
|
||||
#endif
|
||||
}
|
||||
@ -910,7 +910,7 @@ static int usb_close(void *transport_config){
|
||||
for (c = 0 ; c < ASYNC_BUFFERS ; c++) {
|
||||
if (event_in_transfer[c]) libusb_free_transfer(event_in_transfer[c]);
|
||||
if (acl_in_transfer[c]) libusb_free_transfer(acl_in_transfer[c]);
|
||||
#ifdef HAVE_SCO
|
||||
#ifdef HAVE_SCO_OVER_HCI
|
||||
if (sco_in_transfer[c]) libusb_free_transfer(sco_in_transfer[c]);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user