mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-23 19:20:51 +00:00
example: init SM if LE supported to avoid issue with Android Cross-Transport Key-Derivation
This commit is contained in:
parent
9d65c99253
commit
8c9bb29ec2
@ -12,6 +12,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
### Fixed
|
||||
### Changed
|
||||
|
||||
## Release v1.5.1
|
||||
|
||||
### Fixed
|
||||
- pbap_client: support disconnect while operation is ongoing
|
||||
|
||||
### Changed
|
||||
- Example: init SM if LE supported to avoid issue with Android Cross-Transport Key-Derivation
|
||||
|
||||
|
||||
## Release v1.5.0
|
||||
|
||||
|
@ -213,7 +213,14 @@ static void stdin_process(char cmd);
|
||||
#endif
|
||||
|
||||
static int a2dp_and_avrcp_setup(void){
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// Initialize AVDTP Sink
|
||||
a2dp_sink_init();
|
||||
a2dp_sink_register_packet_handler(&a2dp_sink_packet_handler);
|
||||
|
@ -249,10 +249,17 @@ static void stdin_process(char cmd);
|
||||
static void a2dp_demo_hexcmod_configure_sample_rate(int sample_rate);
|
||||
|
||||
static int a2dp_source_and_avrcp_services_init(void){
|
||||
|
||||
// Request role change on reconnecting headset to always use them in slave mode
|
||||
hci_set_master_slave_policy(0);
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// Initialize A2DP Source
|
||||
a2dp_source_init();
|
||||
a2dp_source_register_packet_handler(&a2dp_source_packet_handler);
|
||||
|
@ -246,6 +246,11 @@ int btstack_main(int argc, const char * argv[]){
|
||||
// Initialize L2CAP.
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
a2dp_sink_init();
|
||||
a2dp_sink_register_packet_handler(&a2dp_sink_packet_handler);
|
||||
|
||||
|
@ -77,6 +77,13 @@ int btstack_main(int argc, const char * argv[]){
|
||||
hci_event_callback_registration.callback = &packet_handler;
|
||||
hci_add_event_handler(&hci_event_callback_registration);
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// turn on!
|
||||
hci_power_control(HCI_POWER_ON);
|
||||
|
||||
|
@ -706,6 +706,11 @@ int btstack_main(int argc, const char * argv[]){
|
||||
// L2CAP
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
uint16_t supported_features =
|
||||
(1<<HFP_AGSF_ESCO_S4) |
|
||||
(1<<HFP_AGSF_HF_INDICATORS) |
|
||||
|
@ -684,6 +684,11 @@ int btstack_main(int argc, const char * argv[]){
|
||||
// init L2CAP
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
uint16_t hf_supported_features =
|
||||
(1<<HFP_HFSF_ESCO_S4) |
|
||||
(1<<HFP_HFSF_CLI_PRESENTATION_CAPABILITY) |
|
||||
|
@ -138,10 +138,15 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
|
||||
static void hid_host_setup(void){
|
||||
|
||||
// Initialize L2CAP
|
||||
// Initialize L2CAP
|
||||
l2cap_init();
|
||||
|
||||
// Initialize HID Host
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// Initialize HID Host
|
||||
hid_host_init(hid_descriptor_storage, sizeof(hid_descriptor_storage));
|
||||
hid_host_register_packet_handler(packet_handler);
|
||||
|
||||
|
@ -408,6 +408,11 @@ int btstack_main(int argc, const char * argv[]){
|
||||
// L2CAP
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// SDP Server
|
||||
sdp_init();
|
||||
memset(hid_service_buffer, 0, sizeof(hid_service_buffer));
|
||||
|
@ -297,6 +297,11 @@ int btstack_main(int argc, const char * argv[]){
|
||||
// L2CAP
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// SDP Server
|
||||
sdp_init();
|
||||
memset(hid_service_buffer, 0, sizeof(hid_service_buffer));
|
||||
|
@ -295,6 +295,11 @@ int btstack_main(int argc, const char * argv[]){
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
sdp_init();
|
||||
|
||||
memset((uint8_t *)hsp_service_buffer, 0, sizeof(hsp_service_buffer));
|
||||
|
@ -277,6 +277,11 @@ int btstack_main(int argc, const char * argv[]){
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
sdp_init();
|
||||
memset(hsp_service_buffer, 0, sizeof(hsp_service_buffer));
|
||||
hsp_hs_create_sdp_record(hsp_service_buffer, 0x10001, rfcomm_channel_nr, hsp_hs_service_name, 0);
|
||||
|
@ -175,6 +175,11 @@ static void pan_bnep_setup(void){
|
||||
// Initialize L2CAP
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// Initialize BNEP
|
||||
bnep_init();
|
||||
|
||||
|
@ -112,9 +112,13 @@ static void network_send_packet_callback(const uint8_t * packet, uint16_t size);
|
||||
|
||||
static void panu_setup(void){
|
||||
|
||||
// Initialize L2CAP
|
||||
// Initialize L2CAP
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// init SDP, create record for PANU and register with SDP
|
||||
sdp_init();
|
||||
|
@ -54,12 +54,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "btstack_run_loop.h"
|
||||
#include "l2cap.h"
|
||||
#include "classic/rfcomm.h"
|
||||
#include "btstack_event.h"
|
||||
#include "classic/goep_client.h"
|
||||
#include "classic/pbap_client.h"
|
||||
#include "btstack.h"
|
||||
|
||||
#ifdef HAVE_BTSTACK_STDIN
|
||||
#include "btstack_stdin.h"
|
||||
@ -370,13 +365,17 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
|
||||
int btstack_main(int argc, const char * argv[]);
|
||||
int btstack_main(int argc, const char * argv[]){
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
|
||||
// init L2CAP
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
// init RFCOM
|
||||
rfcomm_init();
|
||||
|
||||
|
@ -90,6 +90,11 @@ static void spp_service_setup(void){
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
rfcomm_init();
|
||||
rfcomm_register_service(packet_handler, RFCOMM_SERVER_CHANNEL, 0xffff); // reserved channel, mtu limited by l2cap
|
||||
|
||||
|
@ -200,6 +200,13 @@ int btstack_main(int argc, const char * argv[]){
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
spp_service_setup();
|
||||
one_shot_timer_setup();
|
||||
|
||||
|
@ -283,6 +283,11 @@ int btstack_main(int argc, const char * argv[])
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
rfcomm_init();
|
||||
rfcomm_register_service(packet_handler, RFCOMM_SERVER_CHANNEL, 0xffff);
|
||||
|
||||
|
@ -392,6 +392,11 @@ int btstack_main(int argc, const char * argv[]){
|
||||
|
||||
l2cap_init();
|
||||
|
||||
#ifdef ENABLE_BLE
|
||||
// Initialize LE Security Manager. Needed for cross-transport key derivation
|
||||
sm_init();
|
||||
#endif
|
||||
|
||||
rfcomm_init();
|
||||
|
||||
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM
|
||||
|
@ -129,6 +129,7 @@
|
||||
#include "classic/btstack_sbc.h"
|
||||
#include "classic/device_id_server.h"
|
||||
#include "classic/gatt_sdp.h"
|
||||
#include "classic/goep_client.h"
|
||||
#include "classic/hfp.h"
|
||||
#include "classic/hfp_ag.h"
|
||||
#include "classic/hfp_hf.h"
|
||||
@ -137,6 +138,7 @@
|
||||
#include "classic/hsp_ag.h"
|
||||
#include "classic/hsp_hs.h"
|
||||
#include "classic/pan.h"
|
||||
#include "classic/pbap_client.h"
|
||||
#include "classic/rfcomm.h"
|
||||
#include "classic/sdp_client.h"
|
||||
#include "classic/sdp_client_rfcomm.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user