mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-05 18:40:27 +00:00
Merge branch 'develop'
This commit is contained in:
commit
a3a561d926
5
.gitignore
vendored
5
.gitignore
vendored
@ -15,7 +15,8 @@
|
||||
*.map
|
||||
.theos
|
||||
.stamp
|
||||
bluetooth_init_cc2560B_1.2_BT_Spec_4.1.c
|
||||
bluetooth_init_cc2564B_1.2_BT_Spec_4.1.c
|
||||
.bts
|
||||
bluetooth_init_cc2560B_1.*_BT_Spec_4.1.c
|
||||
bluetooth_init_cc2564B_1.*_BT_Spec_4.1.c
|
||||
TIInit_11.8.32.c
|
||||
initscripts_TIInit_6.7.16_bt_spec_4.1.c
|
||||
|
@ -3,13 +3,41 @@
|
||||
# http://processors.wiki.ti.com/index.php/CC256x_Downloads
|
||||
#
|
||||
BASE_URL = https://git.ti.com/ti-bt/service-packs/blobs/raw/a027ae390d8790e56e1c78136c78fe6537470e91
|
||||
CONVERSION_SCRIPT=$(BTSTACK_ROOT)/chipset/cc256x/convert_bts_init_scripts.py
|
||||
|
||||
bluetooth_init_cc2560B_1.2_BT_Spec_4.0.bts:
|
||||
curl -O $(BASE_URL)/bluetooth_init_cc2560B_1.2_BT_Spec_4.0.bts
|
||||
# first generation CC2560 - TIInit_6.2.31.bts part of .zip archive
|
||||
|
||||
bluetooth_init_cc2564B_1.2_BT_Spec_4.0.bts:
|
||||
curl -O $(BASE_URL)/bluetooth_init_cc2564B_1.2_BT_Spec_4.0.bts
|
||||
CC2560_BT_SP_BTS.zip:
|
||||
curl -O http://processors.wiki.ti.com/images/d/da/CC2560_BT_SP_BTS.zip
|
||||
|
||||
bluetooth_init_cc2560_2.44.bts: CC2560_BT_SP_BTS.zip
|
||||
unzip CC2560_BT_SP_BTS.zip
|
||||
mv CC2560_BT_SP_BTS/bluetooth_init_cc2560_2.44.bts .
|
||||
rm -rf CC2560_BT_SP_BTS
|
||||
|
||||
|
||||
# second generation CC2560A and CC2564 - TIInit_6.6.15.bts part of .zip archive
|
||||
|
||||
CC2560A_BT_SP_BTS.zip:
|
||||
curl -O http://processors.wiki.ti.com/images/e/e7/CC2560A_BT_SP_BTS.zip
|
||||
|
||||
CC2564_BT_BLE_SP_BTS.zip:
|
||||
curl -O http://processors.wiki.ti.com/images/1/1e/CC2564_BT_BLE_SP_BTS.zip
|
||||
|
||||
bluetooth_init_cc2560A_2.14.bts: CC2560A_BT_SP_BTS.zip
|
||||
unzip CC2560A_BT_SP_BTS.zip
|
||||
mv CC2560A_BT_SP_BTS/bluetooth_init_cc2560a_2.14.bts .
|
||||
rm -rf CC2560A_BT_SP_BTS
|
||||
|
||||
bluetooth_init_cc2564_2.14.bts: CC2564_BT_BLE_SP_BTS.zip
|
||||
unzip CC2564_BT_BLE_SP_BTS.zip
|
||||
mv CC2564_BT_BLE_SP_BTS/bluetooth_init_cc2564_2.14.bts .
|
||||
rm -rf CC2564_BT_BLE_SP_BTS
|
||||
|
||||
|
||||
# third generation
|
||||
|
||||
# versioned files for v1.2
|
||||
bluetooth_init_cc2560B_1.2_BT_Spec_4.1.bts:
|
||||
curl -O $(BASE_URL)/bluetooth_init_cc2560B_1.2_BT_Spec_4.1.bts
|
||||
|
||||
@ -19,6 +47,14 @@ bluetooth_init_cc2564B_1.2_BT_Spec_4.1.bts:
|
||||
BLE_init_cc2564B_1.2.bts:
|
||||
curl -O $(BASE_URL)/BLE_init_cc2564B_1.2.bts
|
||||
|
||||
# unversioned files for v1.4
|
||||
TIInit_6.7.16_bt_spec_4.1.bts:
|
||||
curl -O https://git.ti.com/ti-bt/service-packs/blobs/raw/54f5c151dacc608b19ab2ce4c30e27a3983048b2/initscripts/TIInit_6.7.16_bt_spec_4.1.bts
|
||||
|
||||
TIInit_6.7.16_ble_add-on.bts:
|
||||
curl -O https://git.ti.com/ti-bt/service-packs/blobs/raw/89c8db14929f10d75627b132690432cd71f5f54f/initscripts/TIInit_6.7.16_ble_add-on.bts
|
||||
|
||||
# WL chipset
|
||||
TIInit_11.8.32.bts:
|
||||
curl -O $(BASE_URL)/TIInit_11.8.32.bts
|
||||
|
||||
@ -29,7 +65,16 @@ TIInit_12.8.32.bts:
|
||||
curl -O $(BASE_URL)/TIInit_12.8.32.bts
|
||||
|
||||
# convert to .c files
|
||||
CONVERSION_SCRIPT=$(BTSTACK_ROOT)/chipset/cc256x/convert_bts_init_scripts.py
|
||||
bluetooth_init_cc2560_2.44.c: bluetooth_init_cc2560_2.44.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
|
||||
bluetooth_init_cc2560A_2.14.c: bluetooth_init_cc2560A_2.14.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
bluetooth_init_cc2564_2.14.c: bluetooth_init_cc2564_2.14.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
|
||||
bluetooth_init_cc2560B_1.2_BT_Spec_4.0.c: bluetooth_init_cc2560B_1.2_BT_Spec_4.0.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
@ -43,11 +88,27 @@ bluetooth_init_cc2560B_1.2_BT_Spec_4.1.c: bluetooth_init_cc2560B_1.2_BT_Spec_4.1
|
||||
bluetooth_init_cc2564B_1.2_BT_Spec_4.1.c: bluetooth_init_cc2564B_1.2_BT_Spec_4.1.bts BLE_init_cc2564B_1.2.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
bluetooth_init_cc2560B_1.4_BT_Spec_4.1.c: TIInit_6.7.16_bt_spec_4.1.bts
|
||||
cp TIInit_6.7.16_bt_spec_4.1.bts bluetooth_init_cc2560B_1.4_BT_Spec_4.1.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
bluetooth_init_cc2564B_1.4_BT_Spec_4.1.c: TIInit_6.7.16_bt_spec_4.1.bts TIInit_6.7.16_ble_add-on.bts
|
||||
cp TIInit_6.7.16_bt_spec_4.1.bts bluetooth_init_cc2564B_1.4_BT_Spec_4.1.bts
|
||||
cp TIInit_6.7.16_ble_add-on.bts BLE_init_cc2564B_1.4.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
TIInit_11.8.32.c: TIInit_11.8.32.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
TIInit_12.10.28.c: TIInit_12.10.28.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
TIInit_12.8.32.c: /TIInit_12.8.32.bts
|
||||
TIInit_12.8.32.c: TIInit_12.8.32.bts
|
||||
$(CONVERSION_SCRIPT)
|
||||
|
||||
all-scripts: bluetooth_init_cc2560_2.44.c bluetooth_init_cc2560A_2.14.c bluetooth_init_cc2564_2.14.bts bluetooth_init_cc2560B_1.2_BT_Spec_4.0.c bluetooth_init_cc2564B_1.2_BT_Spec_4.0.c bluetooth_init_cc2560B_1.2_BT_Spec_4.1.c bluetooth_init_cc2564B_1.2_BT_Spec_4.1.c TIInit_11.8.32.c TIInit_12.10.28.c TIInit_12.8.32.c
|
||||
|
||||
clean-scripts:
|
||||
rm -fr CC256*.zip bluetooth_init_cc256*.bts bluetooth_init_cc256*.c TIInit_*.bts TIInit_*.c BLE_init_cc256*.bts BLE_init_cc256*.c
|
||||
|
||||
|
||||
|
@ -88,9 +88,10 @@ static int16_t init_power_in_dB = 13; // 13 dBm
|
||||
// support for 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)
|
||||
// Follow recommendation from https://e2e.ti.com/support/wireless_connectivity/bluetooth_cc256x/f/660/t/397004
|
||||
// route SCO over HCI (connection type=1, tx buffer size = 120, tx buffer max latency= 720, accept packets with CRC Error
|
||||
static const uint8_t hci_route_sco_over_hci[] = {
|
||||
0x10, 0xfe, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00
|
||||
0x10, 0xfe, 0x05, 0x01, 0x78, 0xd0, 0x02, 0x01,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -142,14 +142,13 @@ def convert_bts(main_bts_file, bts_add_on):
|
||||
|
||||
if (action_type == 1): # hci command
|
||||
|
||||
# opcode = (ord(action_data[2]) << 8) | ord(action_data[1])
|
||||
opcode = (action_data[2] << 8) | action_data[1]
|
||||
if opcode == 0xFF36:
|
||||
continue # skip baud rate command
|
||||
if opcode == 0xFD0C:
|
||||
have_eHCILL = True
|
||||
if opcode == 0xFD82:
|
||||
modulation_type = ord(action_data[4])
|
||||
modulation_type = action_data[4]
|
||||
if modulation_type == 0:
|
||||
have_power_vector_gfsk = True
|
||||
elif modulation_type == 1:
|
||||
@ -283,6 +282,9 @@ for name in files:
|
||||
if name_lower.startswith('avpr_init_cc'):
|
||||
print("Skipping AVPR add-on", name)
|
||||
continue
|
||||
if re.match("tiinit_.*_ble_add-on.bts", name_lower):
|
||||
print("Skipping BLE add-on", name)
|
||||
continue
|
||||
if re.match("initscripts_tiinit_.*_ble_add-on.bts", name_lower):
|
||||
print("Skipping BLE add-on", name)
|
||||
continue
|
||||
@ -290,6 +292,8 @@ for name in files:
|
||||
print("Skipping AVPR add-on", name)
|
||||
continue
|
||||
|
||||
print "check", name
|
||||
|
||||
# check for BLE add-on
|
||||
add_on = ""
|
||||
name_parts = re.match('bluetooth_init_(.....+_...)_.*.bts', name)
|
||||
@ -299,6 +303,13 @@ for name in files:
|
||||
add_on = potential_add_on
|
||||
print("Found", add_on, "add-on for", name)
|
||||
|
||||
name_parts = re.match('TIInit_(\d*\.\d*\.\d*)_.*.bts', name)
|
||||
if name_parts:
|
||||
potential_add_on = 'TIInit_%s_ble_add-on.bts' % name_parts.group(1)
|
||||
if os.path.isfile(potential_add_on):
|
||||
add_on = potential_add_on
|
||||
print("Found", add_on, "add-on for", name)
|
||||
|
||||
name_parts = re.match('initscripts_TIInit_(\d*\.\d*\.\d*)_.*.bts', name)
|
||||
if name_parts:
|
||||
potential_add_on = 'initscripts_TIInit_%s_ble_add-on.bts' % name_parts.group(1)
|
||||
|
@ -4,8 +4,8 @@
|
||||
#
|
||||
|
||||
# init scripts
|
||||
CC2560B = bluetooth_init_cc2560B_1.2_BT_Spec_4.1.o
|
||||
CC2564B = bluetooth_init_cc2564B_1.2_BT_Spec_4.1.o
|
||||
CC2560B = bluetooth_init_cc2560B_1.4_BT_Spec_4.1.o
|
||||
CC2564B = bluetooth_init_cc2564B_1.4_BT_Spec_4.1.o
|
||||
CC2567 = CC256x_BT_Service_Pack_2.8_ANT_1.16.o
|
||||
|
||||
BTSTACK_ROOT = ../..
|
||||
|
@ -4,8 +4,8 @@
|
||||
#
|
||||
|
||||
# init scripts
|
||||
CC2560B = bluetooth_init_cc2560B_1.2_BT_Spec_4.1.o
|
||||
CC2564B = bluetooth_init_cc2564B_1.2_BT_Spec_4.1.o
|
||||
CC2560B = bluetooth_init_cc2560B_1.4_BT_Spec_4.1.o
|
||||
CC2564B = bluetooth_init_cc2564B_1.4_BT_Spec_4.1.o
|
||||
CC2567 = CC256x_BT_Service_Pack_2.8_ANT_1.16.o
|
||||
|
||||
BTSTACK_ROOT = ../..
|
||||
|
@ -4,8 +4,8 @@
|
||||
#
|
||||
|
||||
# init scripts
|
||||
CC2560B = bluetooth_init_cc2560B_1.2_BT_Spec_4.1.o
|
||||
CC2564B = bluetooth_init_cc2564B_1.2_BT_Spec_4.1.o
|
||||
CC2560B = bluetooth_init_cc2560B_1.4_BT_Spec_4.1.o
|
||||
CC2564B = bluetooth_init_cc2564B_1.4_BT_Spec_4.1.o
|
||||
CC2567 = CC256x_BT_Service_Pack_2.8_ANT_1.16.o
|
||||
|
||||
BTSTACK_ROOT = ../..
|
||||
|
@ -2,7 +2,7 @@
|
||||
BTSTACK_ROOT = ../..
|
||||
|
||||
CORE += \
|
||||
bluetooth_init_cc2564B_1.2_BT_Spec_4.1.c \
|
||||
bluetooth_init_cc2564B_1.4_BT_Spec_4.1.c \
|
||||
btstack_chipset_cc256x.c \
|
||||
btstack_chipset_csr.c \
|
||||
btstack_chipset_em9301.c \
|
||||
|
@ -2,7 +2,7 @@
|
||||
BTSTACK_ROOT = ../..
|
||||
|
||||
CORE += \
|
||||
bluetooth_init_cc2564B_1.2_BT_Spec_4.1.c \
|
||||
bluetooth_init_cc2564B_1.4_BT_Spec_4.1.c \
|
||||
btstack_chipset_cc256x.c \
|
||||
btstack_chipset_csr.c \
|
||||
btstack_chipset_em9301.c \
|
||||
|
@ -24,7 +24,7 @@ CORE = \
|
||||
btstack_run_loop_embedded.c \
|
||||
|
||||
COMMON = \
|
||||
bluetooth_init_cc2564B_1.2_BT_Spec_4.1.c \
|
||||
bluetooth_init_cc2564B_1.4_BT_Spec_4.1.c \
|
||||
btstack_chipset_cc256x.c \
|
||||
btstack_link_key_db_memory.c \
|
||||
rfcomm.c \
|
||||
|
@ -1090,7 +1090,7 @@ static int bnep_handle_ethernet_packet(bnep_channel_t *channel, bd_addr_t addr_d
|
||||
#endif
|
||||
|
||||
/* Notify application layer and deliver the ethernet packet */
|
||||
(*app_packet_handler)(BNEP_DATA_PACKET, channel->uuid_source,
|
||||
(*app_packet_handler)(BNEP_DATA_PACKET, channel->l2cap_cid,
|
||||
ethernet_packet, size + sizeof(uint16_t) + 2 * sizeof(bd_addr_t));
|
||||
|
||||
return size;
|
||||
|
@ -1074,10 +1074,15 @@ static void hci_initializing_run(void){
|
||||
hci_send_cmd(&hci_write_scan_enable, (hci_stack->connectable << 1) | hci_stack->discoverable); // page scan
|
||||
hci_stack->substate = HCI_INIT_W4_WRITE_SCAN_ENABLE;
|
||||
break;
|
||||
// only sent if ENABLE_SCO_OVER_HCI is defined
|
||||
case HCI_INIT_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE:
|
||||
hci_stack->substate = HCI_INIT_W4_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE;
|
||||
hci_send_cmd(&hci_write_synchronous_flow_control_enable, 1); // SCO tracking enabled
|
||||
break;
|
||||
case HCI_INIT_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING:
|
||||
hci_stack->substate = HCI_INIT_W4_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING;
|
||||
hci_send_cmd(&hci_write_default_erroneous_data_reporting, 1);
|
||||
break;
|
||||
#ifdef ENABLE_BLE
|
||||
// LE INIT
|
||||
case HCI_INIT_LE_READ_BUFFER_SIZE:
|
||||
@ -1323,9 +1328,9 @@ static void hci_initializing_event_handler(uint8_t * packet, uint16_t size){
|
||||
|
||||
#ifdef ENABLE_SCO_OVER_HCI
|
||||
case HCI_INIT_W4_WRITE_SCAN_ENABLE:
|
||||
// just go to next state
|
||||
break;
|
||||
case HCI_INIT_W4_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE:
|
||||
break;
|
||||
case HCI_INIT_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING:
|
||||
if (!hci_le_supported()){
|
||||
// SKIP LE init for Classic only configuration
|
||||
hci_init_done();
|
||||
|
@ -457,6 +457,8 @@ typedef enum hci_init_state{
|
||||
|
||||
HCI_INIT_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE,
|
||||
HCI_INIT_W4_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE,
|
||||
HCI_INIT_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING,
|
||||
HCI_INIT_W4_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING,
|
||||
|
||||
HCI_INIT_LE_READ_BUFFER_SIZE,
|
||||
HCI_INIT_W4_LE_READ_BUFFER_SIZE,
|
||||
|
@ -656,6 +656,14 @@ const hci_cmd_t hci_write_simple_pairing_mode = {
|
||||
OPCODE(OGF_CONTROLLER_BASEBAND, 0x56), "1"
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param mode (0 = off, 1 = on)
|
||||
*/
|
||||
const hci_cmd_t hci_write_default_erroneous_data_reporting = {
|
||||
OPCODE(OGF_CONTROLLER_BASEBAND, 0x5B), "1"
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
const hci_cmd_t hci_read_le_host_supported = {
|
||||
|
@ -134,6 +134,7 @@ extern const hci_cmd_t hci_user_passkey_request_negative_reply;
|
||||
extern const hci_cmd_t hci_user_passkey_request_reply;
|
||||
extern const hci_cmd_t hci_write_authentication_enable;
|
||||
extern const hci_cmd_t hci_write_class_of_device;
|
||||
extern const hci_cmd_t hci_write_default_erroneous_data_reporting;
|
||||
extern const hci_cmd_t hci_write_extended_inquiry_response;
|
||||
extern const hci_cmd_t hci_write_inquiry_mode;
|
||||
extern const hci_cmd_t hci_write_le_host_supported;
|
||||
|
Loading…
x
Reference in New Issue
Block a user