sco: HAVE_SCO_OVER_HCI -> ENABLE_SCO_OVER_HCI

This commit is contained in:
Matthias Ringwald 2016-03-01 17:29:04 +01:00
parent 68bbf757e4
commit 71c4de7a56
7 changed files with 20 additions and 20 deletions

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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, ...

View File

@ -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

View File

@ -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, ...

View File

@ -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;