From 71c4de7a565c6a8002cec87ccafc081dd79c360a Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 1 Mar 2016 17:29:04 +0100 Subject: [PATCH] sco: HAVE_SCO_OVER_HCI -> ENABLE_SCO_OVER_HCI --- chipset/cc256x/btstack_chipset_cc256x.c | 6 +++--- chipset/csr/btstack_chipset_csr.c | 2 +- example/hsp_hs_test.c | 2 +- port/libusb/btstack_config.h | 2 +- port/libusb/hci_transport_h2_libusb.c | 24 ++++++++++++------------ port/posix-h4/btstack_config.h | 2 +- src/hci.c | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/chipset/cc256x/btstack_chipset_cc256x.c b/chipset/cc256x/btstack_chipset_cc256x.c index cdddfa826..963994f02 100644 --- a/chipset/cc256x/btstack_chipset_cc256x.c +++ b/chipset/cc256x/btstack_chipset_cc256x.c @@ -87,7 +87,7 @@ static int16_t init_power_in_dB = 13; // 13 dBm static int init_ehcill_enabled = 0; // support for SCO over HCI -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI static int init_send_route_sco_over_hci = 0; // route SCO over HCI (connection type=1, tx buffer size = 0x00 (don't change), tx buffer max latency=0x0000(don't chnage)), accept packets - 0) static const uint8_t hci_route_sco_over_hci[] = { @@ -97,7 +97,7 @@ static const uint8_t hci_route_sco_over_hci[] = { static void chipset_init(const void * config){ init_script_offset = 0; -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI init_send_route_sco_over_hci = 1; #endif } @@ -222,7 +222,7 @@ static void update_init_script_command(uint8_t *hci_cmd_buffer){ static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){ if (init_script_offset >= cc256x_init_script_size) { -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI // append send route SCO over HCI if requested if (init_send_route_sco_over_hci){ init_send_route_sco_over_hci = 0; diff --git a/chipset/csr/btstack_chipset_csr.c b/chipset/csr/btstack_chipset_csr.c index c1ead4d35..83bcbf04d 100644 --- a/chipset/csr/btstack_chipset_csr.c +++ b/chipset/csr/btstack_chipset_csr.c @@ -62,7 +62,7 @@ static const uint8_t init_script[] = { // Set HCI_NOP_DISABLE 0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xf2, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI // Set HOSTIO_MAP_SCO_PCM to 0 0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xab, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // Set HOSTIO_MAP_SCO_CODEC to 0 diff --git a/example/hsp_hs_test.c b/example/hsp_hs_test.c index e4b60c91d..11a54f4af 100644 --- a/example/hsp_hs_test.c +++ b/example/hsp_hs_test.c @@ -39,7 +39,7 @@ // // Minimal test for HSP Headset (!! UNDER DEVELOPMENT !!) // -// Requires HAVE_SCO_OVER_HCI to be defined +// Requires ENABLE_SCO_OVER_HCI to be defined // // Tested working setups: // - Ubuntu 14 64-bit, CC2564B connected via FTDI USB-2-UART adapter, 921600 baud diff --git a/port/libusb/btstack_config.h b/port/libusb/btstack_config.h index 7f6f6d0a9..1ed4ea532 100644 --- a/port/libusb/btstack_config.h +++ b/port/libusb/btstack_config.h @@ -8,7 +8,6 @@ // Port related features #define HAVE_BZERO #define HAVE_MALLOC -#define HAVE_SCO_OVER_HCI #define HAVE_SO_NOSIGPIPE #define HAVE_TIME #define HAVE_POSIX_FILE_IO @@ -19,6 +18,7 @@ #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO #define ENABLE_LOG_INTO_HCI_DUMP +#define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP // BTstack configuration. buffers, sizes, ... diff --git a/port/libusb/hci_transport_h2_libusb.c b/port/libusb/hci_transport_h2_libusb.c index 9e09159e5..bd183c5cf 100644 --- a/port/libusb/hci_transport_h2_libusb.c +++ b/port/libusb/hci_transport_h2_libusb.c @@ -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_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI #ifdef _WIN32 -#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" +#error "SCO not working on Win32 (Windows 8, libusb 1.0.19, Zadic WinUSB), please uncomment ENABLE_SCO_OVER_HCI in btstack-config.h for now" #endif // incoming SCO @@ -184,7 +184,7 @@ static int sco_in_addr; static int sco_out_addr; -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI static void sco_ring_init(void){ sco_ring_write = 0; sco_ring_transfers_active = 0; @@ -246,7 +246,7 @@ static void async_callback(struct libusb_transfer *transfer) } -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI static int usb_send_sco_packet(uint8_t *packet, int size){ int r; @@ -347,7 +347,7 @@ static void handle_completed_transfer(struct libusb_transfer *transfer){ // log_info("acl out done, size %u", transfer->actual_length); usb_acl_out_active = 0; signal_done = 1; -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI } else if (transfer->endpoint == sco_in_addr) { // log_info("handle_completed_transfer for SCO IN! num packets %u", transfer->NUM_ISO_PACKETS); int i; @@ -619,7 +619,7 @@ static int prepare_device(libusb_device_handle * aHandle){ return r; } -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI log_info("claiming interface 1..."); r = libusb_claim_interface(aHandle, 1); if (r < 0) { @@ -645,7 +645,7 @@ static int prepare_device(libusb_device_handle * aHandle){ static int usb_open(void){ int r; -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI sco_state_machine_init(); sco_ring_init(); #endif @@ -772,7 +772,7 @@ static int usb_open(void){ libusb_state = LIB_USB_TRANSFERS_ALLOCATED; -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI // incoming for (c = 0 ; c < ASYNC_BUFFERS ; c++) { @@ -882,7 +882,7 @@ static int usb_close(void){ for (c = 0 ; c < ASYNC_BUFFERS ; c++) { libusb_cancel_transfer(event_in_transfer[c]); libusb_cancel_transfer(acl_in_transfer[c]); -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI libusb_cancel_transfer(sco_in_transfer[c]); #endif } @@ -908,7 +908,7 @@ static int usb_close(void){ 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_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI if (sco_in_transfer[c]) libusb_free_transfer(sco_in_transfer[c]); #endif } @@ -991,7 +991,7 @@ static int usb_can_send_packet_now(uint8_t packet_type){ return !usb_command_active; case HCI_ACL_DATA_PACKET: return !usb_acl_out_active; -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI case HCI_SCO_DATA_PACKET: return sco_ring_have_space(); #endif @@ -1006,7 +1006,7 @@ static int usb_send_packet(uint8_t packet_type, uint8_t * packet, int size){ return usb_send_cmd_packet(packet, size); case HCI_ACL_DATA_PACKET: return usb_send_acl_packet(packet, size); -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI case HCI_SCO_DATA_PACKET: return usb_send_sco_packet(packet, size); #endif diff --git a/port/posix-h4/btstack_config.h b/port/posix-h4/btstack_config.h index 28d94ca3d..ebfdaaeeb 100644 --- a/port/posix-h4/btstack_config.h +++ b/port/posix-h4/btstack_config.h @@ -9,7 +9,6 @@ #define HAVE_BZERO #define HAVE_MALLOC #define HAVE_POSIX_FILE_IO -#define HAVE_SCO_OVER_HCI #define HAVE_SO_NOSIGPIPE #define HAVE_TIME @@ -19,6 +18,7 @@ #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO #define ENABLE_LOG_INTO_HCI_DUMP +#define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP // BTstack configuration. buffers, sizes, ... diff --git a/src/hci.c b/src/hci.c index 5f01787eb..3508b9aec 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1280,7 +1280,7 @@ static void hci_initializing_event_handler(uint8_t * packet, uint16_t size){ hci_stack->substate = HCI_INIT_LE_SET_SCAN_PARAMETERS; return; -#ifdef HAVE_SCO_OVER_HCI +#ifdef ENABLE_SCO_OVER_HCI case HCI_INIT_W4_WRITE_SCAN_ENABLE: // just go to next state break;