Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
mringwal committed Apr 27, 2018
2 parents 0a42fd2 + d112090 commit bd8249927333decf4f20c1478db215dc99b2e2a4
Showing with 6,287 additions and 2,746 deletions.
  1. +3 −3 3rd-party/bluedroid/decoder/srce/synthesis-sbc.c
  2. +6 −1 CHANGELOG.md
  3. +2 −1 README.md
  4. +3 −4 example/Makefile.inc
  5. +20 −5 example/a2dp_sink_demo.c
  6. +2 −2 example/gap_le_advertisements.c
  7. +3 −1 example/sco_demo_util.c
  8. +27 −7 platform/embedded/btstack_stdin_embedded.c
  9. +8 −23 port/apollo2-em9304/example-template/gcc/Makefile
  10. +1 −1 port/arduino/Makefile
  11. +1 −0 port/daemon/src/Makefile.in
  12. +2 −1 port/esp32/components/btstack/main.c
  13. +0 −653 port/esp32/template/main/spp_and_le_streamer.c
  14. +0 −57 port/esp32/template/main/spp_and_le_streamer.h
  15. +1 −0 port/mtk/Makefile
  16. +1 −0 port/nrf5-zephyr/Makefile.src
  17. +17 −5 port/pic32-harmony/app.X/nbproject/Makefile-default.mk
  18. +2 −2 port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties
  19. +1 −0 port/pic32-harmony/app.X/nbproject/configurations.xml
  20. +6 −1 port/pic32-harmony/app.X/nbproject/private/private.xml
  21. BIN port/samv71-xplained-atwilc3000/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM7lfsp_math_softfp.a
  22. +3 −1 port/samv71-xplained-atwilc3000/Makefile
  23. +2 −0 port/samv71-xplained-atwilc3000/example/template/config.mk
  24. +1 −6 port/samv71-xplained-atwilc3000/scripts/create_examples.py
  25. +1 −0 port/stm32-f103rb-nucleo/Makefile
  26. +5 −4 port/stm32-l053r8-em9304/cubemx-l053r8-em9304/Makefile
  27. +1 −0 port/wiced-h4/wiced-h4.mk
  28. +1 −0 port/wiced-h5/wiced-h5.mk
  29. +23 −0 src/Makefile.inc
  30. +13 −0 src/ble/Makefile.inc
  31. +3 −0 src/ble/att_server.c
  32. +1 −1 src/ble/core.h
  33. +7 −0 src/ble/gatt-service/Makefile.inc
  34. +2 −2 src/ble/gatt-service/battery_service_server.c
  35. +8 −9 src/ble/gatt-service/device_information_service_server.c
  36. +8 −8 src/ble/gatt_client.c
  37. +464 −1,010 src/ble/sm.c
  38. +3 −24 src/ble/sm.h
  39. +1 −0 src/btstack.h
  40. +1,007 −0 src/btstack_crypto.c
  41. +258 −0 src/btstack_crypto.h
  42. +26 −3 src/btstack_defines.h
  43. +74 −8 src/btstack_event.h
  44. +44 −0 src/classic/Makefile.inc
  45. +1 −1 src/classic/a2dp_sink.c
  46. +23 −12 src/classic/a2dp_source.c
  47. +65 −68 src/classic/avdtp.c
  48. +12 −6 src/classic/avdtp.h
  49. +14 −23 src/classic/avdtp_acceptor.c
  50. +35 −30 src/classic/avdtp_initiator.c
  51. +32 −0 src/classic/avdtp_sink.c
  52. +9 −0 src/classic/avdtp_sink.h
  53. +0 −7 src/classic/avdtp_source.c
  54. +0 −2 src/classic/avdtp_source.h
  55. +40 −41 src/classic/avdtp_util.c
  56. +3 −6 src/classic/avdtp_util.h
  57. +31 −14 src/classic/avrcp.c
  58. +98 −15 src/classic/avrcp.h
  59. +388 −117 src/classic/avrcp_browsing_controller.c
  60. +28 −6 src/classic/avrcp_browsing_controller.h
  61. +589 −0 src/classic/avrcp_browsing_target.c
  62. +113 −0 src/classic/avrcp_browsing_target.h
  63. +334 −98 src/classic/avrcp_controller.c
  64. +81 −42 src/classic/avrcp_controller.h
  65. +1 −1 src/classic/avrcp_media_item_iterator.c
  66. +251 −26 src/classic/avrcp_target.c
  67. +9 −0 src/classic/avrcp_target.h
  68. +1 −1 src/classic/btstack_link_key_db_tlv.c
  69. +106 −93 src/classic/hfp.c
  70. +4 −2 src/classic/hfp.h
  71. +31 −12 src/classic/hfp_ag.c
  72. +65 −44 src/classic/hfp_hf.c
  73. +1 −0 src/classic/sdp_server.c
  74. +9 −6 src/hci.c
  75. +0 −20 src/hci.h
  76. +6 −2 src/l2cap.c
  77. +4 −2 test/hfp/mock.c
  78. +2 −0 test/pts/.gitignore
  79. +17 −17 test/pts/Makefile
  80. +15 −5 test/pts/avdtp_sink_test.c
  81. +1 −1 test/pts/avdtp_source_test.c
  82. +469 −168 test/pts/avrcp_controller_test.c
  83. +889 −0 test/pts/avrcp_target_test.c
  84. +89 −0 test/pts/btstack_stdin_pts.c
  85. +57 −0 test/pts/btstack_stdin_pts.h
  86. +209 −0 test/pts/gatt_profiles.c
  87. +11 −0 test/pts/gatt_profiles.gatt
  88. +6 −0 test/pts/iopt.c
  89. +4 −3 test/pts/le_data_channel.c
  90. +2 −1 test/security_manager/Makefile
  91. +10 −7 test/security_manager/mock.c
  92. +10 −4 test/security_manager/security_manager.c
  93. +50 −0 tool/create_makefile_inc.py
@@ -354,22 +354,22 @@ PRIVATE void OI_SBC_SynthFrame_Enhanced(OI_CODEC_SBC_DECODER_CONTEXT *context, O
}
static const SYNTH_FRAME SynthFrameEnhanced[] = {
(const SYNTH_FRAME) NULL, /* invalid */
(SYNTH_FRAME) NULL, /* invalid */
OI_SBC_SynthFrame_Enhanced, /* mono */
OI_SBC_SynthFrame_Enhanced /* stereo */
};
#endif
static const SYNTH_FRAME SynthFrame8SB[] = {
(const SYNTH_FRAME) NULL, /* invalid */
(SYNTH_FRAME) NULL, /* invalid */
OI_SBC_SynthFrame_80, /* mono */
OI_SBC_SynthFrame_80 /* stereo */
};
static const SYNTH_FRAME SynthFrame4SB[] = {
(const SYNTH_FRAME) NULL, /* invalid */
(SYNTH_FRAME) NULL, /* invalid */
OI_SBC_SynthFrame_4SB, /* mono */
OI_SBC_SynthFrame_4SB /* stereo */
};
@@ -7,13 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Added
- Crypto: btstack_crypo.h provides cryptographic functions for random data generation, AES128, EEC, CBC-MAC (Mesh)
- SM: support pairing using Out-of-Band (OOB) data with LE Secure Connections
- Embedded: support btstack_stdin via SEGGER RTT
### Changed
- att_db_util: added security requirement arguments to characteristic creators
- SM: use btstack_crypto for cryptographpic functions
### Fixed
- hci: fix buffer overrun in gap_inquiry_explode
- HFP: fix answer call command
- HCI: fix buffer overrun in gap_inquiry_explode
- SDP: free service record item on sdp_unregister_service
## Changes March 2018
@@ -37,14 +37,15 @@ GATT, SM of the Bluetooth 4.2 LE Central and Peripheral roles (QD ID 25340). For
## Evaluation Platforms
#### Embedded Platforms:
Build Status | Port | Platform
---------------------| -----| ------
[<img src="http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=port-esp32-master">](https://buildbot.bluekitchen-gmbh.com/btstack/builders/port-esp32-master) | [esp32](https://github.com/bluekitchen/btstack/tree/master/port/esp32) | [Espressif ESP32](http://www.espressif.com/products/hardware/esp32/overview) 2.4 GHz Wi-Fi and Bluetooth Dual-Mode combo chip using [FreeRTOS](http://www.freertos.org)
[<img src="http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=port-ez430-rf2560-master">](https://buildbot.bluekitchen-gmbh.com/btstack/builders/port-ez430-rf2560-master) | [ez430-rf2560](https://github.com/bluekitchen/btstack/tree/master/port/ez430-rf2560) | [EZ430-RF256x Bluetooth Evaluation Tool for MSP430](http://www.ti.com/tool/ez430-rf256x)
[<img src="http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=port-msp-exp430f5438-cc2564b-master">](https://buildbot.bluekitchen-gmbh.com/btstack/builders/port-msp-exp430f5438-cc2564b-master) | [msp-exp430f5438-cc2564b](https://github.com/bluekitchen/btstack/tree/master/port/msp-exp430f5438-cc2564b) |[MSP430F5438 Experimenter Board for MSP430](http://www.ti.com/tool/msp-exp430f5438) with [Bluetooth CC2564 Module Evaluation Board](http://www.ti.com/tool/cc2564modnem)
[<img src="http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=port-msp430f5229lp-cc2564b-master">](https://buildbot.bluekitchen-gmbh.com/btstack/builders/port-msp430f5229lp-cc2564b-master) | [msp430f5529lp-cc2564b](https://github.com/bluekitchen/btstack/tree/master/port/msp430f5229lp-cc2564b) | [MSP-EXP430F5529LP LaunchPad](http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430f5529lp.html#tabs) with [Bluetooth CC2564 Module Evaluation Board](http://www.ti.com/tool/cc2564modnem) and [EM Adapter BoosterPack](http://www.ti.com/tool/boost-ccemadapter) with additional 32768Hz quartz oscillator
No build server | [max32630-fthr](https://github.com/bluekitchen/btstack/tree/master/port/max32630-fthr) | [MAX32630FTHR ARM Cortex M4F Board](https://www.maximintegrated.com/en/products/digital/microcontrollers/MAX32630FTHR.html) with onboard [Panasonic PAN1326 module](https://na.industrial.panasonic.com/products/wireless-connectivity/bluetooth/multi-mode/series/pan13261316-series/CS467) containing [TI CC2564B Bluetooth controller](http://www.ti.com/product/cc2564)
No build server | [samv71-xplained-atwilc3000](https://github.com/bluekitchen/btstack/tree/master/port/samv71-xplained-atwilc3000) | [SAMV71 Ultra Xplained Ultra](http://www.atmel.com/tools/atsamv71-xult.aspx) evaluation kit with [ATWILC3000 SHIELD](http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATWILC3000-SHLD)
[<img src="http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=port-samv71-xplained-atwilc3000-master">](https://buildbot.bluekitchen-gmbh.com/btstack/builders/port-samv71-xplained-atwilc3000-master)| [samv71-xplained-atwilc3000](https://github.com/bluekitchen/btstack/tree/master/port/samv71-xplained-atwilc3000) | [SAMV71 Ultra Xplained Ultra](http://www.atmel.com/tools/atsamv71-xult.aspx) evaluation kit with [ATWILC3000 SHIELD](http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATWILC3000-SHLD)
[<img src="http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=port-stm32-f103rb-nucleo-master">](https://buildbot.bluekitchen-gmbh.com/btstack/builders/port-stm32-f103rb-nucleo-master) | [stm32-f103rb-nucleo](https://github.com/bluekitchen/btstack/tree/master/port/stm32-f103rb-nucleo) | [STM32 Nucleo development board NUCLEO-F103RB](http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF259875) with [Bluetooth CC2564 Module Evaluation Board](http://www.ti.com/tool/cc2564modnem) and [EM Adapter BoosterPack](http://www.ti.com/tool/boost-ccemadapter) with additional 32768Hz quartz oscillator
No build Server | [stm32-f4discovery-cc2564b](https://github.com/bluekitchen/btstack/tree/master/port/stm32-f4discovery-cc256x) | [STM32 F4 Discovery Board](http://www.st.com/en/evaluation-tools/stm32f4discovery.html) with [CC256xEM Bluetooth Adapter Kit for ST](https://store.ti.com/CC256XEM-STADAPT-CC256xEM-Bluetooth-Adapter-Kit-P45158.aspx) and [CC2564B Dual-mode Bluetooth® Controller Evaluation Module](https://store.ti.com/cc2564modnem.aspx)
No build Server | [stm32-l053rb-em9304](https://github.com/bluekitchen/btstack/tree/master/port/stm32-l053rb-em9304) | EM9304 DVK: [STM32 Nucleo development board NUCELO-L053R](http://www.st.com/en/evaluation-tools/nucleo-l053r8.html) with [EM9304 Bluetooth Controller](http://www.emmicroelectronic.com/products/wireless-rf/standard-protocols/em9304)
@@ -36,6 +36,8 @@ COMMON += \
l2cap.c \
l2cap_signaling.c \
btstack_tlv.c \
btstack_crypto.c \
uECC.c \
CLASSIC += \
btstack_link_key_db_memory.c \
@@ -74,9 +76,6 @@ MBEDTLS = \
memory_buffer_alloc.c \
platform.c \
MICROECC = \
uECC.c
# List of files for Bluedroid SBC codec
include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
@@ -167,7 +166,7 @@ EXAMPLES_USING_LE = \
CORE_OBJ = $(CORE:.c=.o)
COMMON_OBJ = $(COMMON:.c=.o)
CLASSIC_OBJ = $(CLASSIC:.c=.o)
SM_OBJ = $(SM:.c=.o) $(MICROECC:.c=.o)
SM_OBJ = $(SM:.c=.o)
ATT_OBJ = $(ATT:.c=.o)
GATT_CLIENT_OBJ = $(GATT_CLIENT:.c=.o)
GATT_SERVER_OBJ = $(GATT_SERVER:.c=.o)
@@ -765,7 +765,10 @@ static void avrcp_controller_packet_handler(uint8_t packet_type, uint16_t channe
if (!avrcp_cid) return;
// ignore INTERIM status
if (status == AVRCP_CTYPE_RESPONSE_INTERIM) return;
if (status == AVRCP_CTYPE_RESPONSE_INTERIM){
printf(" INTERIM response \n");
return;
}
printf("AVRCP demo: command status: %s, ", avrcp_ctype2str(status));
switch (packet[2]){
@@ -982,6 +985,9 @@ static void show_usage(void){
printf("X - disable repeat mode\n");
printf("z - shuffle all tracks\n");
printf("Z - disable shuffle mode\n");
printf("a/A - register/deregister TRACK_CHANGED\n");
printf("---\n");
}
#endif
@@ -1050,19 +1056,19 @@ static void stdin_process(char cmd){
break;
case 'u':
printf(" - start fast forward\n");
status = avrcp_controller_start_fast_forward(avrcp_cid);
status = avrcp_controller_press_and_hold_fast_forward(avrcp_cid);
break;
case 'U':
printf(" - stop fast forward\n");
status = avrcp_controller_stop_fast_forward(avrcp_cid);
status = avrcp_controller_release_press_and_hold_cmd(avrcp_cid);
break;
case 'n':
printf(" - start rewind\n");
status = avrcp_controller_start_rewind(avrcp_cid);
status = avrcp_controller_press_and_hold_rewind(avrcp_cid);
break;
case 'N':
printf(" - stop rewind\n");
status = avrcp_controller_stop_rewind(avrcp_cid);
status = avrcp_controller_release_press_and_hold_cmd(avrcp_cid);
break;
case 'i':
printf(" - forward\n");
@@ -1116,6 +1122,15 @@ static void stdin_process(char cmd){
printf(" - disable shuffle mode\n");
status = avrcp_controller_set_shuffle_mode(avrcp_cid, AVRCP_SHUFFLE_MODE_OFF);
break;
case 'a':
printf("AVRCP: enable notification TRACK_CHANGED\n");
avrcp_controller_enable_notification(avrcp_cid, AVRCP_NOTIFICATION_EVENT_TRACK_CHANGED);
break;
case 'A':
printf("AVRCP: disable notification TRACK_CHANGED\n");
avrcp_controller_disable_notification(avrcp_cid, AVRCP_NOTIFICATION_EVENT_TRACK_CHANGED);
break;
default:
show_usage();
return;
@@ -85,7 +85,7 @@ static void gap_le_advertisements_setup(void){
*/
/* LISTING_START(GAPLEAdvDataTypesAndFlags): Advertising data types and flags */
static char * ad_types[] = {
static const char * ad_types[] = {
"",
"Flags",
"Incomplete List of 16-bit Service Class UUIDs",
@@ -115,7 +115,7 @@ static char * ad_types[] = {
"Advertising Interval"
};
static char * flags[] = {
static const char * flags[] = {
"LE Limited Discoverable Mode",
"LE General Discoverable Mode",
"BR/EDR Not Supported",
@@ -186,10 +186,12 @@ static void sco_demo_sine_wave_int16_at_16000_hz_host_endian(unsigned int num_sa
}
}
#define MAX_NUM_SAMPLES (16*8)
static void sco_demo_msbc_fill_sine_audio_frame(void){
if (!hfp_msbc_can_encode_audio_frame_now()) return;
int num_samples = hfp_msbc_num_audio_samples_per_frame();
int16_t sample_buffer[num_samples];
if (num_samples > MAX_NUM_SAMPLES) return;
int16_t sample_buffer[MAX_NUM_SAMPLES];
sco_demo_sine_wave_int16_at_16000_hz_host_endian(num_samples, sample_buffer);
hfp_msbc_encode_audio_frame(sample_buffer);
num_audio_frames++;
@@ -44,17 +44,26 @@
*
*/
#include "hal_stdin.h"
#include "btstack_config.h"
#include "btstack_stdin.h"
#include "btstack_run_loop.h"
#include "btstack_run_loop_embedded.h"
volatile int stdin_character_received;
volatile char stdin_character;
#ifdef ENABLE_SEGGER_RTT
#include "SEGGER_RTT.h"
#else
#include "hal_stdin.h"
#endif
static void (*stdin_handler)(char c);
static btstack_data_source_t stdin_data_source;
#ifndef ENABLE_SEGGER_RTT
volatile int stdin_character_received;
volatile char stdin_character;
static void btstack_stdin_handler(char c){
stdin_character = c;
stdin_character_received = 1;
@@ -63,12 +72,21 @@ static void btstack_stdin_handler(char c){
static void btstack_stdin_process(struct btstack_data_source *ds, btstack_data_source_callback_type_t callback_type){
if (!stdin_character_received) return;
if (stdin_handler){
(*stdin_handler)(stdin_character);
}
(*stdin_handler)(stdin_character);
stdin_character_received = 0;
}
#else
static void btstack_stdin_process(struct btstack_data_source *ds, btstack_data_source_callback_type_t callback_type){
if (SEGGER_RTT_HasKey()){
int stdin_character = SEGGER_RTT_GetKey();
(*stdin_handler)((uint8_t)stdin_character);
}
}
#endif
void btstack_stdin_setup(void (*handler)(char c)){
// set handler
stdin_handler = handler;
@@ -78,6 +96,8 @@ void btstack_stdin_setup(void (*handler)(char c)){
btstack_run_loop_enable_data_source_callbacks(&stdin_data_source, DATA_SOURCE_CALLBACK_POLL);
btstack_run_loop_add_data_source(&stdin_data_source);
// start receiving
#ifndef ENABLE_SEGGER_RTT
// start receiving via hal_stdin.h
hal_stdin_setup(&btstack_stdin_handler);
#endif
}
@@ -105,35 +105,20 @@ VPATH += ${AM_SoftwareRoot}/third_party/btstack/src
VPATH += ${AM_SoftwareRoot}/third_party/btstack/src/ble
VPATH += ${AM_SoftwareRoot}/third_party/btstack/src/ble/gatt-service
SRC += ad_parser.c
SRC += ancs_client.c
SRC += att_db.c
SRC += att_dispatch.c
SRC += att_server.c
SRC += battery_service_server.c
SRC += btstack_em9304_spi_embedded.c
SRC += btstack_linked_list.c
SRC += btstack_memory.c
SRC += btstack_memory_pool.c
SRC += btstack_port.c
SRC += btstack_ring_buffer.c
SRC += btstack_run_loop.c
SRC += btstack_run_loop_embedded.c
SRC += btstack_tlv.c
SRC += btstack_uart_block_embedded.c
SRC += btstack_util.c
SRC += device_information_service_server.c
SRC += gatt_client.c
SRC += hci.c
SRC += hci_cmd.c
SRC += hci_dump.c
SRC += hci_transport_em9304_spi.c
SRC += l2cap.c
SRC += l2cap_signaling.c
SRC += le_device_db_memory.c
SRC += sm.c
SRC += uECC.c
-include ${AM_SoftwareRoot}/third_party/btstack/src/Makefile.inc
-include ${AM_SoftwareRoot}/third_party/btstack/src/ble/Makefile.inc
-include ${AM_SoftwareRoot}/third_party/btstack/src/ble/gatt-service/Makefile.inc
SRC += $(SRC_FILES)
SRC += $(filter-out att_db_util.c le_device_db_tlv.c,$(SRC_BLE_FILES))
SRC += $(SRC_BLE_GATT_SERVICE_FILES)
SRC += $(TARGET).c
SRC += am_util_delay.c
@@ -9,7 +9,7 @@ VERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' ${BTSTACK_ROOT}/platfo
BTSTACK_PACKAGE=/tmp/btstack
ARCHIVE=btstack-arduino-${VERSION}.zip
SRC_FILES = btstack_memory.c btstack_linked_list.c btstack_memory_pool.c btstack_run_loop.c
SRC_FILES = btstack_memory.c btstack_linked_list.c btstack_memory_pool.c btstack_run_loop.c btstack_crypto.c
SRC_FILES += hci_dump.c hci.c hci_cmd.c btstack_util.c l2cap.c ad_parser.c hci_transport_h4.c
BLE_FILES = att_db.c att_server.c att_dispatch.c att_db_util.c le_device_db_memory.c gatt_client.c
BLE_FILES += sm.c ancs_client.h ancs_client.c
@@ -48,6 +48,7 @@ BTdaemon_SOURCES = \
att_dispatch.c \
att_server.c \
bnep.c \
btstack_crypto.c \
btstack_memory.c \
btstack_memory_pool.c \
btstack_tlv.c \
@@ -364,8 +364,9 @@ int app_main(void){
// init HCI
hci_init(transport_get_instance(), NULL);
// setup TLV ESP32 implementation
// setup TLV ESP32 implementation and register with system
const btstack_tlv_t * btstack_tlv_impl = btstack_tlv_esp32_get_instance();
btstack_tlv_set_instance(btstack_tlv_impl, NULL);
// setup Link Key DB using TLV
const btstack_link_key_db_t * btstack_link_key_db = btstack_link_key_db_tlv_get_instance(btstack_tlv_impl, NULL);
Oops, something went wrong.

0 comments on commit bd82499

Please sign in to comment.