From 0e7846ca8016f3ebf106dc7b24e0055876b9e33b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sat, 26 Mar 2016 23:00:17 +0100 Subject: [PATCH 01/74] cc256x: avoid sending random HCI at end of init script --- chipset-cc256x/convert_bts_init_scripts.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chipset-cc256x/convert_bts_init_scripts.py b/chipset-cc256x/convert_bts_init_scripts.py index d15db25f5..71a9b3c12 100755 --- a/chipset-cc256x/convert_bts_init_scripts.py +++ b/chipset-cc256x/convert_bts_init_scripts.py @@ -14,7 +14,7 @@ CC256x init script conversion tool for use with BTstack, v0.1 Copyright 2012-2014 BlueKitchen GmbH ''') -usage = '''This script perpares init scripts for TI's +usage = '''This script prepares init scripts for TI's CC256x chipsets for use with BTstack . Please download the Service Pack for your module from http://processors.wiki.ti.com/index.php/CC256x_Downloads @@ -47,7 +47,7 @@ def append_power_vector_gfsk(additions, str_list, data_indent): str_list.append("0x01, 0x82, 0xfd, 0x14, 0x00, 0x9c, 0x18, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xdc,\n"); str_list.append(data_indent) str_list.append("0xe6, 0xf0, 0xfa, 0x04, 0x0e, 0x18, 0xff, 0x00, 0x00,\n\n"); - return 25 + return 24 def append_power_vector_edr2(additions, str_list, data_indent): additions.append("- added HCI_VS_SET_POWER_VECTOR(EDR2) template") @@ -57,7 +57,7 @@ def append_power_vector_edr2(additions, str_list, data_indent): str_list.append("0x01, 0x82, 0xfd, 0x14, 0x01, 0x9c, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xd8, \n"); str_list.append(data_indent) str_list.append("0xe2, 0xec, 0xf6, 0x00, 0x0a, 0x14, 0xff, 0x00, 0x00,\n\n"); - return 25 + return 24 def append_power_vector_edr3(additions, str_list, data_indent): additions.append("- added HCI_VS_SET_POWER_VECTOR(EDR3) template") @@ -67,7 +67,7 @@ def append_power_vector_edr3(additions, str_list, data_indent): str_list.append("0x01, 0x82, 0xfd, 0x14, 0x02, 0x9c, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xd8,\n"); str_list.append(data_indent) str_list.append("0xe2, 0xec, 0xf6, 0x00, 0x0a, 0x14, 0xff, 0x00, 0x00,\n\n"); - return 25 + return 24 def append_class2_single_power(additions, str_list, data_indent): additions.append("- added HCI_VS_SET_CLASS2_SINGLE_POWER template") From 9d46808c46e78159a22ab85bf233d3bd0435fc24 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sun, 27 Mar 2016 22:34:29 +0200 Subject: [PATCH 02/74] gap: pass le_connection_parameter_range_t as pointer --- ble/l2cap_le.c | 2 +- src/hci.c | 8 ++++---- src/hci.h | 4 ++-- src/l2cap.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ble/l2cap_le.c b/ble/l2cap_le.c index e04c01e06..0c4749811 100644 --- a/ble/l2cap_le.c +++ b/ble/l2cap_le.c @@ -310,7 +310,7 @@ void l2cap_acl_handler( uint8_t *packet, uint16_t size ){ if (connection){ int update_parameter = 1; le_connection_parameter_range_t existing_range; - gap_le_get_connection_parameter_range(existing_range); + gap_le_get_connection_parameter_range(&existing_range); uint16_t le_conn_interval_min = READ_BT_16(packet,12); uint16_t le_conn_interval_max = READ_BT_16(packet,14); uint16_t le_conn_latency = READ_BT_16(packet,16); diff --git a/src/hci.c b/src/hci.c index 181b01109..c609b9f3b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -135,8 +135,8 @@ static hci_connection_t * create_connection_for_bd_addr_and_type(bd_addr_t addr, * * @return le connection parameter range struct */ -void gap_le_get_connection_parameter_range(le_connection_parameter_range_t range){ - range = hci_stack->le_connection_parameter_range; +void gap_le_get_connection_parameter_range(le_connection_parameter_range_t * range){ + *range = hci_stack->le_connection_parameter_range; } /** @@ -144,8 +144,8 @@ void gap_le_get_connection_parameter_range(le_connection_parameter_range_t range * */ -void gap_le_set_connection_parameter_range(le_connection_parameter_range_t range){ - hci_stack->le_connection_parameter_range = range; +void gap_le_set_connection_parameter_range(le_connection_parameter_range_t * range){ + hci_stack->le_connection_parameter_range = *range; } /** diff --git a/src/hci.h b/src/hci.h index 48b3cab05..9cf1cab60 100644 --- a/src/hci.h +++ b/src/hci.h @@ -859,8 +859,8 @@ int hci_remote_eSCO_supported(hci_con_handle_t con_handle); /* API_START */ -void gap_le_get_connection_parameter_range(le_connection_parameter_range_t range); -void gap_le_set_connection_parameter_range(le_connection_parameter_range_t range); +void gap_le_get_connection_parameter_range(le_connection_parameter_range_t * range); +void gap_le_set_connection_parameter_range(le_connection_parameter_range_t * range); /* LE Client Start */ diff --git a/src/l2cap.c b/src/l2cap.c index 574d01221..f3bae4c1c 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -1421,7 +1421,7 @@ static void l2cap_acl_handler( uint8_t *packet, uint16_t size ){ } int update_parameter = 1; le_connection_parameter_range_t existing_range; - gap_le_get_connection_parameter_range(existing_range); + gap_le_get_connection_parameter_range(&existing_range); uint16_t le_conn_interval_min = READ_BT_16(packet,12); uint16_t le_conn_interval_max = READ_BT_16(packet,14); uint16_t le_conn_latency = READ_BT_16(packet,16); From 6a3b8c39b0fd975bcaaa9269379498bfa4f6b7d3 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 28 Mar 2016 12:19:40 +0200 Subject: [PATCH 03/74] hfp_hf: remove unused var, fix compile --- src/hfp_hf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/hfp_hf.c b/src/hfp_hf.c index 905bec25d..2870e0cab 100644 --- a/src/hfp_hf.c +++ b/src/hfp_hf.c @@ -850,7 +850,6 @@ static void hfp_ag_slc_established(hfp_connection_t * hfp_connection){ static void hfp_hf_switch_on_ok(hfp_connection_t *hfp_connection){ hfp_connection->ok_pending = 0; - int done = 1; switch (hfp_connection->state){ case HFP_W4_EXCHANGE_SUPPORTED_FEATURES: if (has_codec_negotiation_feature(hfp_connection)){ @@ -943,12 +942,10 @@ static void hfp_hf_switch_on_ok(hfp_connection_t *hfp_connection){ hfp_emit_event(hfp_callback, HFP_SUBEVENT_CODECS_CONNECTION_COMPLETE, 0); break; default: - done = 0; break; } break; default: - done = 0; break; } @@ -1055,7 +1052,7 @@ static void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8 hfp_run_for_context(hfp_connection); } -static void hfp_run(){ +static void hfp_run(void){ linked_list_iterator_t it; linked_list_iterator_init(&it, hfp_get_connections()); while (linked_list_iterator_has_next(&it)){ From 40fcb3ee0ad6c3df82458fbd86360513f29a30d6 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 28 Mar 2016 12:22:05 +0200 Subject: [PATCH 04/74] fix fn() prototypes --- ble/sm_minimal.c | 2 +- example/embedded/hfp_ag_demo.c | 2 +- example/embedded/hfp_hf_demo.c | 2 +- platforms/posix/src/hci_transport_h2_libusb.c | 2 +- platforms/posix/src/hci_transport_h4.c | 2 +- platforms/posix/src/hci_transport_h5.c | 2 +- src/hci.c | 2 +- src/hfp.c | 2 +- src/hfp_ag.c | 8 +-- test/gatt_client/gatt_client_test.c | 4 +- test/gatt_client/le_central.c | 6 +-- test/gatt_client/mock.c | 2 +- test/hfp/hfp_ag_client_test.c | 4 +- test/hfp/hfp_hf_client_test.c | 4 +- test/hfp/mock.c | 8 +-- test/hfp/test_sequences.c | 54 +++++++++---------- test/pts/ble_central_test.c | 2 +- test/pts/ble_peripheral_test.c | 6 +-- test/pts/bnep_test.c | 2 +- test/pts/classic_test.c | 2 +- test/pts/hfp_ag_test.c | 2 +- test/pts/hfp_hf_test.c | 2 +- test/pts/hsp_hs_test.c | 2 +- test/pts/l2cap_test.c | 2 +- .../remote_device_db_fs_test.c | 2 +- test/sdp_client/sdp_rfcomm_query.c | 2 +- 26 files changed, 65 insertions(+), 65 deletions(-) diff --git a/ble/sm_minimal.c b/ble/sm_minimal.c index 499d8ee12..a8c7f81dd 100644 --- a/ble/sm_minimal.c +++ b/ble/sm_minimal.c @@ -49,7 +49,7 @@ // SM internal types and globals // -static void sm_run(); +static void sm_run(void); // used to notify applicationss that user interaction is neccessary, see sm_notify_t below static btstack_packet_handler_t sm_client_packet_handler = NULL; diff --git a/example/embedded/hfp_ag_demo.c b/example/embedded/hfp_ag_demo.c index 842e08ad8..d5788d74f 100644 --- a/example/embedded/hfp_ag_demo.c +++ b/example/embedded/hfp_ag_demo.c @@ -108,7 +108,7 @@ static hfp_generic_status_indicator_t hf_indicators[] = { char cmd; // prototypes -static void show_usage(); +static void show_usage(void); // GAP INQUIRY diff --git a/example/embedded/hfp_hf_demo.c b/example/embedded/hfp_hf_demo.c index 838a7b4e2..cdf8e008d 100644 --- a/example/embedded/hfp_hf_demo.c +++ b/example/embedded/hfp_hf_demo.c @@ -89,7 +89,7 @@ static uint16_t indicators[1] = {0x01}; char cmd; // prototypes -static void show_usage(); +static void show_usage(void); // Testig User Interface static void show_usage(void){ diff --git a/platforms/posix/src/hci_transport_h2_libusb.c b/platforms/posix/src/hci_transport_h2_libusb.c index bf3c079af..d97c25b15 100644 --- a/platforms/posix/src/hci_transport_h2_libusb.c +++ b/platforms/posix/src/hci_transport_h2_libusb.c @@ -1025,7 +1025,7 @@ static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ } // get usb singleton -hci_transport_t * hci_transport_usb_instance() { +hci_transport_t * hci_transport_usb_instance(void) { if (!hci_transport_usb) { hci_transport_usb = (hci_transport_t*) malloc( sizeof(hci_transport_t)); hci_transport_usb->open = usb_open; diff --git a/platforms/posix/src/hci_transport_h4.c b/platforms/posix/src/hci_transport_h4.c index 18b7a529c..55b0e1a11 100644 --- a/platforms/posix/src/hci_transport_h4.c +++ b/platforms/posix/src/hci_transport_h4.c @@ -332,7 +332,7 @@ static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ } // get h4 singleton -hci_transport_t * hci_transport_h4_instance() { +hci_transport_t * hci_transport_h4_instance(void) { if (hci_transport_h4 == NULL) { hci_transport_h4 = (hci_transport_h4_t*)malloc( sizeof(hci_transport_h4_t)); hci_transport_h4->ds = NULL; diff --git a/platforms/posix/src/hci_transport_h5.c b/platforms/posix/src/hci_transport_h5.c index 983555a65..597a985e9 100644 --- a/platforms/posix/src/hci_transport_h5.c +++ b/platforms/posix/src/hci_transport_h5.c @@ -297,7 +297,7 @@ static void dummy_handler(uint8_t *packet, int size){ } // get h5 singleton -hci_transport_t * hci_transport_h5_instance() { +hci_transport_t * hci_transport_h5_instance(void) { if (hci_transport_h5 == NULL) { hci_transport_h5 = malloc( sizeof(hci_transport_h5_t)); hci_transport_h5->ds = NULL; diff --git a/src/hci.c b/src/hci.c index c609b9f3b..d4cccec33 100644 --- a/src/hci.c +++ b/src/hci.c @@ -3461,7 +3461,7 @@ void hci_set_sco_voice_setting(uint16_t voice_setting){ * @brief Get SCO Voice Setting * @return current voice setting */ -uint16_t hci_get_sco_voice_setting(){ +uint16_t hci_get_sco_voice_setting(void){ return hci_stack->sco_voice_setting; } diff --git a/src/hfp.c b/src/hfp.c index 04ae5716b..b39e01fc5 100644 --- a/src/hfp.c +++ b/src/hfp.c @@ -218,7 +218,7 @@ static void hfp_emit_audio_connection_established_event(hfp_callback_t callback, (*callback)(event, sizeof(event)); } -linked_list_t * hfp_get_connections(){ +linked_list_t * hfp_get_connections(void){ return (linked_list_t *) &hfp_connections; } diff --git a/src/hfp_ag.c b/src/hfp_ag.c index 0b96bac43..81f87a1fd 100644 --- a/src/hfp_ag.c +++ b/src/hfp_ag.c @@ -139,7 +139,7 @@ void hfp_ag_register_packet_handler(hfp_callback_t callback){ hfp_callback = callback; } -static int use_in_band_tone(){ +static int use_in_band_tone(void){ return get_bit(hfp_supported_features, HFP_AGSF_IN_BAND_RING_TONE); } @@ -1005,7 +1005,7 @@ static void hfp_ag_trigger_terminate_call(void){ hfp_emit_simple_event(hfp_callback, HFP_SUBEVENT_CALL_TERMINATED); } -static void hfp_ag_set_callsetup_indicator(){ +static void hfp_ag_set_callsetup_indicator(void){ hfp_ag_indicator_t * indicator = get_ag_indicator_for_name("callsetup"); if (!indicator){ log_error("hfp_ag_set_callsetup_indicator: callsetup indicator is missing"); @@ -1013,7 +1013,7 @@ static void hfp_ag_set_callsetup_indicator(){ indicator->status = hfp_gsm_callsetup_status(); } -static void hfp_ag_set_callheld_indicator(){ +static void hfp_ag_set_callheld_indicator(void){ hfp_ag_indicator_t * indicator = get_ag_indicator_for_name("callheld"); if (!indicator){ log_error("hfp_ag_set_callheld_state: callheld indicator is missing"); @@ -1021,7 +1021,7 @@ static void hfp_ag_set_callheld_indicator(){ indicator->status = hfp_gsm_callheld_status(); } -static void hfp_ag_set_call_indicator(){ +static void hfp_ag_set_call_indicator(void){ hfp_ag_indicator_t * indicator = get_ag_indicator_for_name("call"); if (!indicator){ log_error("hfp_ag_set_call_state: call indicator is missing"); diff --git a/test/gatt_client/gatt_client_test.c b/test/gatt_client/gatt_client_test.c index b369731dc..d5ecaebef 100644 --- a/test/gatt_client/gatt_client_test.c +++ b/test/gatt_client/gatt_client_test.c @@ -72,8 +72,8 @@ static le_service_t included_services[50]; static le_characteristic_t characteristics[50]; static le_characteristic_descriptor_t descriptors[50]; -void mock_simulate_discover_primary_services_response(); -void mock_simulate_att_exchange_mtu_response(); +void mock_simulate_discover_primary_services_response(void); +void mock_simulate_att_exchange_mtu_response(void); void CHECK_EQUAL_ARRAY(const uint8_t * expected, uint8_t * actual, int size){ for (int i=0; i Date: Mon, 28 Mar 2016 15:19:31 +0200 Subject: [PATCH 05/74] att_server: directly process ATT Write Commands --- ble/att_server.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ble/att_server.c b/ble/att_server.c index 968fe436d..7b0f87347 100644 --- a/ble/att_server.c +++ b/ble/att_server.c @@ -340,11 +340,24 @@ static void att_packet_handler(uint8_t packet_type, uint16_t handle, uint8_t *pa return; } + // directly process commands + // note: signed write cannot be handled directly as authentication needs to be verified + if (packet[0] == ATT_WRITE_COMMAND){ + att_handle_request(&att_connection, packet, size, 0); + return; + } + // check size - if (size > sizeof(att_request_buffer)) return; + if (size > sizeof(att_request_buffer)) { + log_info("att_packet_handler: dropping att pdu 0x%02x as size %u > att_request_buffer %u", packet[0], size, (int) sizeof(att_request_buffer)); + return; + } // last request still in processing? - if (att_server_state != ATT_SERVER_IDLE) return; + if (att_server_state != ATT_SERVER_IDLE){ + log_info("att_packet_handler: skipping att pdu 0x%02x as server not idle (state %u)", packet[0], att_server_state); + return; + } // store request att_server_state = ATT_SERVER_REQUEST_RECEIVED; From 1532fd1ef9f98cdc072ff7dd7b988a0794d86789 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 30 Mar 2016 10:21:23 +0200 Subject: [PATCH 06/74] hfp_ag: fix sending outgoing cmds in chunks --- src/hfp_ag.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hfp_ag.c b/src/hfp_ag.c index 81f87a1fd..112966dd5 100644 --- a/src/hfp_ag.c +++ b/src/hfp_ag.c @@ -370,6 +370,7 @@ static int hfp_ag_cmd_via_generator(uint16_t cid, hfp_connection_t * hfp_connect // assumes: can send now == true // assumes: num segments > 0 + // assumes: individual segments are smaller than MTU rfcomm_reserve_packet_buffer(); int mtu = rfcomm_get_max_frame_size(cid); uint8_t * data = rfcomm_get_outgoing_buffer(); @@ -377,11 +378,11 @@ static int hfp_ag_cmd_via_generator(uint16_t cid, hfp_connection_t * hfp_connect int segment = start_segment; while (segment < num_segments){ int segment_len = get_segment_len(hfp_connection, segment); - if (offset + segment_len <= mtu){ - store_segment(hfp_connection, segment, data+offset); - offset += segment_len; - segment++; - } + if (offset + segment_len > mtu) break; + // append segement + store_segment(hfp_connection, segment, data+offset); + offset += segment_len; + segment++; } rfcomm_send_prepared(cid, offset); return segment; From 962127fa8633084d38bf92322dd6cb9a7776004a Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 11 Apr 2016 11:19:41 +0200 Subject: [PATCH 07/74] link to v0.9 builders + docs --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 205f6c293..0b5b72e74 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ It has been qualified with the the Bluetooth SIG for GAP, IOP, HFP, HSP, SPP, PA GATT, SM of the Bluetooth 4.2 LE Central and Peripheral roles (QD ID 25340). ## Documentation -- [HTML](http://bluekitchen-gmbh.com/btstack/) -- [PDF](http://bluekitchen-gmbh.com/btstack.pdf) +- [HTML](http://bluekitchen-gmbh.com/btstack/v0.9) +- [PDF](http://bluekitchen-gmbh.com/btstack_v0.9.pdf) ## Supported Protocols * L2CAP @@ -52,22 +52,22 @@ Coming next: HID, HOGP, A2DP, and more. #### Embedded Platforms: Status | Platform -------------- | ------ -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-ez430-rf2560-master) | [EZ430-RF256x Bluetooth Evaluation Tool for MSP430](http://www.ti.com/tool/ez430-rf256x) -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-msp-exp430f5438-cc2564b-master) | [MSP430F5438 Experimenter Board for MSP430](http://www.ti.com/tool/msp-exp430f5438) with [Bluetooth CC2564 Module Evaluation Board](http://www.ti.com/tool/cc2564modnem) -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-msp430f5229lp-cc2564b-master) | [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 -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-stm32-f103rb-nucleo-master) | [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 -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-pic32-harmony-master) | [Microchip's PIC32 Bluetooth Audio Development Kit](http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=DV320032) +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-ez430-rf2560-v0.9) | [EZ430-RF256x Bluetooth Evaluation Tool for MSP430](http://www.ti.com/tool/ez430-rf256x) +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-msp-exp430f5438-cc2564b-v0.9) | [MSP430F5438 Experimenter Board for MSP430](http://www.ti.com/tool/msp-exp430f5438) with [Bluetooth CC2564 Module Evaluation Board](http://www.ti.com/tool/cc2564modnem) +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-msp430f5229lp-cc2564b-v0.9) | [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 +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-stm32-f103rb-nucleo-v0.9) | [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 +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-pic32-harmony-v0.9) | [Microchip's PIC32 Bluetooth Audio Development Kit](http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=DV320032) #### Other Platforms: Status | Platform -------------- | ------ -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-posix-stlc2500d-master)| posix: Unix-based system talking to Bluetooth module via serial port -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-libusb-master)| libusb: Unix-based system talking via USB Bluetooth dongle -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-daemon-master)| daemon: TCP and Unix domain named socket client-server architecture supporting multiple clients -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=java-master)| java: Java wrapper for daemon -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-ios-master)| iOS: daemon for iOS jailbreak devices, C client-server API -![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-mtk-master)| mtk: daemon for rooted Android devices, based on Mediatek MT65xx processor, Java and C client-server API +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-posix-stlc2500d-v0.9)| posix: Unix-based system talking to Bluetooth module via serial port +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-libusb-v0.9)| libusb: Unix-fbased system talking via USB Bluetooth dongle +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-daemon-v0.9)| daemon: TCP and Unix domain named socket client-server architecture supporting multiple clients +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=java-v0.9)| java: Java wrapper for daemon +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-ios-v0.9)| iOS: daemon for iOS jailbreak devices, C client-server API +![buildstatus](http://buildbot.bluekitchen-gmbh.com/btstack/badge.png?builder=platform-mtk-v0.9)| mtk: daemon for rooted Android devices, based on Mediatek MT65xx processor, Java and C client-server API ## Supported Chipsets From 9cd88577a133787b5cd6253052b0c38714d300a5 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 11 Apr 2016 22:26:41 +0200 Subject: [PATCH 08/74] add link to migration notes --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c1be1c67..23657fee1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -**_Note: Major API Changes. For older projects, you may use the [v0.9 branch](https://github.com/bluekitchen/btstack/tree/v0.9)_** +**_Note: Major API Changes. For older projects, you may use the [v0.9 branch](https://github.com/bluekitchen/btstack/tree/v0.9). +Please see [Migration notes]([Migration notes]) _** # Welcome to BTstack From db00faf25be88e84360484b9ba5af4c578223359 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 18 Apr 2016 14:49:05 +0200 Subject: [PATCH 09/74] fix warnings --- platform/embedded/hci_transport_h4_embedded.c | 4 ++-- src/classic/hsp_ag.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/embedded/hci_transport_h4_embedded.c b/platform/embedded/hci_transport_h4_embedded.c index 103ac0c58..24f6750b6 100644 --- a/platform/embedded/hci_transport_h4_embedded.c +++ b/platform/embedded/hci_transport_h4_embedded.c @@ -254,13 +254,13 @@ static void h4_process(btstack_data_source_t *ds, btstack_data_source_callback_t packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event)); } - if (h4_state != H4_PACKET_RECEIVED) return 0; + if (h4_state != H4_PACKET_RECEIVED) return; packet_handler(hci_packet[0], &hci_packet[1], read_pos-1); h4_init_sm(); - return 0; + return; } static int h4_send_packet(uint8_t packet_type, uint8_t *packet, int size){ diff --git a/src/classic/hsp_ag.c b/src/classic/hsp_ag.c index 357c04299..3e953d452 100644 --- a/src/classic/hsp_ag.c +++ b/src/classic/hsp_ag.c @@ -227,7 +227,7 @@ void hsp_ag_create_sdp_record(uint8_t * service, uint32_t service_record_handle, } } -static int hsp_ag_send_str_over_rfcomm(uint16_t cid, char * command){ +static int hsp_ag_send_str_over_rfcomm(const uint16_t cid, char * command){ int err = rfcomm_send(cid, (uint8_t*) command, strlen(command)); if (err){ log_error("rfcomm_send_internal -> error 0X%02x", err); From 6a7f493ac537c641f693aed1969287d0f0d58269 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 18 Apr 2016 16:15:39 +0200 Subject: [PATCH 10/74] example/hsp: fix docu to refer to ENABLE_SCO_OVER_HCI --- example/hsp_ag_demo.c | 2 +- example/hsp_hs_demo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/hsp_ag_demo.c b/example/hsp_ag_demo.c index 2cc055903..79df9d4b1 100644 --- a/example/hsp_ag_demo.c +++ b/example/hsp_ag_demo.c @@ -88,7 +88,7 @@ static const uint8_t sine[] = { /* @section Audio Transfer Setup * * @text A pre-computed sine wave (160Hz) is used as the input audio signal. 160 Hz. - * To send and receive an audio signal, HAVE_SCO_OVER_HCI has to be defined. + * To send and receive an audio signal, ENABLE_SCO_OVER_HCI has to be defined. * * Tested working setups: * - Ubuntu 14 64-bit, CC2564B connected via FTDI USB-2-UART adapter, 921600 baud diff --git a/example/hsp_hs_demo.c b/example/hsp_hs_demo.c index b1dfa0a39..f1240b943 100644 --- a/example/hsp_hs_demo.c +++ b/example/hsp_hs_demo.c @@ -89,7 +89,7 @@ static const uint8_t sine[] = { /* @section Audio Transfer Setup * * @text A pre-computed sine wave (160Hz) is used as the input audio signal. 160 Hz. - * To send and receive an audio signal, HAVE_SCO_OVER_HCI has to be defined. + * To send and receive an audio signal, ENABLE_SCO_OVER_HCI has to be defined. * * Tested working setups: * - Ubuntu 14 64-bit, CC2564B connected via FTDI USB-2-UART adapter, 921600 baud From a3f81b3616fc4809498d6370de8837262c53ee13 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 20 Apr 2016 16:51:36 +0200 Subject: [PATCH 11/74] sm: use uint8_t[7] instead of struct for sm_pairing_packet_t to avoid to depend on packed structs --- src/ble/sm.c | 43 +++++++++++++++++++++++-------------------- src/ble/sm.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/hci.h | 10 +--------- 3 files changed, 68 insertions(+), 29 deletions(-) diff --git a/src/ble/sm.c b/src/ble/sm.c index 10341ef70..8ed3b74c6 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -531,7 +531,8 @@ static void sm_setup_tk(void){ // If both devices have out of band authentication data, then the Authentication // Requirements Flags shall be ignored when selecting the pairing method and the // Out of Band pairing method shall be used. - if (setup->sm_m_preq.oob_data_flag && setup->sm_s_pres.oob_data_flag){ + if (sm_pairing_packet_get_oob_data_flag(setup->sm_m_preq) + && sm_pairing_packet_get_oob_data_flag(setup->sm_s_pres)){ log_info("SM: have OOB data"); log_info_key("OOB", setup->sm_tk); setup->sm_stk_generation_method = OOB; @@ -544,20 +545,21 @@ static void sm_setup_tk(void){ // If both devices have not set the MITM option in the Authentication Requirements // Flags, then the IO capabilities shall be ignored and the Just Works association // model shall be used. - if ( ((setup->sm_m_preq.auth_req & SM_AUTHREQ_MITM_PROTECTION) == 0x00) && ((setup->sm_s_pres.auth_req & SM_AUTHREQ_MITM_PROTECTION) == 0)){ + if (((sm_pairing_packet_get_auth_req(setup->sm_m_preq) & SM_AUTHREQ_MITM_PROTECTION) == 0) + && ((sm_pairing_packet_get_auth_req(setup->sm_s_pres) & SM_AUTHREQ_MITM_PROTECTION) == 0)){ return; } // Also use just works if unknown io capabilites - if ((setup->sm_m_preq.io_capability > IO_CAPABILITY_KEYBOARD_DISPLAY) || (setup->sm_m_preq.io_capability > IO_CAPABILITY_KEYBOARD_DISPLAY)){ + if ((sm_pairing_packet_get_io_capability(setup->sm_m_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY) || (sm_pairing_packet_get_io_capability(setup->sm_m_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY)){ return; } // Otherwise the IO capabilities of the devices shall be used to determine the // pairing method as defined in Table 2.4. - setup->sm_stk_generation_method = stk_generation_method[setup->sm_s_pres.io_capability][setup->sm_m_preq.io_capability]; + setup->sm_stk_generation_method = stk_generation_method[sm_pairing_packet_get_io_capability(setup->sm_s_pres)][sm_pairing_packet_get_io_capability(setup->sm_m_preq)]; log_info("sm_setup_tk: master io cap: %u, slave io cap: %u -> method %u", - setup->sm_m_preq.io_capability, setup->sm_s_pres.io_capability, setup->sm_stk_generation_method); + sm_pairing_packet_get_io_capability(setup->sm_m_preq), sm_pairing_packet_get_io_capability(setup->sm_s_pres), setup->sm_stk_generation_method); } static int sm_key_distribution_flags_for_set(uint8_t key_set){ @@ -834,10 +836,10 @@ static int sm_key_distribution_all_received(sm_connection_t * sm_conn){ int recv_flags; if (sm_conn->sm_role){ // slave / responser - recv_flags = sm_key_distribution_flags_for_set(setup->sm_s_pres.initiator_key_distribution); + recv_flags = sm_key_distribution_flags_for_set(sm_pairing_packet_get_initiator_key_distribution(setup->sm_s_pres)); } else { // master / initiator - recv_flags = sm_key_distribution_flags_for_set(setup->sm_s_pres.responder_key_distribution); + recv_flags = sm_key_distribution_flags_for_set(sm_pairing_packet_get_responder_key_distribution(setup->sm_s_pres)); } log_debug("sm_key_distribution_all_received: received 0x%02x, expecting 0x%02x", setup->sm_key_distribution_received_set, recv_flags); return recv_flags == setup->sm_key_distribution_received_set; @@ -888,14 +890,14 @@ static void sm_init_setup(sm_connection_t * sm_conn){ memcpy(setup->sm_s_address, sm_conn->sm_peer_address, 6); int key_distribution_flags = sm_key_distribution_flags_for_auth_req(); - setup->sm_m_preq.initiator_key_distribution = key_distribution_flags; - setup->sm_m_preq.responder_key_distribution = key_distribution_flags; + sm_pairing_packet_set_initiator_key_distribution(setup->sm_m_preq, key_distribution_flags); + sm_pairing_packet_set_responder_key_distribution(setup->sm_m_preq, key_distribution_flags); } - local_packet->io_capability = sm_io_capabilities; - local_packet->oob_data_flag = have_oob_data; - local_packet->auth_req = sm_auth_req; - local_packet->max_encryption_key_size = sm_max_encryption_key_size; + sm_pairing_packet_set_io_capability(*local_packet, sm_io_capabilities); + sm_pairing_packet_set_oob_data_flag(*local_packet, have_oob_data); + sm_pairing_packet_set_auth_req(*local_packet, sm_auth_req); + sm_pairing_packet_set_max_encryption_key_size(*local_packet, sm_max_encryption_key_size); } static int sm_stk_generation_init(sm_connection_t * sm_conn){ @@ -905,15 +907,15 @@ static int sm_stk_generation_init(sm_connection_t * sm_conn){ if (sm_conn->sm_role){ // slave / responser remote_packet = &setup->sm_m_preq; - remote_key_request = setup->sm_m_preq.responder_key_distribution; + remote_key_request = sm_pairing_packet_get_responder_key_distribution(setup->sm_m_preq); } else { // master / initiator remote_packet = &setup->sm_s_pres; - remote_key_request = setup->sm_s_pres.initiator_key_distribution; + remote_key_request = sm_pairing_packet_get_initiator_key_distribution(setup->sm_s_pres); } // check key size - sm_conn->sm_actual_encryption_key_size = sm_calc_actual_encryption_key_size(remote_packet->max_encryption_key_size); + sm_conn->sm_actual_encryption_key_size = sm_calc_actual_encryption_key_size(sm_pairing_packet_get_max_encryption_key_size(*remote_packet)); if (sm_conn->sm_actual_encryption_key_size == 0) return SM_REASON_ENCRYPTION_KEY_SIZE; // setup key distribution @@ -1343,7 +1345,7 @@ static void sm_run(void){ } case SM_INITIATOR_PH1_SEND_PAIRING_REQUEST: - setup->sm_m_preq.code = SM_CODE_PAIRING_REQUEST; + sm_pairing_packet_set_code(setup->sm_m_preq, SM_CODE_PAIRING_REQUEST); connection->sm_engine_state = SM_INITIATOR_PH1_W4_PAIRING_RESPONSE; l2cap_send_connectionless(connection->sm_handle, L2CAP_CID_SECURITY_MANAGER_PROTOCOL, (uint8_t*) &setup->sm_m_preq, sizeof(sm_pairing_packet_t)); sm_timeout_reset(connection); @@ -1357,10 +1359,11 @@ static void sm_run(void){ case SM_RESPONDER_PH1_SEND_PAIRING_RESPONSE: // echo initiator for now - setup->sm_s_pres.code = SM_CODE_PAIRING_RESPONSE; + sm_pairing_packet_set_code(setup->sm_s_pres,SM_CODE_PAIRING_RESPONSE); key_distribution_flags = sm_key_distribution_flags_for_auth_req(); - setup->sm_s_pres.initiator_key_distribution = setup->sm_m_preq.initiator_key_distribution & key_distribution_flags; - setup->sm_s_pres.responder_key_distribution = setup->sm_m_preq.responder_key_distribution & key_distribution_flags; + sm_pairing_packet_set_initiator_key_distribution(setup->sm_s_pres, sm_pairing_packet_get_initiator_key_distribution(setup->sm_m_preq) & key_distribution_flags); + sm_pairing_packet_set_responder_key_distribution(setup->sm_s_pres, sm_pairing_packet_get_responder_key_distribution(setup->sm_m_preq) & key_distribution_flags); + connection->sm_engine_state = SM_RESPONDER_PH1_W4_PAIRING_CONFIRM; l2cap_send_connectionless(connection->sm_handle, L2CAP_CID_SECURITY_MANAGER_PROTOCOL, (uint8_t*) &setup->sm_s_pres, sizeof(sm_pairing_packet_t)); sm_timeout_reset(connection); diff --git a/src/ble/sm.h b/src/ble/sm.h index 87fd05823..5ded4ac26 100644 --- a/src/ble/sm.h +++ b/src/ble/sm.h @@ -53,6 +53,50 @@ typedef struct { bd_addr_type_t address_type; } sm_lookup_entry_t; +static inline uint8_t sm_pairing_packet_get_code(sm_pairing_packet_t packet){ + return packet[0]; +} +static inline uint8_t sm_pairing_packet_get_io_capability(sm_pairing_packet_t packet){ + return packet[1]; +} +static inline uint8_t sm_pairing_packet_get_oob_data_flag(sm_pairing_packet_t packet){ + return packet[2]; +} +static inline uint8_t sm_pairing_packet_get_auth_req(sm_pairing_packet_t packet){ + return packet[3]; +} +static inline uint8_t sm_pairing_packet_get_max_encryption_key_size(sm_pairing_packet_t packet){ + return packet[4]; +} +static inline uint8_t sm_pairing_packet_get_initiator_key_distribution(sm_pairing_packet_t packet){ + return packet[5]; +} +static inline uint8_t sm_pairing_packet_get_responder_key_distribution(sm_pairing_packet_t packet){ + return packet[6]; +} + +static inline void sm_pairing_packet_set_code(sm_pairing_packet_t packet, uint8_t code){ + packet[0] = code; +} +static inline void sm_pairing_packet_set_io_capability(sm_pairing_packet_t packet, uint8_t io_capability){ + packet[1] = io_capability; +} +static inline void sm_pairing_packet_set_oob_data_flag(sm_pairing_packet_t packet, uint8_t oob_data_flag){ + packet[2] = oob_data_flag; +} +static inline void sm_pairing_packet_set_auth_req(sm_pairing_packet_t packet, uint8_t auth_req){ + packet[3] = auth_req; +} +static inline void sm_pairing_packet_set_max_encryption_key_size(sm_pairing_packet_t packet, uint8_t max_encryption_key_size){ + packet[4] = max_encryption_key_size; +} +static inline void sm_pairing_packet_set_initiator_key_distribution(sm_pairing_packet_t packet, uint8_t initiator_key_distribution){ + packet[5] = initiator_key_distribution; +} +static inline void sm_pairing_packet_set_responder_key_distribution(sm_pairing_packet_t packet, uint8_t responder_key_distribution){ + packet[6] = responder_key_distribution; +} + /* API_START */ /** diff --git a/src/hci.h b/src/hci.h index b0e1a33c3..b5febacad 100644 --- a/src/hci.h +++ b/src/hci.h @@ -320,15 +320,7 @@ typedef enum { AUTHORIZATION_GRANTED } authorization_state_t; -typedef struct sm_pairing_packet { - uint8_t code; - uint8_t io_capability; - uint8_t oob_data_flag; - uint8_t auth_req; - uint8_t max_encryption_key_size; - uint8_t initiator_key_distribution; - uint8_t responder_key_distribution; -} sm_pairing_packet_t; +typedef uint8_t sm_pairing_packet_t[7]; // connection info available as long as connection exists typedef struct sm_connection { From 7f727f81e57a27995d56a495af217b3aff62c8c8 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 20 Apr 2016 16:52:49 +0200 Subject: [PATCH 12/74] sm: use just works if master or slave have unknown IO capabilities --- src/ble/sm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ble/sm.c b/src/ble/sm.c index 8ed3b74c6..5be638c38 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -551,7 +551,7 @@ static void sm_setup_tk(void){ } // Also use just works if unknown io capabilites - if ((sm_pairing_packet_get_io_capability(setup->sm_m_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY) || (sm_pairing_packet_get_io_capability(setup->sm_m_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY)){ + if ((sm_pairing_packet_get_io_capability(setup->sm_m_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY) || (sm_pairing_packet_get_io_capability(setup->sm_s_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY)){ return; } From b04800026f9e932c77bcab726d4342c46f3ae59f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 20 Apr 2016 16:57:41 +0200 Subject: [PATCH 13/74] sm: fix compile --- src/ble/sm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ble/sm.c b/src/ble/sm.c index 5be638c38..9d97c9e26 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -551,7 +551,7 @@ static void sm_setup_tk(void){ } // Also use just works if unknown io capabilites - if ((sm_pairing_packet_get_io_capability(setup->sm_m_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY) || (sm_pairing_packet_get_io_capability(setup->sm_s_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY)){ + if ((sm_pairing_packet_get_io_capability(setup->sm_m_preq) > IO_CAPABILITY_KEYBOARD_DISPLAY) || (sm_pairing_packet_get_io_capability(setup->sm_s_pres) > IO_CAPABILITY_KEYBOARD_DISPLAY)){ return; } From bb6944afd9b3ec354819e79194855d0a5d9b6e85 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 11:47:33 +0200 Subject: [PATCH 14/74] hfp: request rfcomm send event after connection created --- src/classic/hfp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/classic/hfp.c b/src/classic/hfp.c index 3e72da8b7..a60991183 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -490,6 +490,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet default: break; } + rfcomm_request_can_send_now_event(hfp_connection->rfcomm_cid); } break; From 473ac565d5bec808a27038120ea3e66bd9fae3dd Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 11:50:46 +0200 Subject: [PATCH 15/74] hfp_ag: fix sending of chunked AG Indicators --- src/classic/hfp_ag.c | 57 ++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/src/classic/hfp_ag.c b/src/classic/hfp_ag.c index 7b1dbaed3..f33b812d8 100644 --- a/src/classic/hfp_ag.c +++ b/src/classic/hfp_ag.c @@ -557,7 +557,6 @@ static int codecs_exchange_state_machine(hfp_connection_t * hfp_connection){ switch (hfp_connection->command){ case HFP_CMD_AVAILABLE_CODECS: - //printf("HFP_CODECS_RECEIVED_LIST \n"); if (hfp_connection->state < HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED){ hfp_connection->codecs_state = HFP_CODECS_RECEIVED_LIST; hfp_ag_ok(hfp_connection->rfcomm_cid); @@ -576,20 +575,17 @@ static int codecs_exchange_state_machine(hfp_connection_t * hfp_connection){ return 1; case HFP_CMD_TRIGGER_CODEC_CONNECTION_SETUP: - //printf(" HFP_CMD_TRIGGER_CODEC_CONNECTION_SETUP \n"); hfp_connection->codecs_state = HFP_CODECS_RECEIVED_TRIGGER_CODEC_EXCHANGE; hfp_ag_ok(hfp_connection->rfcomm_cid); return 1; case HFP_CMD_AG_SEND_COMMON_CODEC: - //printf(" HFP_CMD_AG_SEND_COMMON_CODEC \n"); hfp_connection->codecs_state = HFP_CODECS_AG_SENT_COMMON_CODEC; hfp_connection->suggested_codec = hfp_ag_suggest_codec(hfp_connection); hfp_ag_cmd_suggest_codec(hfp_connection->rfcomm_cid, hfp_connection->suggested_codec); return 1; case HFP_CMD_HF_CONFIRMED_CODEC: - //printf("HFP_CMD_HF_CONFIRMED_CODEC \n"); if (hfp_connection->codec_confirmed != hfp_connection->suggested_codec){ hfp_connection->codecs_state = HFP_CODECS_ERROR; hfp_ag_error(hfp_connection->rfcomm_cid); @@ -636,9 +632,9 @@ static void hfp_ag_slc_established(hfp_connection_t * hfp_connection){ } static int hfp_ag_run_for_context_service_level_connection(hfp_connection_t * hfp_connection){ + log_info("hfp_ag_run_for_context_service_level_connection state %u, command %u", hfp_connection->state, hfp_connection->command); if (hfp_connection->state >= HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED) return 0; int done = 0; - // printf(" -> State machine: SLC\n"); switch(hfp_connection->command){ case HFP_CMD_SUPPORTED_FEATURES: switch(hfp_connection->state){ @@ -665,18 +661,9 @@ static int hfp_ag_run_for_context_service_level_connection(hfp_connection_t * hf case HFP_CMD_RETRIEVE_AG_INDICATORS: if (hfp_connection->state == HFP_W4_RETRIEVE_INDICATORS) { - hfp_connection->command = HFP_CMD_NONE; // prevent reentrance - int next_segment = hfp_ag_retrieve_indicators_cmd_via_generator(hfp_connection->rfcomm_cid, hfp_connection, hfp_connection->send_ag_indicators_segment); - if (next_segment < hfp_ag_indicators_cmd_generator_num_segments(hfp_connection)){ - // prepare sending of next segment - hfp_connection->send_ag_indicators_segment = next_segment; - hfp_connection->command = HFP_CMD_RETRIEVE_AG_INDICATORS; - } else { - // done, go to next state - hfp_connection->send_ag_indicators_segment = 0; - hfp_connection->state = HFP_W4_RETRIEVE_INDICATORS_STATUS; - } - return 1; + // HF requested AG Indicators and we did expect it + hfp_connection->state = HFP_RETRIEVE_INDICATORS; + // continue below in state switch } break; @@ -729,16 +716,35 @@ static int hfp_ag_run_for_context_service_level_connection(hfp_connection_t * hf default: break; } + + switch (hfp_connection->state){ + case HFP_RETRIEVE_INDICATORS: { + int next_segment = hfp_ag_retrieve_indicators_cmd_via_generator(hfp_connection->rfcomm_cid, hfp_connection, hfp_connection->send_ag_indicators_segment); + int num_segments = hfp_ag_indicators_cmd_generator_num_segments(hfp_connection); + log_info("HFP_CMD_RETRIEVE_AG_INDICATORS next segment %u, num_segments %u", next_segment, num_segments); + if (next_segment < num_segments){ + // prepare sending of next segment + hfp_connection->send_ag_indicators_segment = next_segment; + log_info("HFP_CMD_RETRIEVE_AG_INDICATORS more. command %u, next seg %u", hfp_connection->command, next_segment); + } else { + // done, go to next state + hfp_connection->send_ag_indicators_segment = 0; + hfp_connection->state = HFP_W4_RETRIEVE_INDICATORS_STATUS; + } + return 1; + } + default: + break; + } + return done; } static int hfp_ag_run_for_context_service_level_connection_queries(hfp_connection_t * hfp_connection){ - // if (hfp_connection->state != HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED) return 0; - + int done = codecs_exchange_state_machine(hfp_connection); if (done) return done; - // printf(" -> State machine: SLC Queries\n"); switch(hfp_connection->command){ case HFP_CMD_AG_ACTIVATE_VOICE_RECOGNITION: hfp_supported_features = store_bit(hfp_supported_features, HFP_AGSF_VOICE_RECOGNITION_FUNCTION, hfp_connection->ag_activate_voice_recognition); @@ -801,7 +807,6 @@ static int hfp_ag_run_for_audio_connection(hfp_connection_t * hfp_connection){ // run codecs exchange int done = codecs_exchange_state_machine(hfp_connection); if (done) return done; - // printf(" -> State machine: Audio hfp_connection\n"); if (hfp_connection->codecs_state != HFP_CODECS_EXCHANGED) return done; if (hfp_connection->establish_audio_connection){ @@ -1610,9 +1615,15 @@ static void hfp_ag_send_call_status(hfp_connection_t * hfp_connection, int call_ } static void hfp_run_for_context(hfp_connection_t *hfp_connection){ + + log_info("hfp_run_for_context %p", hfp_connection); + if (!hfp_connection) return; + if (!hfp_connection->rfcomm_cid) return; + if (!rfcomm_can_send_packet_now(hfp_connection->rfcomm_cid)) { + log_info("hfp_run_for_context: request can send for 0x%02x", hfp_connection->rfcomm_cid); rfcomm_request_can_send_now_event(hfp_connection->rfcomm_cid); return; } @@ -1763,6 +1774,10 @@ static void hfp_run_for_context(hfp_connection_t *hfp_connection){ if (done){ hfp_connection->command = HFP_CMD_NONE; } + // + if (done) { + rfcomm_request_can_send_now_event(hfp_connection->rfcomm_cid); + } } static hfp_generic_status_indicator_t *get_hf_indicator_by_number(int number){ From eddcd3084af8a144b56e09ed9af6b20590981c8a Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 12:40:21 +0200 Subject: [PATCH 16/74] hfp: handle command status error when opening sco connection --- src/classic/hfp.c | 78 ++++++++++++++++++++++++++++---------------- src/classic/hfp.h | 2 +- src/classic/hfp_ag.c | 2 +- 3 files changed, 51 insertions(+), 31 deletions(-) diff --git a/src/classic/hfp.c b/src/classic/hfp.c index a60991183..b0154bd53 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -99,6 +99,8 @@ static void parse_sequence(hfp_connection_t * context); static hfp_callback_t hfp_callback; static btstack_packet_handler_t rfcomm_packet_handler; +static hfp_connection_t * sco_establishment_active; + void hfp_set_callback(hfp_callback_t callback){ hfp_callback = callback; } @@ -438,13 +440,48 @@ static void handle_query_rfcomm_event(uint8_t packet_type, uint16_t channel, uin } } +static void hfp_handle_failed_sco_connection(uint8_t status){ + + if (!sco_establishment_active){ + log_error("(e)SCO Connection failed but not started by us"); + return; + } + log_error("(e)SCO Connection failed status %u", status); + + // invalid params / unspecified error + if (status != 0x11 && status != 0x1f) return; + + switch (sco_establishment_active->link_setting){ + case HFP_LINK_SETTINGS_D0: + return; // no other option left + case HFP_LINK_SETTINGS_D1: + sco_establishment_active->link_setting = HFP_LINK_SETTINGS_D0; + break; + case HFP_LINK_SETTINGS_S1: + sco_establishment_active->link_setting = HFP_LINK_SETTINGS_D1; + break; + case HFP_LINK_SETTINGS_S2: + case HFP_LINK_SETTINGS_S3: + case HFP_LINK_SETTINGS_S4: + sco_establishment_active->link_setting = HFP_LINK_SETTINGS_S1; + break; + case HFP_LINK_SETTINGS_T1: + case HFP_LINK_SETTINGS_T2: + sco_establishment_active->link_setting = HFP_LINK_SETTINGS_S3; + break; + } + sco_establishment_active->establish_audio_connection = 1; + sco_establishment_active = 0; +} + + void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ bd_addr_t event_addr; uint16_t rfcomm_cid, handle; hfp_connection_t * hfp_connection = NULL; uint8_t status; - // printf("AG packet_handler type %u, event type %x, size %u\n", packet_type, hci_event_packet_get_type(packet), size); + log_info("AG packet_handler type %u, event type %x, size %u", packet_type, hci_event_packet_get_type(packet), size); switch (hci_event_packet_get_type(packet)) { @@ -494,6 +531,12 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet } break; + case HCI_EVENT_COMMAND_STATUS: + if (hci_event_command_status_get_command_opcode(packet) == hci_setup_synchronous_connection.opcode) { + hfp_handle_failed_sco_connection(hci_event_command_status_get_status(packet)); + } + break; + case HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE:{ reverse_bd_addr(&packet[5], event_addr); @@ -501,32 +544,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet status = packet[index++]; if (status != 0){ - log_error("(e)SCO Connection failed status %u", status); - // if outgoing && link_setting != d0 && appropriate error - if (status != 0x11 && status != 0x1f) break; // invalid params / unspecified error - hfp_connection = get_hfp_connection_context_for_bd_addr(event_addr); - if (!hfp_connection) break; - switch (hfp_connection->link_setting){ - case HFP_LINK_SETTINGS_D0: - return; // no other option left - case HFP_LINK_SETTINGS_D1: - // hfp_connection->link_setting = HFP_LINK_SETTINGS_D0; - // break; - case HFP_LINK_SETTINGS_S1: - // hfp_connection->link_setting = HFP_LINK_SETTINGS_D1; - // break; - case HFP_LINK_SETTINGS_S2: - case HFP_LINK_SETTINGS_S3: - case HFP_LINK_SETTINGS_S4: - // hfp_connection->link_setting = HFP_LINK_SETTINGS_S1; - // break; - case HFP_LINK_SETTINGS_T1: - case HFP_LINK_SETTINGS_T2: - // hfp_connection->link_setting = HFP_LINK_SETTINGS_S3; - hfp_connection->link_setting = HFP_LINK_SETTINGS_D0; - break; - } - hfp_connection->establish_audio_connection = 1; + hfp_handle_failed_sco_connection(status); break; } @@ -1332,10 +1350,12 @@ static const struct link_settings { { 0x000d, 0x02, 0x0380 } // HFP_LINK_SETTINGS_T2, 2-EV3 }; -void hfp_setup_synchronous_connection(hci_con_handle_t handle, hfp_link_setttings_t setting){ +void hfp_setup_synchronous_connection(hfp_connection_t * hfp_connection){ // all packet types, fixed bandwidth + int setting = hfp_connection->link_setting; log_info("hfp_setup_synchronous_connection using setting nr %u", setting); - hci_send_cmd(&hci_setup_synchronous_connection, handle, 8000, 8000, hfp_link_settings[setting].max_latency, + sco_establishment_active = hfp_connection; + hci_send_cmd(&hci_setup_synchronous_connection, hfp_connection->acl_handle, 8000, 8000, hfp_link_settings[setting].max_latency, hci_get_sco_voice_setting(), hfp_link_settings[setting].retransmission_effort, hfp_link_settings[setting].packet_types); // all types 0x003f, only 2-ev3 0x380 } diff --git a/src/classic/hfp.h b/src/classic/hfp.h index 22dc8a640..68c9e80a0 100644 --- a/src/classic/hfp.h +++ b/src/classic/hfp.h @@ -645,7 +645,7 @@ void hfp_reset_context_flags(hfp_connection_t * connection); void hfp_release_audio_connection(hfp_connection_t * connection); -void hfp_setup_synchronous_connection(hci_con_handle_t handle, hfp_link_setttings_t link_settings); +void hfp_setup_synchronous_connection(hfp_connection_t * connection); const char * hfp_hf_feature(int index); const char * hfp_ag_feature(int index); diff --git a/src/classic/hfp_ag.c b/src/classic/hfp_ag.c index f33b812d8..023107ce0 100644 --- a/src/classic/hfp_ag.c +++ b/src/classic/hfp_ag.c @@ -812,7 +812,7 @@ static int hfp_ag_run_for_audio_connection(hfp_connection_t * hfp_connection){ if (hfp_connection->establish_audio_connection){ hfp_connection->state = HFP_W4_SCO_CONNECTED; hfp_connection->establish_audio_connection = 0; - hfp_setup_synchronous_connection(hfp_connection->acl_handle, hfp_connection->link_setting); + hfp_setup_synchronous_connection(hfp_connection); return 1; } return 0; From 6c5b2002a2ca49992a963d1762becd217afd94de Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 14:48:17 +0200 Subject: [PATCH 17/74] hfp: don't report command status ok for synchronous setup --- src/classic/hfp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/classic/hfp.c b/src/classic/hfp.c index b0154bd53..9fb02881c 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -446,7 +446,7 @@ static void hfp_handle_failed_sco_connection(uint8_t status){ log_error("(e)SCO Connection failed but not started by us"); return; } - log_error("(e)SCO Connection failed status %u", status); + log_error("(e)SCO Connection failed status 0x%02x", status); // invalid params / unspecified error if (status != 0x11 && status != 0x1f) return; @@ -533,7 +533,10 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet case HCI_EVENT_COMMAND_STATUS: if (hci_event_command_status_get_command_opcode(packet) == hci_setup_synchronous_connection.opcode) { - hfp_handle_failed_sco_connection(hci_event_command_status_get_status(packet)); + uint8_t status = hci_event_command_status_get_status(packet); + if (status) { + hfp_handle_failed_sco_connection(hci_event_command_status_get_status(packet)); + } } break; From e64e0086b6e940726b732214f11d6320c5a5b42c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 14:50:02 +0200 Subject: [PATCH 18/74] example/hfp_ag: tidy up --- example/hfp_ag_demo.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index 153ab611f..79e175f15 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -65,7 +65,10 @@ uint8_t hfp_service_buffer[150]; const uint8_t rfcomm_channel_nr = 1; const char hfp_ag_service_name[] = "BTstack HFP AG Test"; -static bd_addr_t device_addr = {0x00,0x15,0x83,0x5F,0x9D,0x46}; +// PTS +// static bd_addr_t device_addr = {0x00,0x15,0x83,0x5F,0x9D,0x46}; +// BT-201 +static bd_addr_t device_addr = {0x00, 0x07, 0xB0, 0x83, 0x02, 0x5E}; static uint8_t codecs[1] = {HFP_CODEC_CVSD}; static uint16_t handle = -1; @@ -189,7 +192,7 @@ static void inquiry_packet_handler (uint8_t packet_type, uint8_t *packet, uint16 numResponses = hci_event_inquiry_result_get_num_responses(packet); int offset = 3; for (i=0; i= 0) continue; // already in our list @@ -234,7 +237,7 @@ static void inquiry_packet_handler (uint8_t packet_type, uint8_t *packet, uint16 break; case HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE: - reverse_bd_addr(addr, &packet[3]); + reverse_bd_addr(&packet[3], addr); index = getDeviceIndexForAddress(addr); if (index >= 0) { if (packet[2] == 0) { @@ -259,7 +262,10 @@ static void show_usage(void); // Testig User Interface static void show_usage(void){ - printf("\n--- Bluetooth HFP Audiogateway (AG) unit Test Console ---\n"); + bd_addr_t iut_address; + gap_local_bd_addr(iut_address); + + printf("\n--- Bluetooth HFP Audiogateway (AG) unit Test Console %s ---\n", bd_addr_to_str(iut_address)); printf("---\n"); printf("a - establish HFP connection to PTS module\n"); @@ -514,7 +520,7 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac break; case 't': log_info("USER:\'%c\'", cmd); - printf("Terminate HCI connection.\n"); + printf("Terminate HCI connection. 0x%2x\n", handle); gap_disconnect(handle); break; case 'u': @@ -560,7 +566,6 @@ static void packet_handler(uint8_t * event, uint16_t event_size){ break; } - if (event[0] != HCI_EVENT_HFP_META) return; if (event[3] @@ -639,22 +644,25 @@ static hfp_phone_number_t subscriber_number = { int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ - // HFP HS address is hardcoded, please change it - // init L2CAP - l2cap_init(); - rfcomm_init(); - sdp_init(); + gap_discoverable_control(1); + + // L2CAP + l2cap_init(); + + // HFP + rfcomm_init(); hfp_ag_init(rfcomm_channel_nr); hfp_ag_init_supported_features(0x3ef | (1< Date: Thu, 21 Apr 2016 15:05:23 +0200 Subject: [PATCH 19/74] hfp_hf: fix compile --- src/classic/hfp.c | 2 +- src/classic/hfp_hf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classic/hfp.c b/src/classic/hfp.c index 9fb02881c..0a51433c2 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -533,7 +533,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet case HCI_EVENT_COMMAND_STATUS: if (hci_event_command_status_get_command_opcode(packet) == hci_setup_synchronous_connection.opcode) { - uint8_t status = hci_event_command_status_get_status(packet); + status = hci_event_command_status_get_status(packet); if (status) { hfp_handle_failed_sco_connection(hci_event_command_status_get_status(packet)); } diff --git a/src/classic/hfp_hf.c b/src/classic/hfp_hf.c index 7586bffca..2aca9eb4b 100644 --- a/src/classic/hfp_hf.c +++ b/src/classic/hfp_hf.c @@ -566,7 +566,7 @@ static int hfp_hf_run_for_audio_connection(hfp_connection_t * hfp_connection){ if (hfp_connection->establish_audio_connection){ hfp_connection->state = HFP_W4_SCO_CONNECTED; hfp_connection->establish_audio_connection = 0; - hfp_setup_synchronous_connection(hfp_connection->acl_handle, hfp_connection->link_setting); + hfp_setup_synchronous_connection(hfp_connection); return 1; } From 6ff51cfd6b7d7e31b57ee80cd4a1a52e6877718d Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 15:29:46 +0200 Subject: [PATCH 20/74] Add handle to HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED getters --- src/btstack_defines.h | 3 ++- src/btstack_event.h | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/btstack_defines.h b/src/btstack_defines.h index 803bb4196..6057c61c0 100644 --- a/src/btstack_defines.h +++ b/src/btstack_defines.h @@ -904,9 +904,10 @@ typedef uint8_t sm_key_t[16]; #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED 0x02 /** - * @format 11 + * @format 11H * @param subevent_code * @param status 0 == OK + * @param handle */ #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 0x03 diff --git a/src/btstack_event.h b/src/btstack_event.h index c498133ba..04001c73a 100644 --- a/src/btstack_event.h +++ b/src/btstack_event.h @@ -2660,6 +2660,15 @@ static inline hci_con_handle_t hfp_subevent_service_level_connection_established static inline uint8_t hfp_subevent_audio_connection_established_get_status(const uint8_t * event){ return event[3]; } +/** + * @brief Get field handle from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED + * @param event packet + * @return handle + * @note: btstack_type H + */ +static inline hci_con_handle_t hfp_subevent_audio_connection_established_get_handle(const uint8_t * event){ + return little_endian_read_16(event, 4); +} /** From 3cef842b65a7bc80381f44c5312aee052981b0f0 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 15:58:44 +0200 Subject: [PATCH 21/74] example/hfp_ag: send sinus wave to HF --- example/hfp_ag_demo.c | 68 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index 79e175f15..f628f5eb7 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -61,6 +61,17 @@ #endif +static int phase = 0; + +// input signal: pre-computed sine wave, 160 Hz +static const uint8_t sine[] = { + 0, 15, 31, 46, 61, 74, 86, 97, 107, 114, + 120, 124, 126, 126, 124, 120, 114, 107, 97, 86, + 74, 61, 46, 31, 15, 0, 241, 225, 210, 195, + 182, 170, 159, 149, 142, 136, 132, 130, 130, 132, + 136, 142, 149, 159, 170, 182, 195, 210, 225, 241, +}; + uint8_t hfp_service_buffer[150]; const uint8_t rfcomm_channel_nr = 1; const char hfp_ag_service_name[] = "BTstack HFP AG Test"; @@ -72,6 +83,7 @@ static bd_addr_t device_addr = {0x00, 0x07, 0xB0, 0x83, 0x02, 0x5E}; static uint8_t codecs[1] = {HFP_CODEC_CVSD}; static uint16_t handle = -1; +static hci_con_handle_t sco_handle; static int memory_1_enabled = 1; static int ag_indicators_nr = 7; @@ -553,6 +565,48 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } #endif +#define SCO_REPORT_PERIOD 100 +static void send_sco_data(void){ + if (!sco_handle) return; + + const int sco_packet_length = hci_get_sco_packet_length(); + const int sco_payload_length = sco_packet_length - 3; + const int frames_per_packet = sco_payload_length; // for 8-bit data. for 16-bit data it's /2 + + hci_reserve_packet_buffer(); + uint8_t * sco_packet = hci_get_outgoing_packet_buffer(); + // set handle + flags + little_endian_store_16(sco_packet, 0, sco_handle); + // set len + sco_packet[2] = sco_payload_length; + int i; + for (i=0;i= sizeof(sine)) phase = 0; + } + hci_send_sco_packet_buffer(sco_packet_length); + + // request another send event + hci_request_sco_can_send_now_event(); + + static int count = 0; + count++; + if ((count & SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); +} + +static void sco_packet_handler(uint8_t packet_type, uint8_t * packet, uint16_t size){ + switch (packet_type){ + case HCI_EVENT_PACKET: + if (packet[0] == HCI_EVENT_SCO_CAN_SEND_NOW){ + send_sco_data(); + } + break; + default: + break; + } +} + static void packet_handler(uint8_t * event, uint16_t event_size){ switch (event[0]){ case HCI_EVENT_INQUIRY_RESULT: @@ -583,12 +637,21 @@ static void packet_handler(uint8_t * event, uint16_t event_size){ break; case HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED: printf("Service level connection released.\n"); + sco_handle = 0; break; case HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED: - printf("\n** Audio connection established **\n"); + if (hfp_subevent_audio_connection_established_get_status(event)){ + printf("Audio connection establishment failed with status %u\n", hfp_subevent_audio_connection_established_get_status(event)); + sco_handle = 0; + } else { + sco_handle = hfp_subevent_audio_connection_established_get_handle(event); + printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); + hci_request_sco_can_send_now_event(); + } break; case HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED: printf("\n** Audio connection released **\n"); + sco_handle = 0; break; case HFP_SUBEVENT_START_RINGINIG: printf("\n** Start Ringing **\n"); @@ -659,7 +722,8 @@ int btstack_main(int argc, const char * argv[]){ hfp_ag_init_hf_indicators(hf_indicators_nr, hf_indicators); hfp_ag_init_call_hold_services(call_hold_services_nr, call_hold_services); hfp_ag_set_subcriber_number_information(&subscriber_number, 1); - hfp_ag_register_packet_handler(packet_handler); + hfp_ag_register_packet_handler(&packet_handler); + hci_register_sco_packet_handler(&sco_packet_handler); // SDP Server sdp_init(); From 827ced601492012208b772af46bb699edb4418e1 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 16:17:03 +0200 Subject: [PATCH 22/74] hfp/hsp: don't call l2cap_init --- src/classic/hfp_ag.c | 2 -- src/classic/hfp_hf.c | 2 -- src/classic/hsp_hs.c | 3 --- 3 files changed, 7 deletions(-) diff --git a/src/classic/hfp_ag.c b/src/classic/hfp_ag.c index 023107ce0..6cc14e70e 100644 --- a/src/classic/hfp_ag.c +++ b/src/classic/hfp_ag.c @@ -2052,8 +2052,6 @@ void hfp_ag_init(uint16_t rfcomm_channel_nr){ hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); - l2cap_init(); - rfcomm_register_service(&packet_handler, rfcomm_channel_nr, 0xffff); hfp_ag_response_and_hold_active = 0; diff --git a/src/classic/hfp_hf.c b/src/classic/hfp_hf.c index 2aca9eb4b..878a3292b 100644 --- a/src/classic/hfp_hf.c +++ b/src/classic/hfp_hf.c @@ -1083,8 +1083,6 @@ void hfp_hf_init(uint16_t rfcomm_channel_nr){ hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); - l2cap_init(); - rfcomm_register_service(packet_handler, rfcomm_channel_nr, 0xffff); hfp_set_packet_handler_for_rfcomm_connections(&packet_handler); diff --git a/src/classic/hsp_hs.c b/src/classic/hsp_hs.c index 4ee77e2b8..ab1f2813e 100644 --- a/src/classic/hsp_hs.c +++ b/src/classic/hsp_hs.c @@ -276,9 +276,6 @@ void hsp_hs_init(uint8_t rfcomm_channel_nr){ hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); - // init L2CAP - l2cap_init(); - rfcomm_init(); rfcomm_register_service(packet_handler, rfcomm_channel_nr, 0xffff); // reserved channel, mtu limited by l2cap From 3d50b4ba508ee9a63dad46affe576c15b254cc01 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 20:47:37 +0200 Subject: [PATCH 23/74] hci: use btstack_packet_handler_t for acl and sco callbacks --- example/hfp_ag_demo.c | 2 +- example/hsp_ag_demo.c | 27 +++++++++++++++++---------- example/hsp_hs_demo.c | 22 +++++++++++++++------- src/hci.c | 10 +++++----- src/hci.h | 8 ++++---- src/l2cap.c | 10 +++++----- 6 files changed, 47 insertions(+), 32 deletions(-) diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index f628f5eb7..1707e7edd 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -595,7 +595,7 @@ static void send_sco_data(void){ if ((count & SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); } -static void sco_packet_handler(uint8_t packet_type, uint8_t * packet, uint16_t size){ +static void sco_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t size){ switch (packet_type){ case HCI_EVENT_PACKET: if (packet[0] == HCI_EVENT_SCO_CAN_SEND_NOW){ diff --git a/example/hsp_ag_demo.c b/example/hsp_ag_demo.c index 79df9d4b1..32782dc95 100644 --- a/example/hsp_ag_demo.c +++ b/example/hsp_ag_demo.c @@ -215,16 +215,26 @@ static void send_sco_data(void){ hci_request_sco_can_send_now_event(); static int count = 0; - count++; - if ((count & SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); + if ((count & SCO_REPORT_PERIOD)) return; + printf("SCO packets sent: %u\n", count); } -static void sco_packet_handler(uint8_t packet_type, uint8_t * packet, uint16_t size){ - return; +static void sco_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t size){ static int count = 0; - count++; - if ((count & SCO_REPORT_PERIOD)) return; - printf("SCO packets %u\n", count); + switch (packet_type){ + case HCI_EVENT_PACKET: + if (packet[0] == HCI_EVENT_SCO_CAN_SEND_NOW){ + send_sco_data(); + } + break; + case HCI_SCO_DATA_PACKET: + count++; + if ((count & SCO_REPORT_PERIOD)) return; + printf("SCO packets received: %u\n", count); + break; + default: + break; + } } static void packet_handler(uint8_t * event, uint16_t event_size){ @@ -233,9 +243,6 @@ static void packet_handler(uint8_t * event, uint16_t event_size){ if (event[2] != HCI_STATE_WORKING) break; show_usage(); break; - case HCI_EVENT_SCO_CAN_SEND_NOW: - send_sco_data(); - break; case HCI_EVENT_HSP_META: switch (event[2]) { case HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE: diff --git a/example/hsp_hs_demo.c b/example/hsp_hs_demo.c index f1240b943..ffa509db0 100644 --- a/example/hsp_hs_demo.c +++ b/example/hsp_hs_demo.c @@ -215,16 +215,24 @@ static void send_sco_data(void){ hci_request_sco_can_send_now_event(); static int count = 0; - count++; - if ((count & 15) == 0) printf("Sent %u\n", count); + if ((count & SCO_REPORT_PERIOD)) return; + printf("SCO packets sent: %u\n", count); } -static void sco_packet_handler(uint8_t packet_type, uint8_t * packet, uint16_t size){ +static void sco_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t size){ static int count = 0; - // hexdumpf(packet, size); - count++; - if ((count & SCO_REPORT_PERIOD)) return; - printf("SCO packets %u\n", count); + switch (packet_type){ + case HCI_EVENT_PACKET: + if (packet[0] == HCI_EVENT_SCO_CAN_SEND_NOW){ + send_sco_data(); + } + break; + default: + count++; + if ((count & SCO_REPORT_PERIOD)) return; + printf("SCO packets received: %u\n", count); + break; + } } static void packet_handler(uint8_t * event, uint16_t event_size){ diff --git a/src/hci.c b/src/hci.c index 99e886c4c..a59b7b576 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1816,7 +1816,7 @@ static void event_handler(uint8_t *packet, int size){ static void sco_handler(uint8_t * packet, uint16_t size){ if (!hci_stack->sco_packet_handler) return; - hci_stack->sco_packet_handler(HCI_SCO_DATA_PACKET, packet, size); + hci_stack->sco_packet_handler(HCI_SCO_DATA_PACKET, 0, packet, size); } static void packet_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ @@ -1844,14 +1844,14 @@ void hci_add_event_handler(btstack_packet_callback_registration_t * callback_han /** Register HCI packet handlers */ -void hci_register_acl_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)){ +void hci_register_acl_packet_handler(btstack_packet_handler_t handler){ hci_stack->acl_packet_handler = handler; } /** * @brief Registers a packet handler for SCO data. Used for HSP and HFP profiles. */ -void hci_register_sco_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)){ +void hci_register_sco_packet_handler(btstack_packet_handler_t handler){ hci_stack->sco_packet_handler = handler; } @@ -2930,7 +2930,7 @@ static void hci_emit_event(uint8_t * event, uint16_t size, int dump){ static void hci_emit_acl_packet(uint8_t * packet, uint16_t size){ if (!hci_stack->acl_packet_handler) return; - hci_stack->acl_packet_handler(HCI_ACL_DATA_PACKET, packet, size); + hci_stack->acl_packet_handler(HCI_ACL_DATA_PACKET, 0, packet, size); } static void hci_notify_if_sco_can_send_now(void){ @@ -2940,7 +2940,7 @@ static void hci_notify_if_sco_can_send_now(void){ hci_stack->sco_waiting_for_can_send_now = 0; uint8_t event[2] = { HCI_EVENT_SCO_CAN_SEND_NOW, 0 }; hci_dump_packet(HCI_EVENT_PACKET, 1, event, sizeof(event)); - hci_stack->sco_packet_handler(HCI_EVENT_PACKET, event, sizeof(event)); + hci_stack->sco_packet_handler(HCI_EVENT_PACKET, 0, event, sizeof(event)); } } diff --git a/src/hci.h b/src/hci.h index b5febacad..df5c2fb8b 100644 --- a/src/hci.h +++ b/src/hci.h @@ -519,10 +519,10 @@ typedef struct { btstack_linked_list_t connections; /* callback to L2CAP layer */ - void (*acl_packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size); + btstack_packet_handler_t acl_packet_handler; /* callback for SCO data */ - void (*sco_packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size); + btstack_packet_handler_t sco_packet_handler; /* callbacks for events */ btstack_linked_list_t event_handlers; @@ -720,12 +720,12 @@ void hci_add_event_handler(btstack_packet_callback_registration_t * callback_han /** * @brief Registers a packet handler for ACL data. Used by L2CAP */ -void hci_register_acl_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)); +void hci_register_acl_packet_handler(btstack_packet_handler_t handler); /** * @brief Registers a packet handler for SCO data. Used for HSP and HFP profiles. */ -void hci_register_sco_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)); +void hci_register_sco_packet_handler(btstack_packet_handler_t handler); // Sending HCI Commands diff --git a/src/l2cap.c b/src/l2cap.c index ddc4f9121..0efef419c 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -82,7 +82,7 @@ static void l2cap_emit_channel_closed(l2cap_channel_t *channel); static void l2cap_emit_connection_request(l2cap_channel_t *channel); static int l2cap_channel_ready_for_open(l2cap_channel_t *channel); static void l2cap_hci_event_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); -static void l2cap_acl_handler(uint8_t packet_type, uint8_t *packet, uint16_t size ); +static void l2cap_acl_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size ); static void l2cap_notify_channel_can_send(void); typedef struct l2cap_fixed_channel { @@ -1381,7 +1381,7 @@ static void l2cap_signaling_handler_dispatch( hci_con_handle_t handle, uint8_t * } } -static void l2cap_acl_handler(uint8_t packet_type, uint8_t *packet, uint16_t size ){ +static void l2cap_acl_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size ){ // Get Channel ID uint16_t channel_id = READ_L2CAP_CHANNEL_ID(packet); @@ -1487,9 +1487,9 @@ static void l2cap_acl_handler(uint8_t packet_type, uint8_t *packet, uint16_t siz default: { // Find channel for this channel_id and connection handle - l2cap_channel_t * channel = l2cap_get_channel_for_local_cid(channel_id); + l2cap_channel_t * l2cap_channel = l2cap_get_channel_for_local_cid(channel_id); if (channel) { - l2cap_dispatch_to_channel(channel, L2CAP_DATA_PACKET, &packet[COMPLETE_L2CAP_HEADER], size-COMPLETE_L2CAP_HEADER); + l2cap_dispatch_to_channel(l2cap_channel, L2CAP_DATA_PACKET, &packet[COMPLETE_L2CAP_HEADER], size-COMPLETE_L2CAP_HEADER); } break; } @@ -1499,7 +1499,7 @@ static void l2cap_acl_handler(uint8_t packet_type, uint8_t *packet, uint16_t siz } // finalize closed channel - l2cap_handle_disconnect_request & DISCONNECTION_RESPONSE -void l2cap_finialize_channel_close(l2cap_channel_t *channel){ +void l2cap_finialize_channel_close(l2cap_channel_t * channel){ channel->state = L2CAP_STATE_CLOSED; l2cap_emit_channel_closed(channel); // discard channel From d1fd2a8811aee54fa4cfbcb170349a56f8fd50a5 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 21:23:31 +0200 Subject: [PATCH 24/74] l2cap: fix event forwarding failure by previous commit --- src/l2cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/l2cap.c b/src/l2cap.c index 0efef419c..51ce5320a 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -1488,7 +1488,7 @@ static void l2cap_acl_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa default: { // Find channel for this channel_id and connection handle l2cap_channel_t * l2cap_channel = l2cap_get_channel_for_local_cid(channel_id); - if (channel) { + if (l2cap_channel) { l2cap_dispatch_to_channel(l2cap_channel, L2CAP_DATA_PACKET, &packet[COMPLETE_L2CAP_HEADER], size-COMPLETE_L2CAP_HEADER); } break; From 13839019fac3531c95d6d5428516acfddf89b2dc Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 21:29:03 +0200 Subject: [PATCH 25/74] HFP + HSP: use uniform btstack_packet_handler_t --- example/hfp_ag_demo.c | 163 ++++++++++++++++------------------ example/hfp_hf_demo.c | 2 +- example/hsp_ag_demo.c | 130 +++++++++++++-------------- example/hsp_hs_demo.c | 156 +++++++++++++++----------------- src/classic/hfp.c | 20 ++--- src/classic/hfp.h | 12 ++- src/classic/hfp_ag.c | 4 +- src/classic/hfp_ag.h | 2 +- src/classic/hfp_hf.c | 24 ++--- src/classic/hfp_hf.h | 2 +- src/classic/hsp_ag.c | 12 +-- src/classic/hsp_ag.h | 29 +++--- src/classic/hsp_hs.c | 16 ++-- src/classic/hsp_hs.h | 31 +++---- test/hfp/hfp_ag_client_test.c | 3 +- test/hfp/hfp_hf_client_test.c | 2 +- test/pts/hfp_ag_test.c | 2 +- test/pts/hfp_hf_test.c | 2 +- test/pts/hsp_ag_test.c | 2 +- test/pts/hsp_hs_test.c | 2 +- 20 files changed, 294 insertions(+), 322 deletions(-) diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index 1707e7edd..2f6b05b72 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -595,97 +595,92 @@ static void send_sco_data(void){ if ((count & SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); } -static void sco_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t size){ +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ switch (packet_type){ case HCI_EVENT_PACKET: - if (packet[0] == HCI_EVENT_SCO_CAN_SEND_NOW){ - send_sco_data(); + switch (event[0]){ + case HCI_EVENT_INQUIRY_RESULT: + case HCI_EVENT_INQUIRY_RESULT_WITH_RSSI: + case HCI_EVENT_INQUIRY_COMPLETE: + case HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE: + inquiry_packet_handler(HCI_EVENT_PACKET, event, event_size); + break; + case HCI_EVENT_SCO_CAN_SEND_NOW: + send_sco_data(); + break; + default: + break; } - break; - default: - break; - } -} -static void packet_handler(uint8_t * event, uint16_t event_size){ - switch (event[0]){ - case HCI_EVENT_INQUIRY_RESULT: - case HCI_EVENT_INQUIRY_RESULT_WITH_RSSI: - case HCI_EVENT_INQUIRY_COMPLETE: - case HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE: - inquiry_packet_handler(HCI_EVENT_PACKET, event, event_size); - break; + if (event[0] != HCI_EVENT_HFP_META) return; - default: - break; - } - - if (event[0] != HCI_EVENT_HFP_META) return; - - if (event[3] - && event[2] != HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER - && event[2] != HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG - && event[2] != HFP_SUBEVENT_TRANSMIT_DTMF_CODES){ - printf("ERROR, status: %u\n", event[3]); - return; - } - - switch (event[2]) { - case HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED: - handle = hfp_subevent_service_level_connection_established_get_con_handle(event); - printf("Service level connection established.\n"); - break; - case HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED: - printf("Service level connection released.\n"); - sco_handle = 0; - break; - case HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED: - if (hfp_subevent_audio_connection_established_get_status(event)){ - printf("Audio connection establishment failed with status %u\n", hfp_subevent_audio_connection_established_get_status(event)); - sco_handle = 0; - } else { - sco_handle = hfp_subevent_audio_connection_established_get_handle(event); - printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); - hci_request_sco_can_send_now_event(); + if (event[3] + && event[2] != HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER + && event[2] != HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG + && event[2] != HFP_SUBEVENT_TRANSMIT_DTMF_CODES){ + printf("ERROR, status: %u\n", event[3]); + return; } - break; - case HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED: - printf("\n** Audio connection released **\n"); - sco_handle = 0; - break; - case HFP_SUBEVENT_START_RINGINIG: - printf("\n** Start Ringing **\n"); - break; - case HFP_SUBEVENT_STOP_RINGINIG: - printf("\n** Stop Ringing **\n"); - break; - case HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER: - printf("\n** Outgoing call '%s' **\n", hfp_subevent_place_call_with_number_get_number(event)); - // validate number - if ( strcmp("1234567", hfp_subevent_place_call_with_number_get_number(event)) == 0 - || strcmp("7654321", hfp_subevent_place_call_with_number_get_number(event)) == 0 - || (memory_1_enabled && strcmp(">1", hfp_subevent_place_call_with_number_get_number(event)) == 0)){ - printf("Dialstring valid: accept call\n"); - hfp_ag_outgoing_call_accepted(); - } else { - printf("Dialstring invalid: reject call\n"); - hfp_ag_outgoing_call_rejected(); + + switch (event[2]) { + case HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED: + handle = hfp_subevent_service_level_connection_established_get_con_handle(event); + printf("Service level connection established.\n"); + break; + case HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED: + printf("Service level connection released.\n"); + sco_handle = 0; + break; + case HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED: + if (hfp_subevent_audio_connection_established_get_status(event)){ + printf("Audio connection establishment failed with status %u\n", hfp_subevent_audio_connection_established_get_status(event)); + sco_handle = 0; + } else { + sco_handle = hfp_subevent_audio_connection_established_get_handle(event); + printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); + hci_request_sco_can_send_now_event(); + } + break; + case HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED: + printf("\n** Audio connection released **\n"); + sco_handle = 0; + break; + case HFP_SUBEVENT_START_RINGINIG: + printf("\n** Start Ringing **\n"); + break; + case HFP_SUBEVENT_STOP_RINGINIG: + printf("\n** Stop Ringing **\n"); + break; + case HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER: + printf("\n** Outgoing call '%s' **\n", hfp_subevent_place_call_with_number_get_number(event)); + // validate number + if ( strcmp("1234567", hfp_subevent_place_call_with_number_get_number(event)) == 0 + || strcmp("7654321", hfp_subevent_place_call_with_number_get_number(event)) == 0 + || (memory_1_enabled && strcmp(">1", hfp_subevent_place_call_with_number_get_number(event)) == 0)){ + printf("Dialstring valid: accept call\n"); + hfp_ag_outgoing_call_accepted(); + } else { + printf("Dialstring invalid: reject call\n"); + hfp_ag_outgoing_call_rejected(); + } + break; + + case HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG: + printf("\n** Attach number to voice tag. Sending '1234567\n"); + hfp_ag_send_phone_number_for_voice_tag(device_addr, "1234567"); + break; + case HFP_SUBEVENT_TRANSMIT_DTMF_CODES: + printf("\n** Send DTMF Codes: '%s'\n", hfp_subevent_transmit_dtmf_codes_get_dtmf(event)); + hfp_ag_send_dtmf_code_done(device_addr); + break; + case HFP_SUBEVENT_CALL_ANSWERED: + printf("Call answered by HF\n"); + break; + default: + printf("Event not handled %u\n", event[2]); + break; } - break; - - case HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG: - printf("\n** Attach number to voice tag. Sending '1234567\n"); - hfp_ag_send_phone_number_for_voice_tag(device_addr, "1234567"); - break; - case HFP_SUBEVENT_TRANSMIT_DTMF_CODES: - printf("\n** Send DTMF Codes: '%s'\n", hfp_subevent_transmit_dtmf_codes_get_dtmf(event)); - hfp_ag_send_dtmf_code_done(device_addr); - break; - case HFP_SUBEVENT_CALL_ANSWERED: - printf("Call answered by HF\n"); - break; default: - printf("Event not handled %u\n", event[2]); break; } } @@ -723,7 +718,7 @@ int btstack_main(int argc, const char * argv[]){ hfp_ag_init_call_hold_services(call_hold_services_nr, call_hold_services); hfp_ag_set_subcriber_number_information(&subscriber_number, 1); hfp_ag_register_packet_handler(&packet_handler); - hci_register_sco_packet_handler(&sco_packet_handler); + hci_register_sco_packet_handler(&packet_handler); // SDP Server sdp_init(); diff --git a/example/hfp_hf_demo.c b/example/hfp_hf_demo.c index 76d86077b..008cccc20 100644 --- a/example/hfp_hf_demo.c +++ b/example/hfp_hf_demo.c @@ -444,7 +444,7 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } #endif -static void packet_handler(uint8_t * event, uint16_t event_size){ +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ if (event[0] != HCI_EVENT_HFP_META) return; switch (event[2]) { diff --git a/example/hsp_ag_demo.c b/example/hsp_ag_demo.c index 32782dc95..6966245a3 100644 --- a/example/hsp_ag_demo.c +++ b/example/hsp_ag_demo.c @@ -219,80 +219,81 @@ static void send_sco_data(void){ printf("SCO packets sent: %u\n", count); } -static void sco_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t size){ +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ + static int count = 0; + switch (packet_type){ - case HCI_EVENT_PACKET: - if (packet[0] == HCI_EVENT_SCO_CAN_SEND_NOW){ - send_sco_data(); - } - break; + case HCI_SCO_DATA_PACKET: count++; if ((count & SCO_REPORT_PERIOD)) return; printf("SCO packets received: %u\n", count); break; - default: - break; - } -} -static void packet_handler(uint8_t * event, uint16_t event_size){ - switch (event[0]) { - case BTSTACK_EVENT_STATE: - if (event[2] != HCI_STATE_WORKING) break; - show_usage(); - break; - case HCI_EVENT_HSP_META: - switch (event[2]) { - case HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE: - if (hsp_subevent_rfcomm_connection_complete_get_status(event)){ - printf("RFCOMM connection establishement failed with status %u\n", hsp_subevent_audio_connection_complete_get_handle(event)); - } else { - printf("RFCOMM connection established.\n"); - } + case HCI_EVENT_PACKET: + switch (event[0]) { + case BTSTACK_EVENT_STATE: + if (event[2] != HCI_STATE_WORKING) break; + show_usage(); break; - case HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE: - if (hsp_subevent_rfcomm_disconnection_complete_get_status(event)){ - printf("RFCOMM disconnection failed with status %u.\n", hsp_subevent_rfcomm_disconnection_complete_get_status(event)); - } else { - printf("RFCOMM disconnected.\n"); + case HCI_EVENT_SCO_CAN_SEND_NOW: + send_sco_data(); + break; + case HCI_EVENT_HSP_META: + switch (event[2]) { + case HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE: + if (hsp_subevent_rfcomm_connection_complete_get_status(event)){ + printf("RFCOMM connection establishement failed with status %u\n", hsp_subevent_audio_connection_complete_get_handle(event)); + } else { + printf("RFCOMM connection established.\n"); + } + break; + case HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE: + if (hsp_subevent_rfcomm_disconnection_complete_get_status(event)){ + printf("RFCOMM disconnection failed with status %u.\n", hsp_subevent_rfcomm_disconnection_complete_get_status(event)); + } else { + printf("RFCOMM disconnected.\n"); + } + break; + case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: + if (hsp_subevent_audio_connection_complete_get_status(event)){ + printf("Audio connection establishment failed with status %u\n", hsp_subevent_audio_connection_complete_get_status(event)); + sco_handle = 0; + } else { + sco_handle = hsp_subevent_audio_connection_complete_get_handle(event); + printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); + hci_request_sco_can_send_now_event(); + } + break; + case HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE: + if (hsp_subevent_audio_disconnection_complete_get_status(event)){ + printf("Audio connection releasing failed with status %u\n", hsp_subevent_audio_disconnection_complete_get_status(event)); + } else { + printf("Audio connection released.\n\n"); + sco_handle = 0; + } + break; + case HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED: + printf("Received microphone gain change %d\n", hsp_subevent_microphone_gain_changed_get_gain(event)); + break; + case HSP_SUBEVENT_SPEAKER_GAIN_CHANGED: + printf("Received speaker gain change %d\n", hsp_subevent_speaker_gain_changed_get_gain(event)); + break; + case HSP_SUBEVENT_HS_COMMAND:{ + memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); + int cmd_length = hsp_subevent_hs_command_get_value_length(event); + int size = cmd_length <= sizeof(hs_cmd_buffer)? cmd_length : sizeof(hs_cmd_buffer); + memcpy(hs_cmd_buffer, hsp_subevent_hs_command_get_value(event), size - 1); + printf("Received custom command: \"%s\". \nExit code or call hsp_ag_send_result.\n", hs_cmd_buffer); + break; + } + default: + printf("event not handled %u\n", event[2]); + break; } break; - case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: - if (hsp_subevent_audio_connection_complete_get_status(event)){ - printf("Audio connection establishment failed with status %u\n", hsp_subevent_audio_connection_complete_get_status(event)); - sco_handle = 0; - } else { - sco_handle = hsp_subevent_audio_connection_complete_get_handle(event); - printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); - hci_request_sco_can_send_now_event(); - } - break; - case HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE: - if (hsp_subevent_audio_disconnection_complete_get_status(event)){ - printf("Audio connection releasing failed with status %u\n", hsp_subevent_audio_disconnection_complete_get_status(event)); - } else { - printf("Audio connection released.\n\n"); - sco_handle = 0; - } - break; - case HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED: - printf("Received microphone gain change %d\n", hsp_subevent_microphone_gain_changed_get_gain(event)); - break; - case HSP_SUBEVENT_SPEAKER_GAIN_CHANGED: - printf("Received speaker gain change %d\n", hsp_subevent_speaker_gain_changed_get_gain(event)); - break; - case HSP_SUBEVENT_HS_COMMAND:{ - memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); - int cmd_length = hsp_subevent_hs_command_get_value_length(event); - int size = cmd_length <= sizeof(hs_cmd_buffer)? cmd_length : sizeof(hs_cmd_buffer); - memcpy(hs_cmd_buffer, hsp_subevent_hs_command_get_value(event), size - 1); - printf("Received custom command: \"%s\". \nExit code or call hsp_ag_send_result.\n", hs_cmd_buffer); - break; - } default: - printf("event not handled %u\n", event[2]); break; } break; @@ -319,8 +320,6 @@ static void packet_handler(uint8_t * event, uint16_t event_size){ int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ - hci_register_sco_packet_handler(&sco_packet_handler); - l2cap_init(); sdp_init(); @@ -333,7 +332,8 @@ int btstack_main(int argc, const char * argv[]){ rfcomm_init(); hsp_ag_init(rfcomm_channel_nr); - hsp_ag_register_packet_handler(packet_handler); + hsp_ag_register_packet_handler(&packet_handler); + hci_register_sco_packet_handler(&packet_handler); #ifdef HAVE_POSIX_STDIN btstack_stdin_setup(stdin_process); diff --git a/example/hsp_hs_demo.c b/example/hsp_hs_demo.c index ffa509db0..ec2d1bbd3 100644 --- a/example/hsp_hs_demo.c +++ b/example/hsp_hs_demo.c @@ -215,103 +215,95 @@ static void send_sco_data(void){ hci_request_sco_can_send_now_event(); static int count = 0; + count++; if ((count & SCO_REPORT_PERIOD)) return; printf("SCO packets sent: %u\n", count); } -static void sco_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t size){ - static int count = 0; +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ + static int sco_rev_count = 0; switch (packet_type){ + case HCI_SCO_DATA_PACKET: + sco_rev_count++; + if ((sco_rev_count & SCO_REPORT_PERIOD)) break; + printf("SCO packets received: %u\n", sco_rev_count); + break; case HCI_EVENT_PACKET: - if (packet[0] == HCI_EVENT_SCO_CAN_SEND_NOW){ - send_sco_data(); - } - break; - default: - count++; - if ((count & SCO_REPORT_PERIOD)) return; - printf("SCO packets received: %u\n", count); - break; - } -} + switch (event[0]) { + case BTSTACK_EVENT_STATE: + if (btstack_event_state_get_state(event) != HCI_STATE_WORKING) break; + show_usage(); + break; + case HCI_EVENT_SCO_CAN_SEND_NOW: + send_sco_data(); + break; + case HCI_EVENT_HSP_META: + switch (event[2]) { + case HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE: + if (hsp_subevent_rfcomm_connection_complete_get_status(event)){ + printf("RFCOMM connection establishement failed with status %u\n", hsp_subevent_audio_connection_complete_get_handle(event)); + } else { + printf("RFCOMM connection established.\n"); + } + break; + case HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE: + if (hsp_subevent_rfcomm_disconnection_complete_get_status(event)){ + printf("RFCOMM disconnection failed with status %u.\n", hsp_subevent_rfcomm_disconnection_complete_get_status(event)); + } else { + printf("RFCOMM disconnected.\n"); + } + break; + case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: + if (hsp_subevent_audio_connection_complete_get_status(event)){ + printf("Audio connection establishment failed with status %u\n", hsp_subevent_audio_connection_complete_get_status(event)); + sco_handle = 0; + } else { + sco_handle = hsp_subevent_audio_connection_complete_get_handle(event); + printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); + hci_request_sco_can_send_now_event(); + } + break; + case HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE: + if (hsp_subevent_audio_disconnection_complete_get_status(event)){ + printf("Audio connection releasing failed with status %u\n", hsp_subevent_audio_disconnection_complete_get_status(event)); + } else { + printf("Audio connection released.\n\n"); + sco_handle = 0; + } + break; + case HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED: + printf("Received microphone gain change %d\n", hsp_subevent_microphone_gain_changed_get_gain(event)); + break; + case HSP_SUBEVENT_SPEAKER_GAIN_CHANGED: + printf("Received speaker gain change %d\n", hsp_subevent_speaker_gain_changed_get_gain(event)); + break; + case HSP_SUBEVENT_RING: + printf("HS: RING RING!\n"); + break; + case HSP_SUBEVENT_AG_INDICATION: { + memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); + int size = hsp_subevent_ag_indication_get_value_length(event); + if (size >= sizeof(hs_cmd_buffer)-1){ + size = sizeof(hs_cmd_buffer)-1; + } + memcpy(hs_cmd_buffer, hsp_subevent_ag_indication_get_value(event), size); + printf("Received custom indication: \"%s\". \nExit code or call hsp_hs_send_result.\n", hs_cmd_buffer); -static void packet_handler(uint8_t * event, uint16_t event_size){ - switch (event[0]) { - case BTSTACK_EVENT_STATE: - if (btstack_event_state_get_state(event) != HCI_STATE_WORKING) break; - show_usage(); - break; - case HCI_EVENT_SCO_CAN_SEND_NOW: - send_sco_data(); - break; - case HCI_EVENT_HSP_META: - switch (event[2]) { - case HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE: - if (hsp_subevent_rfcomm_connection_complete_get_status(event)){ - printf("RFCOMM connection establishement failed with status %u\n", hsp_subevent_audio_connection_complete_get_handle(event)); - } else { - printf("RFCOMM connection established.\n"); - } - break; - case HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE: - if (hsp_subevent_rfcomm_disconnection_complete_get_status(event)){ - printf("RFCOMM disconnection failed with status %u.\n", hsp_subevent_rfcomm_disconnection_complete_get_status(event)); - } else { - printf("RFCOMM disconnected.\n"); + } + break; + default: + printf("event not handled %u\n", event[2]); + break; } break; - case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: - if (hsp_subevent_audio_connection_complete_get_status(event)){ - printf("Audio connection establishment failed with status %u\n", hsp_subevent_audio_connection_complete_get_status(event)); - sco_handle = 0; - } else { - sco_handle = hsp_subevent_audio_connection_complete_get_handle(event); - printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); - hci_request_sco_can_send_now_event(); - } - break; - case HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE: - if (hsp_subevent_audio_disconnection_complete_get_status(event)){ - printf("Audio connection releasing failed with status %u\n", hsp_subevent_audio_disconnection_complete_get_status(event)); - } else { - printf("Audio connection released.\n\n"); - sco_handle = 0; - } - break; - case HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED: - printf("Received microphone gain change %d\n", hsp_subevent_microphone_gain_changed_get_gain(event)); - break; - case HSP_SUBEVENT_SPEAKER_GAIN_CHANGED: - printf("Received speaker gain change %d\n", hsp_subevent_speaker_gain_changed_get_gain(event)); - break; - case HSP_SUBEVENT_RING: - printf("HS: RING RING!\n"); - break; - case HSP_SUBEVENT_AG_INDICATION: { - memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); - int size = hsp_subevent_ag_indication_get_value_length(event); - if (size >= sizeof(hs_cmd_buffer)-1){ - size = sizeof(hs_cmd_buffer)-1; - } - memcpy(hs_cmd_buffer, hsp_subevent_ag_indication_get_value(event), size); - printf("Received custom indication: \"%s\". \nExit code or call hsp_hs_send_result.\n", hs_cmd_buffer); - - } - break; default: - printf("event not handled %u\n", event[2]); break; } - break; default: break; } } -static void handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t size){ - packet_handler(packet, size); -} - /* @section Main Application Setup * * @text Listing MainConfiguration shows main application code. @@ -331,9 +323,9 @@ int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ // register for HCI events - hci_event_callback_registration.callback = &handle_hci_event; + hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); - hci_register_sco_packet_handler(&sco_packet_handler); + hci_register_sco_packet_handler(&packet_handler); l2cap_init(); diff --git a/src/classic/hfp.c b/src/classic/hfp.c index 0a51433c2..a47178ad6 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -96,12 +96,12 @@ static const char * hfp_ag_features[] = { static btstack_linked_list_t hfp_connections = NULL; static void parse_sequence(hfp_connection_t * context); -static hfp_callback_t hfp_callback; +static btstack_packet_handler_t hfp_callback; static btstack_packet_handler_t rfcomm_packet_handler; static hfp_connection_t * sco_establishment_active; -void hfp_set_callback(hfp_callback_t callback){ +void hfp_set_callback(btstack_packet_handler_t callback){ hfp_callback = callback; } @@ -186,26 +186,26 @@ int join_bitmap(char * buffer, int buffer_size, uint32_t values, int values_nr){ return offset; } -void hfp_emit_simple_event(hfp_callback_t callback, uint8_t event_subtype){ +void hfp_emit_simple_event(btstack_packet_handler_t callback, uint8_t event_subtype){ if (!callback) return; uint8_t event[3]; event[0] = HCI_EVENT_HFP_META; event[1] = sizeof(event) - 2; event[2] = event_subtype; - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } -void hfp_emit_event(hfp_callback_t callback, uint8_t event_subtype, uint8_t value){ +void hfp_emit_event(btstack_packet_handler_t callback, uint8_t event_subtype, uint8_t value){ if (!callback) return; uint8_t event[4]; event[0] = HCI_EVENT_HFP_META; event[1] = sizeof(event) - 2; event[2] = event_subtype; event[3] = value; // status 0 == OK - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } -void hfp_emit_connection_event(hfp_callback_t callback, uint8_t event_subtype, uint8_t status, hci_con_handle_t con_handle){ +void hfp_emit_connection_event(btstack_packet_handler_t callback, uint8_t event_subtype, uint8_t status, hci_con_handle_t con_handle){ if (!callback) return; uint8_t event[6]; event[0] = HCI_EVENT_HFP_META; @@ -213,10 +213,10 @@ void hfp_emit_connection_event(hfp_callback_t callback, uint8_t event_subtype, u event[2] = event_subtype; event[3] = status; // status 0 == OK little_endian_store_16(event, 4, con_handle); - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } -void hfp_emit_string_event(hfp_callback_t callback, uint8_t event_subtype, const char * value){ +void hfp_emit_string_event(btstack_packet_handler_t callback, uint8_t event_subtype, const char * value){ if (!callback) return; uint8_t event[40]; event[0] = HCI_EVENT_HFP_META; @@ -225,7 +225,7 @@ void hfp_emit_string_event(hfp_callback_t callback, uint8_t event_subtype, const int size = (strlen(value) < sizeof(event) - 4) ? strlen(value) : sizeof(event) - 4; strncpy((char*)&event[3], value, size); event[3 + size] = 0; - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } btstack_linked_list_t * hfp_get_connections(void){ diff --git a/src/classic/hfp.h b/src/classic/hfp.h index 68c9e80a0..e1c067342 100644 --- a/src/classic/hfp.h +++ b/src/classic/hfp.h @@ -432,8 +432,6 @@ typedef enum{ HFP_CALL_SM } hfp_state_machine_t; -typedef void (*hfp_callback_t)(uint8_t * event, uint16_t event_size); - typedef struct{ uint16_t uuid; uint8_t state; // enabled @@ -621,16 +619,16 @@ int get_bit(uint16_t bitmap, int position); int store_bit(uint32_t bitmap, int position, uint8_t value); // UTILS_END -void hfp_set_callback(hfp_callback_t callback); +void hfp_set_callback(btstack_packet_handler_t callback); void hfp_set_packet_handler_for_rfcomm_connections(btstack_packet_handler_t handler); void hfp_create_sdp_record(uint8_t * service, uint32_t service_record_handle, uint16_t service_uuid, int rfcomm_channel_nr, const char * name); void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); -void hfp_emit_event(hfp_callback_t callback, uint8_t event_subtype, uint8_t value); -void hfp_emit_simple_event(hfp_callback_t callback, uint8_t event_subtype); -void hfp_emit_string_event(hfp_callback_t callback, uint8_t event_subtype, const char * value); -void hfp_emit_connection_event(hfp_callback_t callback, uint8_t event_subtype, uint8_t status, hci_con_handle_t con_handle); +void hfp_emit_event(btstack_packet_handler_t callback, uint8_t event_subtype, uint8_t value); +void hfp_emit_simple_event(btstack_packet_handler_t callback, uint8_t event_subtype); +void hfp_emit_string_event(btstack_packet_handler_t callback, uint8_t event_subtype, const char * value); +void hfp_emit_connection_event(btstack_packet_handler_t callback, uint8_t event_subtype, uint8_t status, hci_con_handle_t con_handle); hfp_connection_t * get_hfp_connection_context_for_rfcomm_cid(uint16_t cid); hfp_connection_t * get_hfp_connection_context_for_bd_addr(bd_addr_t bd_addr); diff --git a/src/classic/hfp_ag.c b/src/classic/hfp_ag.c index 6cc14e70e..f8fe311d2 100644 --- a/src/classic/hfp_ag.c +++ b/src/classic/hfp_ag.c @@ -95,7 +95,7 @@ static hfp_generic_status_indicator_t hfp_generic_status_indicators[HFP_MAX_NUM_ static int hfp_ag_call_hold_services_nr = 0; static char *hfp_ag_call_hold_services[6]; -static hfp_callback_t hfp_callback; +static btstack_packet_handler_t hfp_callback; static hfp_response_and_hold_state_t hfp_ag_response_and_hold_state; static int hfp_ag_response_and_hold_active = 0; @@ -149,7 +149,7 @@ static int get_ag_indicator_index_for_name(const char * name){ } -void hfp_ag_register_packet_handler(hfp_callback_t callback){ +void hfp_ag_register_packet_handler(btstack_packet_handler_t callback){ if (callback == NULL){ log_error("hfp_ag_register_packet_handler called with NULL callback"); return; diff --git a/src/classic/hfp_ag.h b/src/classic/hfp_ag.h index 9881d08f2..272792ae9 100644 --- a/src/classic/hfp_ag.h +++ b/src/classic/hfp_ag.h @@ -115,7 +115,7 @@ void hfp_ag_init_call_hold_services(int call_hold_services_nr, const char * call * @brief Register callback for the HFP Audio Gateway (AG) client. * @param callback */ -void hfp_ag_register_packet_handler(hfp_callback_t callback); +void hfp_ag_register_packet_handler(btstack_packet_handler_t callback); /** * @brief Enable in-band ring tone. diff --git a/src/classic/hfp_hf.c b/src/classic/hfp_hf.c index 878a3292b..1506ea854 100644 --- a/src/classic/hfp_hf.c +++ b/src/classic/hfp_hf.c @@ -74,7 +74,7 @@ static uint32_t hfp_indicators_value[HFP_MAX_NUM_HF_INDICATORS]; static uint8_t hfp_hf_speaker_gain = 9; static uint8_t hfp_hf_microphone_gain = 9; -static hfp_callback_t hfp_callback; +static btstack_packet_handler_t hfp_callback; static hfp_call_status_t hfp_call_status; static hfp_callsetup_status_t hfp_callsetup_status; @@ -84,7 +84,7 @@ static char phone_number[25]; static btstack_packet_callback_registration_t hci_event_callback_registration; -void hfp_hf_register_packet_handler(hfp_callback_t callback){ +void hfp_hf_register_packet_handler(btstack_packet_handler_t callback){ hfp_callback = callback; if (callback == NULL){ log_error("hfp_hf_register_packet_handler called with NULL callback"); @@ -94,7 +94,7 @@ void hfp_hf_register_packet_handler(hfp_callback_t callback){ hfp_set_callback(callback); } -static void hfp_hf_emit_subscriber_information(hfp_callback_t callback, uint8_t event_subtype, uint8_t status, uint8_t bnip_type, const char * bnip_number){ +static void hfp_hf_emit_subscriber_information(btstack_packet_handler_t callback, uint8_t event_subtype, uint8_t status, uint8_t bnip_type, const char * bnip_number){ if (!callback) return; uint8_t event[31]; event[0] = HCI_EVENT_HFP_META; @@ -105,10 +105,10 @@ static void hfp_hf_emit_subscriber_information(hfp_callback_t callback, uint8_t int size = (strlen(bnip_number) < sizeof(event) - 6) ? strlen(bnip_number) : sizeof(event) - 6; strncpy((char*)&event[5], bnip_number, size); event[5 + size] = 0; - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } -static void hfp_hf_emit_type_and_number(hfp_callback_t callback, uint8_t event_subtype, uint8_t bnip_type, const char * bnip_number){ +static void hfp_hf_emit_type_and_number(btstack_packet_handler_t callback, uint8_t event_subtype, uint8_t bnip_type, const char * bnip_number){ if (!callback) return; uint8_t event[30]; event[0] = HCI_EVENT_HFP_META; @@ -118,10 +118,10 @@ static void hfp_hf_emit_type_and_number(hfp_callback_t callback, uint8_t event_s int size = (strlen(bnip_number) < sizeof(event) - 5) ? strlen(bnip_number) : sizeof(event) - 5; strncpy((char*)&event[4], bnip_number, size); event[4 + size] = 0; - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } -static void hfp_hf_emit_enhanced_call_status(hfp_callback_t callback, uint8_t clcc_idx, uint8_t clcc_dir, +static void hfp_hf_emit_enhanced_call_status(btstack_packet_handler_t callback, uint8_t clcc_idx, uint8_t clcc_dir, uint8_t clcc_status, uint8_t clcc_mpty, uint8_t bnip_type, const char * bnip_number){ if (!callback) return; uint8_t event[35]; @@ -136,7 +136,7 @@ static void hfp_hf_emit_enhanced_call_status(hfp_callback_t callback, uint8_t cl int size = (strlen(bnip_number) < sizeof(event) - 10) ? strlen(bnip_number) : sizeof(event) - 10; strncpy((char*)&event[9], bnip_number, size); event[9 + size] = 0; - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } static int hfp_hf_supports_codec(uint8_t codec){ @@ -373,7 +373,7 @@ static int hfp_hf_send_clcc(uint16_t cid){ return send_str_over_rfcomm(cid, buffer); } -static void hfp_emit_ag_indicator_event(hfp_callback_t callback, hfp_ag_indicator_t indicator){ +static void hfp_emit_ag_indicator_event(btstack_packet_handler_t callback, hfp_ag_indicator_t indicator){ if (!callback) return; uint8_t event[5+HFP_MAX_INDICATOR_DESC_SIZE+1]; event[0] = HCI_EVENT_HFP_META; @@ -383,10 +383,10 @@ static void hfp_emit_ag_indicator_event(hfp_callback_t callback, hfp_ag_indicato event[4] = indicator.status; strncpy((char*)&event[5], indicator.name, HFP_MAX_INDICATOR_DESC_SIZE); event[5+HFP_MAX_INDICATOR_DESC_SIZE] = 0; - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } -static void hfp_emit_network_operator_event(hfp_callback_t callback, hfp_network_opearator_t network_operator){ +static void hfp_emit_network_operator_event(btstack_packet_handler_t callback, hfp_network_opearator_t network_operator){ if (!callback) return; uint8_t event[24]; event[0] = HCI_EVENT_HFP_META; @@ -395,7 +395,7 @@ static void hfp_emit_network_operator_event(hfp_callback_t callback, hfp_network event[3] = network_operator.mode; event[4] = network_operator.format; strcpy((char*)&event[5], network_operator.name); - (*callback)(event, sizeof(event)); + (*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } static int hfp_hf_run_for_context_service_level_connection(hfp_connection_t * hfp_connection){ diff --git a/src/classic/hfp_hf.h b/src/classic/hfp_hf.h index a3832bc1e..8e88bad9b 100644 --- a/src/classic/hfp_hf.h +++ b/src/classic/hfp_hf.h @@ -95,7 +95,7 @@ void hfp_hf_init_hf_indicators(int indicators_nr, uint16_t * indicators); * @brief Register callback for the HFP Hands-Free (HF) client. * @param callback */ -void hfp_hf_register_packet_handler(hfp_callback_t callback); +void hfp_hf_register_packet_handler(btstack_packet_handler_t callback); /** * @brief Establish RFCOMM connection with the AG with given Bluetooth address, diff --git a/src/classic/hsp_ag.c b/src/classic/hsp_ag.c index 3e953d452..c4bf0d1ab 100644 --- a/src/classic/hsp_ag.c +++ b/src/classic/hsp_ag.c @@ -124,15 +124,15 @@ typedef enum { static hsp_state_t hsp_state = HSP_IDLE; -static hsp_ag_callback_t hsp_ag_callback; +static btstack_packet_handler_t hsp_ag_callback; static void hsp_run(void); static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); static void handle_query_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); -static void dummy_notify(uint8_t * event, uint16_t size){} +static void dummy_notify(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t size){} -void hsp_ag_register_packet_handler(hsp_ag_callback_t callback){ +void hsp_ag_register_packet_handler(btstack_packet_handler_t callback){ if (callback == NULL){ callback = &dummy_notify; } @@ -146,7 +146,7 @@ static void emit_event(uint8_t event_subtype, uint8_t value){ event[1] = sizeof(event) - 2; event[2] = event_subtype; event[3] = value; // status 0 == OK - (*hsp_ag_callback)(event, sizeof(event)); + (*hsp_ag_callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } static void emit_event_audio_connected(uint8_t status, uint16_t handle){ @@ -157,7 +157,7 @@ static void emit_event_audio_connected(uint8_t status, uint16_t handle){ event[2] = HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE; event[3] = status; little_endian_store_16(event, 4, handle); - (*hsp_ag_callback)(event, sizeof(event)); + (*hsp_ag_callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } void hsp_ag_create_sdp_record(uint8_t * service, uint32_t service_record_handle, int rfcomm_channel_nr, const char * name){ @@ -554,7 +554,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack event[1] = size + 2; event[2] = HSP_SUBEVENT_HS_COMMAND; event[3] = size; - (*hsp_ag_callback)(event, size+4); + (*hsp_ag_callback)(HCI_EVENT_PACKET, 0, event, size+4); } hsp_run(); diff --git a/src/classic/hsp_ag.h b/src/classic/hsp_ag.h index 085ee700b..9f6692a83 100644 --- a/src/classic/hsp_ag.h +++ b/src/classic/hsp_ag.h @@ -54,23 +54,6 @@ extern "C" { /* API_START */ -/** - * @brief Packet handler for HSP Audio Gateway (AG) events. - * - * The HSP AG event has type HCI_EVENT_HSP_META with following subtypes: - * - HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE - * - HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE - * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE - * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE - * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED - * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED - * - HSP_SUBEVENT_HS_COMMAND - * - * @param event See include/btstack/hci_cmds.h - * @param event_size - */ -typedef void (*hsp_ag_callback_t)(uint8_t * event, uint16_t event_size); - /** * @brief Set up HSP AG. * @param rfcomm_channel_nr @@ -88,9 +71,19 @@ void hsp_ag_create_sdp_record(uint8_t * service, uint32_t service_record_handle, /** * @brief Register packet handler to receive HSP AG events. + + * The HSP AG event has type HCI_EVENT_HSP_META with following subtypes: + * - HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE + * - HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE + * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE + * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE + * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED + * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED + * - HSP_SUBEVENT_HS_COMMAND + * * @param callback */ -void hsp_ag_register_packet_handler(hsp_ag_callback_t callback); +void hsp_ag_register_packet_handler(btstack_packet_handler_t callback); /** * @brief Connect to HSP Headset. diff --git a/src/classic/hsp_hs.c b/src/classic/hsp_hs.c index ab1f2813e..8b8995166 100644 --- a/src/classic/hsp_hs.c +++ b/src/classic/hsp_hs.c @@ -123,10 +123,10 @@ static void hsp_run(void); static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); static void handle_query_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); -static hsp_hs_callback_t hsp_hs_callback; -static void dummy_notify(uint8_t * event, uint16_t size){} +static btstack_packet_handler_t hsp_hs_callback; +static void dummy_notify(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t size){} -void hsp_hs_register_packet_handler(hsp_hs_callback_t callback){ +void hsp_hs_register_packet_handler(btstack_packet_handler_t callback){ if (callback == NULL){ callback = &dummy_notify; } @@ -140,7 +140,7 @@ static void emit_event(uint8_t event_subtype, uint8_t value){ event[1] = sizeof(event) - 2; event[2] = event_subtype; event[3] = value; // status 0 == OK - (*hsp_hs_callback)(event, sizeof(event)); + (*hsp_hs_callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } static void emit_ring_event(void){ @@ -149,7 +149,7 @@ static void emit_ring_event(void){ event[0] = HCI_EVENT_HSP_META; event[1] = sizeof(event) - 2; event[2] = HSP_SUBEVENT_RING; - (*hsp_hs_callback)(event, sizeof(event)); + (*hsp_hs_callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } static void emit_event_audio_connected(uint8_t status, uint16_t handle){ @@ -160,7 +160,7 @@ static void emit_event_audio_connected(uint8_t status, uint16_t handle){ event[2] = HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE; event[3] = status; little_endian_store_16(event, 4, handle); - (*hsp_hs_callback)(event, sizeof(event)); + (*hsp_hs_callback)(HCI_EVENT_PACKET, 0, event, sizeof(event)); } // remote audio volume control @@ -474,7 +474,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack event[1] = size + 2; event[2] = HSP_SUBEVENT_AG_INDICATION; event[3] = size; - (*hsp_hs_callback)(event, size+4); + (*hsp_hs_callback)(HCI_EVENT_PACKET, 0, event, size+4); } hsp_run(); return; @@ -587,7 +587,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack case RFCOMM_EVENT_CHANNEL_CLOSED: hsp_hs_reset_state(); - hsp_hs_callback(packet, size); + hsp_hs_callback(HCI_EVENT_PACKET, 0, packet, size); break; default: diff --git a/src/classic/hsp_hs.h b/src/classic/hsp_hs.h index d1838367b..ab29d3ad8 100644 --- a/src/classic/hsp_hs.h +++ b/src/classic/hsp_hs.h @@ -54,24 +54,6 @@ extern "C" { /* API_START */ -/** - * @brief Packet handler for HSP Headset (HS) events. - * - * The HSP HS event has type HCI_EVENT_HSP_META with following subtypes: - * - HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE - * - HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE - * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE - * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE - * - HSP_SUBEVENT_RING - * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED - * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED - * - HSP_SUBEVENT_AG_INDICATION - * - * @param event See include/btstack/hci_cmds.h - * @param event_size - */ -typedef void (*hsp_hs_callback_t)(uint8_t * event, uint16_t event_size); - /** * @brief Set up HSP HS. * @param rfcomm_channel_nr @@ -89,9 +71,20 @@ void hsp_hs_create_sdp_record(uint8_t * service, uint32_t service_record_handle, /** * @brief Register packet handler to receive HSP HS events. + * + * The HSP HS event has type HCI_EVENT_HSP_META with following subtypes: + * - HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE + * - HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE + * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE + * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE + * - HSP_SUBEVENT_RING + * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED + * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED + * - HSP_SUBEVENT_AG_INDICATION + * * @param callback */ -void hsp_hs_register_packet_handler(hsp_hs_callback_t callback); +void hsp_hs_register_packet_handler(btstack_packet_handler_t callback); /** * @brief Connect to HSP Audio Gateway. diff --git a/test/hfp/hfp_ag_client_test.c b/test/hfp/hfp_ag_client_test.c index a976ae135..176718419 100644 --- a/test/hfp/hfp_ag_client_test.c +++ b/test/hfp/hfp_ag_client_test.c @@ -346,7 +346,8 @@ static void simulate_test_sequence(hfp_test_item_t * test_item){ } } -void packet_handler(uint8_t * event, uint16_t event_size){ +void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ + if (event[0] != HCI_EVENT_HFP_META) return; if (event[3] diff --git a/test/hfp/hfp_hf_client_test.c b/test/hfp/hfp_hf_client_test.c index b8d8e8cde..6d4068d36 100644 --- a/test/hfp/hfp_hf_client_test.c +++ b/test/hfp/hfp_hf_client_test.c @@ -391,7 +391,7 @@ void simulate_test_sequence(hfp_test_item_t * test_item){ } } -void packet_handler(uint8_t * event, uint16_t event_size){ +void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ if (event[0] != HCI_EVENT_HFP_META) return; switch (event[2]) { diff --git a/test/pts/hfp_ag_test.c b/test/pts/hfp_ag_test.c index 4d89527ba..e27e0a0b2 100644 --- a/test/pts/hfp_ag_test.c +++ b/test/pts/hfp_ag_test.c @@ -570,7 +570,7 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } -static void packet_handler(uint8_t * event, uint16_t event_size){ +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ switch (event[0]){ case HCI_EVENT_INQUIRY_RESULT: case HCI_EVENT_INQUIRY_RESULT_WITH_RSSI: diff --git a/test/pts/hfp_hf_test.c b/test/pts/hfp_hf_test.c index b55c5a9fb..76d1df4bd 100644 --- a/test/pts/hfp_hf_test.c +++ b/test/pts/hfp_hf_test.c @@ -462,7 +462,7 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } -static void packet_handler(uint8_t * event, uint16_t event_size){ +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ if (event[0] != HCI_EVENT_HFP_META) return; switch (event[2]) { diff --git a/test/pts/hsp_ag_test.c b/test/pts/hsp_ag_test.c index a79e0fe25..b1b63008a 100644 --- a/test/pts/hsp_ag_test.c +++ b/test/pts/hsp_ag_test.c @@ -154,7 +154,7 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } // Audio Gateway routines -static void packet_handler(uint8_t * event, uint16_t event_size){ +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ switch (event[2]) { case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: if (event[3] == 0){ diff --git a/test/pts/hsp_hs_test.c b/test/pts/hsp_hs_test.c index 7d131d883..c0a9e3e07 100644 --- a/test/pts/hsp_hs_test.c +++ b/test/pts/hsp_hs_test.c @@ -159,7 +159,7 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } } -static void packet_handler(uint8_t * event, uint16_t event_size){ +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ // printf("Packet handler event 0x%02x\n", event[0]); switch (event[0]) { case BTSTACK_EVENT_STATE: From bdb44bd96ae543c7a3d46ba439628bc6db6be702 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Apr 2016 21:48:56 +0200 Subject: [PATCH 26/74] example/hsp+hfp: prettify SCO packet count, show remote addr in menu --- example/hfp_ag_demo.c | 4 ++-- example/hfp_hf_demo.c | 2 +- example/hsp_ag_demo.c | 3 +-- example/hsp_hs_demo.c | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index 2f6b05b72..4a9234bb4 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -280,7 +280,7 @@ static void show_usage(void){ printf("\n--- Bluetooth HFP Audiogateway (AG) unit Test Console %s ---\n", bd_addr_to_str(iut_address)); printf("---\n"); - printf("a - establish HFP connection to PTS module\n"); + printf("a - establish HFP connection to PTS module %s\n", bd_addr_to_str(device_addr)); // printf("A - release HFP connection to PTS module\n"); printf("b - establish AUDIO connection\n"); @@ -592,7 +592,7 @@ static void send_sco_data(void){ static int count = 0; count++; - if ((count & SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); + if ((count % SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); } static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ diff --git a/example/hfp_hf_demo.c b/example/hfp_hf_demo.c index 008cccc20..693d07e10 100644 --- a/example/hfp_hf_demo.c +++ b/example/hfp_hf_demo.c @@ -85,7 +85,7 @@ static void show_usage(void){ printf("\n--- Bluetooth HFP Hands-Free (HF) unit Test Console ---\n"); printf("---\n"); - printf("a - establish SLC connection to device\n"); + printf("a - establish SLC connection to device %s\n", bd_addr_to_str(device_addr)); printf("A - release SLC connection to device\n"); printf("b - establish Audio connection\n"); diff --git a/example/hsp_ag_demo.c b/example/hsp_ag_demo.c index 6966245a3..bdc6598d3 100644 --- a/example/hsp_ag_demo.c +++ b/example/hsp_ag_demo.c @@ -215,8 +215,7 @@ static void send_sco_data(void){ hci_request_sco_can_send_now_event(); static int count = 0; - if ((count & SCO_REPORT_PERIOD)) return; - printf("SCO packets sent: %u\n", count); + if ((count % SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); } static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ diff --git a/example/hsp_hs_demo.c b/example/hsp_hs_demo.c index ec2d1bbd3..d2874f9db 100644 --- a/example/hsp_hs_demo.c +++ b/example/hsp_hs_demo.c @@ -216,8 +216,7 @@ static void send_sco_data(void){ static int count = 0; count++; - if ((count & SCO_REPORT_PERIOD)) return; - printf("SCO packets sent: %u\n", count); + if ((count % SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); } static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ From d9ec3f99b2ef5d1f0bc418afb7caf6ce897ad715 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 22 Apr 2016 10:09:40 +0200 Subject: [PATCH 27/74] example/hsp_X_demo: fix error report for HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE --- example/hsp_ag_demo.c | 2 +- example/hsp_hs_demo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/hsp_ag_demo.c b/example/hsp_ag_demo.c index bdc6598d3..e6fe0ac31 100644 --- a/example/hsp_ag_demo.c +++ b/example/hsp_ag_demo.c @@ -243,7 +243,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even switch (event[2]) { case HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE: if (hsp_subevent_rfcomm_connection_complete_get_status(event)){ - printf("RFCOMM connection establishement failed with status %u\n", hsp_subevent_audio_connection_complete_get_handle(event)); + printf("RFCOMM connection establishement failed with status %u\n", hsp_subevent_rfcomm_connection_complete_get_status(event)); } else { printf("RFCOMM connection established.\n"); } diff --git a/example/hsp_hs_demo.c b/example/hsp_hs_demo.c index d2874f9db..81aae70fe 100644 --- a/example/hsp_hs_demo.c +++ b/example/hsp_hs_demo.c @@ -240,7 +240,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even switch (event[2]) { case HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE: if (hsp_subevent_rfcomm_connection_complete_get_status(event)){ - printf("RFCOMM connection establishement failed with status %u\n", hsp_subevent_audio_connection_complete_get_handle(event)); + printf("RFCOMM connection establishement failed with status %u\n", hsp_subevent_rfcomm_connection_complete_get_status(event)); } else { printf("RFCOMM connection established.\n"); } From 664e8b55a1e48293e61484224468b13b65e59636 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 26 Apr 2016 11:44:42 +0200 Subject: [PATCH 28/74] hci_transport_h4_embedded: handle SCO packets --- platform/embedded/hci_transport_h4_embedded.c | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/platform/embedded/hci_transport_h4_embedded.c b/platform/embedded/hci_transport_h4_embedded.c index 24f6750b6..accc1362f 100644 --- a/platform/embedded/hci_transport_h4_embedded.c +++ b/platform/embedded/hci_transport_h4_embedded.c @@ -67,6 +67,7 @@ typedef enum { H4_W4_PACKET_TYPE = 1, H4_W4_EVENT_HEADER, H4_W4_ACL_HEADER, + H4_W4_SCO_HEADER, H4_W4_PAYLOAD, H4_PACKET_RECEIVED } H4_STATE; @@ -171,13 +172,17 @@ static void h4_block_received(void){ switch (h4_state) { case H4_W4_PACKET_TYPE: switch (hci_packet[0]) { + case HCI_EVENT_PACKET: + h4_state = H4_W4_EVENT_HEADER; + bytes_to_read = HCI_EVENT_HEADER_SIZE; + break; case HCI_ACL_DATA_PACKET: h4_state = H4_W4_ACL_HEADER; bytes_to_read = HCI_ACL_HEADER_SIZE; break; - case HCI_EVENT_PACKET: - h4_state = H4_W4_EVENT_HEADER; - bytes_to_read = HCI_EVENT_HEADER_SIZE; + case HCI_SCO_DATA_PACKET: + h4_state = H4_W4_SCO_HEADER; + bytes_to_read = HCI_SCO_HEADER_SIZE; break; default: log_error("h4_process: invalid packet type 0x%02x", hci_packet[0]); @@ -209,7 +214,16 @@ static void h4_block_received(void){ } h4_state = H4_W4_PAYLOAD; break; - + + case H4_W4_SCO_HEADER: + bytes_to_read = hci_packet[2]; + if (bytes_to_read == 0) { + h4_state = H4_PACKET_RECEIVED; + break; + } + h4_state = H4_W4_PAYLOAD; + break; + case H4_W4_PAYLOAD: h4_state = H4_PACKET_RECEIVED; bytes_to_read = 0; From 287b4054fbd741e620a8ec618dc6cbb62bf425eb Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 10:40:55 +0200 Subject: [PATCH 29/74] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23657fee1..676b67992 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ **_Note: Major API Changes. For older projects, you may use the [v0.9 branch](https://github.com/bluekitchen/btstack/tree/v0.9). -Please see [Migration notes]([Migration notes]) _** +Please see [Migration notes](https://github.com/bluekitchen/btstack/blob/master/doc/manual/docs/appendix/migration.md)_** # Welcome to BTstack @@ -27,8 +27,8 @@ It has been qualified with the the Bluetooth SIG for GAP, IOP, HFP, HSP, SPP, PA GATT, SM of the Bluetooth 4.2 LE Central and Peripheral roles (QD ID 25340). ## Documentation -- [HTML](http://bluekitchen-gmbh.com/btstack/v1.0) -- [PDF](http://bluekitchen-gmbh.com/btstack_v1.0.pdf) +- [HTML](http://bluekitchen-gmbh.com/btstack) +- [PDF](http://bluekitchen-gmbh.com/btstack.pdf) ## Supported Protocols * L2CAP From 307a4fe366c56eb7f5c7f3a8cdad9cb33f30f8ee Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 10:47:25 +0200 Subject: [PATCH 30/74] h4: add parts of eHCILL (not tested/working) --- port/posix-h4/btstack_config.h | 1 + src/btstack_uart_block.h | 6 +- src/hci_transport_h4.c | 285 +++++++++++++++++++++++++++++---- src/hci_transport_h5.c | 6 - 4 files changed, 258 insertions(+), 40 deletions(-) diff --git a/port/posix-h4/btstack_config.h b/port/posix-h4/btstack_config.h index 1906cc488..574e9a4ec 100644 --- a/port/posix-h4/btstack_config.h +++ b/port/posix-h4/btstack_config.h @@ -10,6 +10,7 @@ #define HAVE_POSIX_FILE_IO #define HAVE_POSIX_STDIN #define HAVE_POSIX_TIME +#define HAVE_EHCILL // BTstack features that can be enabled #define ENABLE_BLE diff --git a/src/btstack_uart_block.h b/src/btstack_uart_block.h index a7ea609f1..51df4163a 100644 --- a/src/btstack_uart_block.h +++ b/src/btstack_uart_block.h @@ -64,8 +64,8 @@ typedef enum { } btstack_uart_sleep_mode_t; typedef enum { - BTSTACK_UART_SLEEP_MASK_HIGH_WAKE_ON_CTS_PULSE = 1 << BTSTACK_UART_SLEEP_RTS_HIGH_WAKE_ON_CTS_PULSE, - BTSTACK_UART_SLEEP_MASK_RTS_LOW_WAKE_ON_RX_EDGE = 1 << BTSTACK_UART_SLEEP_RTS_LOW_WAKE_ON_RX_EDGE + BTSTACK_UART_SLEEP_MASK_RTS_HIGH_WAKE_ON_CTS_PULSE = 1 << BTSTACK_UART_SLEEP_RTS_HIGH_WAKE_ON_CTS_PULSE, + BTSTACK_UART_SLEEP_MASK_RTS_LOW_WAKE_ON_RX_EDGE = 1 << BTSTACK_UART_SLEEP_RTS_LOW_WAKE_ON_RX_EDGE } btstack_uart_sleep_mode_mask_t; typedef struct { @@ -121,7 +121,7 @@ typedef struct { * query supported wakeup mechanisms * @return supported_sleep_modes mask */ - int (*get_supported_sleep_modes); + int (*get_supported_sleep_modes)(void); /** * set UART sleep mode - allows to turn off UART and it's clocks to save energy diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index 1ac1f9062..fd7960ba2 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -50,9 +50,42 @@ #include "hci_transport.h" #include "btstack_uart_block.h" +// #ifdef HAVE_EHCILL +// #error "HCI Transport H4 POSIX does not support eHCILL yet. Please remove HAVE_EHCILL from your btstack-config.h" +// #endif + #ifdef HAVE_EHCILL -#error "HCI Transport H4 POSIX does not support eHCILL yet. Please remove HAVE_EHCILL from your btstack-config.h" -#endif + +// eHCILL commands +#define EHCILL_GO_TO_SLEEP_IND 0x030 +#define EHCILL_GO_TO_SLEEP_ACK 0x031 +#define EHCILL_WAKE_UP_IND 0x032 +#define EHCILL_WAKE_UP_ACK 0x033 + +static void hci_transport_h4_ehcill_handle(uint8_t action); +static void hci_transport_h4_ehcill_reset_statemachine(void); +static void hci_transport_h4_ehcill_send_ehcill_command(void); +static void hci_transport_h4_ehcill_sleep_ack_timer_setup(void); +static int hci_transport_h4_ehcill_outgoing_packet_ready(void); +static void hci_transport_h4_ehcill_reactivate_rx(void); +static void hci_transport_h4_echill_send_wakeup_ind(void); + +typedef enum { + EHCILL_STATE_SLEEP, + EHCILL_STATE_W4_ACK, + EHCILL_STATE_AWAKE +} EHCILL_STATE; + +// eHCILL state machine +static EHCILL_STATE ehcill_state; +static uint8_t ehcill_command_to_send; +static uint8_t * ehcill_defer_rx_buffer; +static uint16_t ehcill_defer_rx_size = 0; + +// work around for eHCILL problem +static btstack_timer_source_t ehcill_sleep_ack_timer; + +#endif // assert pre-buffer for packet type is available #if !defined(HCI_OUTGOING_PRE_BUFFER_SIZE) || (HCI_OUTGOING_PRE_BUFFER_SIZE == 0) @@ -69,12 +102,25 @@ typedef enum { H4_W4_PAYLOAD, } H4_STATE; +typedef enum { + TX_IDLE = 1, + TX_W4_PACKET_SENT, +#ifdef HAVE_EHCILL + TX_W4_WAKEUP, + TX_W2_EHCILL_SEND, + TX_W4_EHCILL_SENT, +#endif +} TX_STATE; + // UART Driver + Config static const btstack_uart_block_t * btstack_uart; static btstack_uart_config_t uart_config; -// write mutex -static int uart_write_active; +// write state +static TX_STATE tx_state; // updated from block_sent callback +static uint8_t * tx_data; +static uint16_t tx_len; // 0 == no outgoing packet +static uint8_t packet_sent_event[] = { HCI_EVENT_TRANSPORT_PACKET_SENT, 0}; static void (*packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size) = dummy_handler; @@ -103,15 +149,6 @@ static void hci_transport_h4_trigger_next_read(void){ btstack_uart->receive_block(&hci_packet[read_pos], bytes_to_read); } -static void hci_transport_h4_block_sent(void){ - // free mutex - uart_write_active = 0; - - // notify upper stack that it can send again - uint8_t event[] = { HCI_EVENT_TRANSPORT_PACKET_SENT, 0}; - packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event)); -} - static void hci_transport_h4_block_read(void){ read_pos += bytes_to_read; @@ -131,6 +168,15 @@ static void hci_transport_h4_block_read(void){ bytes_to_read = HCI_SCO_HEADER_SIZE; h4_state = H4_W4_SCO_HEADER; break; +#ifdef HAVE_EHCILL + case EHCILL_GO_TO_SLEEP_IND: + case EHCILL_GO_TO_SLEEP_ACK: + case EHCILL_WAKE_UP_IND: + case EHCILL_WAKE_UP_ACK: + bytes_to_read = 1; + hci_transport_h4_ehcill_handle(hci_packet[0]); + break; +#endif default: log_error("h4_process: invalid packet type 0x%02x", hci_packet[0]); hci_transport_h4_reset_statemachine(); @@ -169,6 +215,75 @@ static void hci_transport_h4_block_read(void){ hci_transport_h4_trigger_next_read(); } +static void hci_transport_h4_block_sent(void){ + tx_state = TX_IDLE; + switch (tx_state){ + case TX_W4_PACKET_SENT: + // packet fully sent, reset state + tx_len = 0; + +#ifdef HAVE_EHCILL + // now, send pending ehcill command if neccessary + switch (ehcill_command_to_send){ + case EHCILL_GO_TO_SLEEP_ACK: + hci_transport_h4_ehcill_sleep_ack_timer_setup(); + break; + case EHCILL_WAKE_UP_IND: + hci_transport_h4_ehcill_send_ehcill_command(); + break; + default: + break; + } +#endif + // notify upper stack that it can send again + packet_handler(HCI_EVENT_PACKET, &packet_sent_event[0], sizeof(packet_sent_event)); + break; + +#ifdef HAVE_EHCILL + case TX_W4_EHCILL_SENT: { + int command = ehcill_command_to_send; + ehcill_command_to_send = 0; + if (command == EHCILL_GO_TO_SLEEP_ACK) { + // UART not needed after EHCILL_GO_TO_SLEEP_ACK was sent + if (btstack_uart->get_supported_sleep_modes() & BTSTACK_UART_SLEEP_MASK_RTS_HIGH_WAKE_ON_CTS_PULSE){ + btstack_uart->set_sleep(BTSTACK_UART_SLEEP_RTS_HIGH_WAKE_ON_CTS_PULSE); + } else if (btstack_uart->get_supported_sleep_modes() & BTSTACK_UART_SLEEP_MASK_RTS_LOW_WAKE_ON_RX_EDGE){ + btstack_uart->set_sleep(BTSTACK_UART_SLEEP_RTS_LOW_WAKE_ON_RX_EDGE); + } + } + if (hci_transport_h4_ehcill_outgoing_packet_ready()){ + // already packet ready? then start wakeup + btstack_uart->set_sleep(BTSTACK_UART_SLEEP_OFF); + hci_transport_h4_ehcill_reactivate_rx(); + hci_transport_h4_echill_send_wakeup_ind(); + } + // TODO: trigger run loop + // btstack_run_loop_embedded_trigger(); + break; + } +#endif + + default: + break; + } +} + +static int hci_transport_h4_can_send_now(uint8_t packet_type){ + return tx_state == TX_IDLE; +} + +static int hci_transport_h4_send_packet(uint8_t packet_type, uint8_t * packet, int size){ + // store packet type before actual data and increase size + size++; + packet--; + *packet = packet_type; + + tx_state = TX_W4_PACKET_SENT; + + btstack_uart->send_block(packet, size); + return 0; +} + static void hci_transport_h4_init(const void * transport_config){ // check for hci_transport_config_uart_t if (!transport_config) { @@ -199,6 +314,12 @@ static int hci_transport_h4_open(void){ } hci_transport_h4_reset_statemachine(); hci_transport_h4_trigger_next_read(); + + tx_state = TX_IDLE; + +#ifdef HAVE_EHCILL + hci_transport_h4_ehcill_reset_statemachine(); +#endif return 0; } @@ -210,27 +331,129 @@ static void hci_transport_h4_register_packet_handler(void (*handler)(uint8_t pac packet_handler = handler; } -static int hci_transport_h4_can_send_now(uint8_t packet_type){ - return uart_write_active == 0; -} - -static int hci_transport_h4_send_packet(uint8_t packet_type, uint8_t * packet, int size){ - // store packet type before actual data and increase size - size++; - packet--; - *packet = packet_type; - - // lock mutex - uart_write_active = 1; - - // - btstack_uart->send_block(packet, size); - return 0; -} - static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ } +// --- main part of eHCILL implementation --- + +#ifdef HAVE_EHCILL + +static void hci_transport_h4_ehcill_reactivate_rx(void){ + if (!ehcill_defer_rx_size){ + log_error("EHCILL: NO RX REQUEST PENDING"); + return; + } + log_info ("EHCILL: Re-activate rx"); + // receive request, clears RTS + int rx_size = ehcill_defer_rx_size; + ehcill_defer_rx_size = 0; + btstack_uart->receive_block(ehcill_defer_rx_buffer, rx_size); +} + +static void hci_transport_h4_echill_send_wakeup_ind(void){ + // update state + tx_state = TX_W4_WAKEUP; + ehcill_state = EHCILL_STATE_W4_ACK; + ehcill_command_to_send = EHCILL_WAKE_UP_IND; + btstack_uart->send_block(&ehcill_command_to_send, 1); +} + +static int hci_transport_h4_ehcill_outgoing_packet_ready(void){ + return tx_len != 0; +} + +// static int ehcill_sleep_mode_active(void){ +// return ehcill_state == EHCILL_STATE_SLEEP; +// } + +static void hci_transport_h4_ehcill_reset_statemachine(void){ + ehcill_state = EHCILL_STATE_AWAKE; +} + +static void hci_transport_h4_ehcill_send_ehcill_command(void){ + tx_state = TX_W4_EHCILL_SENT; + btstack_uart->send_block(&ehcill_command_to_send, 1); +} + +static void hci_transport_h4_ehcill_sleep_ack_timer_handler(btstack_timer_source_t * timer){ + hci_transport_h4_ehcill_send_ehcill_command(); +} + +static void hci_transport_h4_ehcill_sleep_ack_timer_setup(void){ + // setup timer + ehcill_sleep_ack_timer.process = &hci_transport_h4_ehcill_sleep_ack_timer_handler; + btstack_run_loop_set_timer(&ehcill_sleep_ack_timer, 50); + btstack_run_loop_add_timer(&ehcill_sleep_ack_timer); + // TODO: trigger run loop + // btstack_run_loop_embedded_trigger(); +} + +static void hci_transport_h4_ehcill_schedule_ecill_command(uint8_t command){ + ehcill_command_to_send = command; + switch (tx_state){ + case TX_IDLE: + if (ehcill_command_to_send == EHCILL_WAKE_UP_ACK){ + // send right away + hci_transport_h4_ehcill_send_ehcill_command(); + } else { + // change state so BTstack cannot send and setup timer + tx_state = TX_W2_EHCILL_SEND; + hci_transport_h4_ehcill_sleep_ack_timer_setup(); + } + break; + default: + break; + } +} + +static void hci_transport_h4_ehcill_handle(uint8_t action){ + // log_info("hci_transport_h4_ehcill_handle: %x, state %u, defer_rx %u", action, ehcill_state, ehcill_defer_rx_size); + switch(ehcill_state){ + case EHCILL_STATE_AWAKE: + switch(action){ + case EHCILL_GO_TO_SLEEP_IND: + // 1. set RTS high - already done by BT RX ISR + // 2. enable CTS IRQ - CTS always enabled + ehcill_state = EHCILL_STATE_SLEEP; + log_info("EHCILL: GO_TO_SLEEP_IND RX"); + hci_transport_h4_ehcill_schedule_ecill_command(EHCILL_GO_TO_SLEEP_ACK); + break; + default: + break; + } + break; + + case EHCILL_STATE_SLEEP: + switch(action){ + case EHCILL_WAKE_UP_IND: + ehcill_state = EHCILL_STATE_AWAKE; + log_info("EHCILL: WAKE_UP_IND RX"); + hci_transport_h4_ehcill_schedule_ecill_command(EHCILL_WAKE_UP_ACK); + break; + + default: + break; + } + break; + + case EHCILL_STATE_W4_ACK: + switch(action){ + case EHCILL_WAKE_UP_IND: + case EHCILL_WAKE_UP_ACK: + log_info("EHCILL: WAKE_UP_IND or ACK"); + tx_state = TX_W4_PACKET_SENT; + ehcill_state = EHCILL_STATE_AWAKE; + btstack_uart->send_block(tx_data, tx_len); + break; + default: + break; + } + break; + } +} +#endif +// --- end of eHCILL implementation --------- + static const hci_transport_t hci_transport_h4 = { /* const char * name; */ "H4", /* void (*init) (const void *transport_config); */ &hci_transport_h4_init, diff --git a/src/hci_transport_h5.c b/src/hci_transport_h5.c index 2387d84a5..95504c5af 100644 --- a/src/hci_transport_h5.c +++ b/src/hci_transport_h5.c @@ -49,12 +49,6 @@ #include "hci_transport.h" #include "btstack_uart_block.h" -#ifdef HAVE_EHCILL -#error "HCI Transport H5 does not support eHCILL. Please either use (H4 + HAVE_EHCILL) or H5 Transport" -#endif - -/// newer - typedef enum { LINK_UNINITIALIZED, LINK_INITIALIZED, From 82d05f164db93aa27aedcdc559a0e5578e3c054e Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 11:51:01 +0200 Subject: [PATCH 31/74] hci_transport_h4: fix compile --- src/hci_transport_h4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index fd7960ba2..527f884be 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -85,8 +85,11 @@ static uint16_t ehcill_defer_rx_size = 0; // work around for eHCILL problem static btstack_timer_source_t ehcill_sleep_ack_timer; +static uint8_t * tx_data; + #endif + // assert pre-buffer for packet type is available #if !defined(HCI_OUTGOING_PRE_BUFFER_SIZE) || (HCI_OUTGOING_PRE_BUFFER_SIZE == 0) #error HCI_OUTGOING_PRE_BUFFER_SIZE not defined. Please update hci.h @@ -118,7 +121,6 @@ static btstack_uart_config_t uart_config; // write state static TX_STATE tx_state; // updated from block_sent callback -static uint8_t * tx_data; static uint16_t tx_len; // 0 == no outgoing packet static uint8_t packet_sent_event[] = { HCI_EVENT_TRANSPORT_PACKET_SENT, 0}; From 8a23fc5312800685de9e8e4fa3907c561747a9c6 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 15:05:57 +0200 Subject: [PATCH 32/74] hci_transport_h4: eHCILL working on POSIX --- port/posix-h4/main.c | 4 + src/hci_transport_h4.c | 196 ++++++++++++++++++++++++++--------------- 2 files changed, 127 insertions(+), 73 deletions(-) diff --git a/port/posix-h4/main.c b/port/posix-h4/main.c index ae4bd0dcb..eff8793e6 100644 --- a/port/posix-h4/main.c +++ b/port/posix-h4/main.c @@ -139,6 +139,10 @@ static void local_version_information_callback(uint8_t * packet){ printf("Texas Instruments - CC256x compatible chipset.\n"); use_fast_uart(); hci_set_chipset(btstack_chipset_cc256x_instance()); +#ifdef HAVE_EHCILL + printf("Enabling eHCILL\n"); + btstack_chipset_cc256x_enable_ehcill(1); +#endif break; case COMPANY_ID_BROADCOM_CORPORATION: printf("Broadcom chipset. Not supported yet\n"); diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index 527f884be..a3ebcc522 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -38,7 +38,7 @@ /* * hci_h4_transport.c * - * HCI Transport API implementation for basic H4 protocol over POSIX + * HCI Transport API implementation for H4 protocol over POSIX with optional support for eHCILL * * Created by Matthias Ringwald on 4/29/09. */ @@ -50,10 +50,6 @@ #include "hci_transport.h" #include "btstack_uart_block.h" -// #ifdef HAVE_EHCILL -// #error "HCI Transport H4 POSIX does not support eHCILL yet. Please remove HAVE_EHCILL from your btstack-config.h" -// #endif - #ifdef HAVE_EHCILL // eHCILL commands @@ -62,13 +58,17 @@ #define EHCILL_WAKE_UP_IND 0x032 #define EHCILL_WAKE_UP_ACK 0x033 -static void hci_transport_h4_ehcill_handle(uint8_t action); +static int hci_transport_h4_ehcill_outgoing_packet_ready(void); +static int hci_transport_h4_ehcill_sleep_mode_active(void); +static void hci_transport_h4_echill_send_wakeup_ind(void); +static void hci_transport_h4_ehcill_handle_command(uint8_t action); +static void hci_transport_h4_ehcill_handle_ehcill_command_sent(void); +static void hci_transport_h4_ehcill_handle_packet_sent(void); +static void hci_transport_h4_ehcill_open(void); static void hci_transport_h4_ehcill_reset_statemachine(void); static void hci_transport_h4_ehcill_send_ehcill_command(void); static void hci_transport_h4_ehcill_sleep_ack_timer_setup(void); -static int hci_transport_h4_ehcill_outgoing_packet_ready(void); -static void hci_transport_h4_ehcill_reactivate_rx(void); -static void hci_transport_h4_echill_send_wakeup_ind(void); +static void hci_transport_h4_ehcill_trigger_wakeup(void); typedef enum { EHCILL_STATE_SLEEP, @@ -79,14 +79,10 @@ typedef enum { // eHCILL state machine static EHCILL_STATE ehcill_state; static uint8_t ehcill_command_to_send; -static uint8_t * ehcill_defer_rx_buffer; -static uint16_t ehcill_defer_rx_size = 0; // work around for eHCILL problem static btstack_timer_source_t ehcill_sleep_ack_timer; -static uint8_t * tx_data; - #endif @@ -117,11 +113,14 @@ typedef enum { // UART Driver + Config static const btstack_uart_block_t * btstack_uart; +static btstack_uart_sleep_mode_t btstack_uart_sleep_mode; static btstack_uart_config_t uart_config; // write state -static TX_STATE tx_state; // updated from block_sent callback -static uint16_t tx_len; // 0 == no outgoing packet +static TX_STATE tx_state; +static uint8_t * tx_data; +static uint16_t tx_len; // 0 == no outgoing packet + static uint8_t packet_sent_event[] = { HCI_EVENT_TRANSPORT_PACKET_SENT, 0}; static void (*packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size) = dummy_handler; @@ -147,7 +146,7 @@ static void hci_transport_h4_reset_statemachine(void){ } static void hci_transport_h4_trigger_next_read(void){ - // trigger next read + // log_info("hci_transport_h4_trigger_next_read: %u bytes", bytes_to_read); btstack_uart->receive_block(&hci_packet[read_pos], bytes_to_read); } @@ -175,12 +174,12 @@ static void hci_transport_h4_block_read(void){ case EHCILL_GO_TO_SLEEP_ACK: case EHCILL_WAKE_UP_IND: case EHCILL_WAKE_UP_ACK: - bytes_to_read = 1; - hci_transport_h4_ehcill_handle(hci_packet[0]); + hci_transport_h4_ehcill_handle_command(hci_packet[0]); + hci_transport_h4_reset_statemachine(); break; #endif default: - log_error("h4_process: invalid packet type 0x%02x", hci_packet[0]); + log_error("hci_transport_h4: invalid packet type 0x%02x", hci_packet[0]); hci_transport_h4_reset_statemachine(); break; } @@ -195,7 +194,7 @@ static void hci_transport_h4_block_read(void){ bytes_to_read = little_endian_read_16( hci_packet, 3); // check ACL length if (HCI_ACL_HEADER_SIZE + bytes_to_read > HCI_PACKET_BUFFER_SIZE){ - log_error("h4_process: invalid ACL payload len %u - only space for %u", bytes_to_read, HCI_PACKET_BUFFER_SIZE - HCI_ACL_HEADER_SIZE); + log_error("hci_transport_h4: invalid ACL payload len %u - only space for %u", bytes_to_read, HCI_PACKET_BUFFER_SIZE - HCI_ACL_HEADER_SIZE); hci_transport_h4_reset_statemachine(); break; } @@ -218,51 +217,24 @@ static void hci_transport_h4_block_read(void){ } static void hci_transport_h4_block_sent(void){ - tx_state = TX_IDLE; switch (tx_state){ case TX_W4_PACKET_SENT: // packet fully sent, reset state tx_len = 0; + tx_state = TX_IDLE; #ifdef HAVE_EHCILL - // now, send pending ehcill command if neccessary - switch (ehcill_command_to_send){ - case EHCILL_GO_TO_SLEEP_ACK: - hci_transport_h4_ehcill_sleep_ack_timer_setup(); - break; - case EHCILL_WAKE_UP_IND: - hci_transport_h4_ehcill_send_ehcill_command(); - break; - default: - break; - } + // notify eHCILL engine + hci_transport_h4_ehcill_handle_packet_sent(); #endif // notify upper stack that it can send again packet_handler(HCI_EVENT_PACKET, &packet_sent_event[0], sizeof(packet_sent_event)); break; #ifdef HAVE_EHCILL - case TX_W4_EHCILL_SENT: { - int command = ehcill_command_to_send; - ehcill_command_to_send = 0; - if (command == EHCILL_GO_TO_SLEEP_ACK) { - // UART not needed after EHCILL_GO_TO_SLEEP_ACK was sent - if (btstack_uart->get_supported_sleep_modes() & BTSTACK_UART_SLEEP_MASK_RTS_HIGH_WAKE_ON_CTS_PULSE){ - btstack_uart->set_sleep(BTSTACK_UART_SLEEP_RTS_HIGH_WAKE_ON_CTS_PULSE); - } else if (btstack_uart->get_supported_sleep_modes() & BTSTACK_UART_SLEEP_MASK_RTS_LOW_WAKE_ON_RX_EDGE){ - btstack_uart->set_sleep(BTSTACK_UART_SLEEP_RTS_LOW_WAKE_ON_RX_EDGE); - } - } - if (hci_transport_h4_ehcill_outgoing_packet_ready()){ - // already packet ready? then start wakeup - btstack_uart->set_sleep(BTSTACK_UART_SLEEP_OFF); - hci_transport_h4_ehcill_reactivate_rx(); - hci_transport_h4_echill_send_wakeup_ind(); - } - // TODO: trigger run loop - // btstack_run_loop_embedded_trigger(); + case TX_W4_EHCILL_SENT: + hci_transport_h4_ehcill_handle_ehcill_command_sent(); break; - } #endif default: @@ -280,8 +252,19 @@ static int hci_transport_h4_send_packet(uint8_t packet_type, uint8_t * packet, i packet--; *packet = packet_type; - tx_state = TX_W4_PACKET_SENT; + // store request + tx_len = size; + tx_data = packet; +#ifdef HAVE_EHCILL + if (hci_transport_h4_ehcill_sleep_mode_active()){ + hci_transport_h4_ehcill_trigger_wakeup(); + return 0; + } +#endif + + // start sending + tx_state = TX_W4_PACKET_SENT; btstack_uart->send_block(packet, size); return 0; } @@ -320,7 +303,7 @@ static int hci_transport_h4_open(void){ tx_state = TX_IDLE; #ifdef HAVE_EHCILL - hci_transport_h4_ehcill_reset_statemachine(); + hci_transport_h4_ehcill_open(); #endif return 0; } @@ -336,20 +319,30 @@ static void hci_transport_h4_register_packet_handler(void (*handler)(uint8_t pac static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ } +// // --- main part of eHCILL implementation --- +// #ifdef HAVE_EHCILL -static void hci_transport_h4_ehcill_reactivate_rx(void){ - if (!ehcill_defer_rx_size){ - log_error("EHCILL: NO RX REQUEST PENDING"); - return; +static void hci_transport_h4_ehcill_open(void){ + hci_transport_h4_ehcill_reset_statemachine(); + + // find best sleep mode to use: wake on CTS, wake on RX, none + btstack_uart_sleep_mode = BTSTACK_UART_SLEEP_OFF; + int supported_sleep_modes = 0; + if (btstack_uart->get_supported_sleep_modes){ + supported_sleep_modes = btstack_uart->get_supported_sleep_modes(); + } + if (supported_sleep_modes & BTSTACK_UART_SLEEP_MASK_RTS_HIGH_WAKE_ON_CTS_PULSE){ + log_info("eHCILL: using wake on CTS"); + btstack_uart_sleep_mode = BTSTACK_UART_SLEEP_RTS_HIGH_WAKE_ON_CTS_PULSE; + } else if (supported_sleep_modes & BTSTACK_UART_SLEEP_MASK_RTS_LOW_WAKE_ON_RX_EDGE){ + log_info("eHCILL: using wake on RX"); + btstack_uart_sleep_mode = BTSTACK_UART_SLEEP_RTS_LOW_WAKE_ON_RX_EDGE; + } else { + log_info("eHCILL: UART driver does not provide compatible sleep mode"); } - log_info ("EHCILL: Re-activate rx"); - // receive request, clears RTS - int rx_size = ehcill_defer_rx_size; - ehcill_defer_rx_size = 0; - btstack_uart->receive_block(ehcill_defer_rx_buffer, rx_size); } static void hci_transport_h4_echill_send_wakeup_ind(void){ @@ -364,32 +357,54 @@ static int hci_transport_h4_ehcill_outgoing_packet_ready(void){ return tx_len != 0; } -// static int ehcill_sleep_mode_active(void){ -// return ehcill_state == EHCILL_STATE_SLEEP; -// } +static int hci_transport_h4_ehcill_sleep_mode_active(void){ + return ehcill_state == EHCILL_STATE_SLEEP; +} static void hci_transport_h4_ehcill_reset_statemachine(void){ ehcill_state = EHCILL_STATE_AWAKE; } static void hci_transport_h4_ehcill_send_ehcill_command(void){ + log_debug("eHCILL: send command %02x", ehcill_command_to_send); tx_state = TX_W4_EHCILL_SENT; btstack_uart->send_block(&ehcill_command_to_send, 1); } static void hci_transport_h4_ehcill_sleep_ack_timer_handler(btstack_timer_source_t * timer){ + log_debug("eHCILL: timer triggered"); hci_transport_h4_ehcill_send_ehcill_command(); } static void hci_transport_h4_ehcill_sleep_ack_timer_setup(void){ // setup timer - ehcill_sleep_ack_timer.process = &hci_transport_h4_ehcill_sleep_ack_timer_handler; + log_debug("eHCILL: set timer for sending command"); + btstack_run_loop_set_timer_handler(&ehcill_sleep_ack_timer, &hci_transport_h4_ehcill_sleep_ack_timer_handler); btstack_run_loop_set_timer(&ehcill_sleep_ack_timer, 50); btstack_run_loop_add_timer(&ehcill_sleep_ack_timer); + // TODO: trigger run loop // btstack_run_loop_embedded_trigger(); } +static void hci_transport_h4_ehcill_trigger_wakeup(void){ + switch (tx_state){ + case TX_W2_EHCILL_SEND: + case TX_W4_EHCILL_SENT: + // wake up / sleep ack in progress, nothing to do now + return; + case TX_IDLE: + default: + // all clear, prepare for wakeup + break; + } + // UART needed again + if (btstack_uart_sleep_mode){ + btstack_uart->set_sleep(BTSTACK_UART_SLEEP_OFF); + } + hci_transport_h4_echill_send_wakeup_ind(); +} + static void hci_transport_h4_ehcill_schedule_ecill_command(uint8_t command){ ehcill_command_to_send = command; switch (tx_state){ @@ -408,16 +423,14 @@ static void hci_transport_h4_ehcill_schedule_ecill_command(uint8_t command){ } } -static void hci_transport_h4_ehcill_handle(uint8_t action){ +static void hci_transport_h4_ehcill_handle_command(uint8_t action){ // log_info("hci_transport_h4_ehcill_handle: %x, state %u, defer_rx %u", action, ehcill_state, ehcill_defer_rx_size); switch(ehcill_state){ case EHCILL_STATE_AWAKE: switch(action){ case EHCILL_GO_TO_SLEEP_IND: - // 1. set RTS high - already done by BT RX ISR - // 2. enable CTS IRQ - CTS always enabled ehcill_state = EHCILL_STATE_SLEEP; - log_info("EHCILL: GO_TO_SLEEP_IND RX"); + log_info("eHCILL: GO_TO_SLEEP_IND RX"); hci_transport_h4_ehcill_schedule_ecill_command(EHCILL_GO_TO_SLEEP_ACK); break; default: @@ -429,7 +442,7 @@ static void hci_transport_h4_ehcill_handle(uint8_t action){ switch(action){ case EHCILL_WAKE_UP_IND: ehcill_state = EHCILL_STATE_AWAKE; - log_info("EHCILL: WAKE_UP_IND RX"); + log_info("eHCILL: WAKE_UP_IND RX"); hci_transport_h4_ehcill_schedule_ecill_command(EHCILL_WAKE_UP_ACK); break; @@ -442,7 +455,7 @@ static void hci_transport_h4_ehcill_handle(uint8_t action){ switch(action){ case EHCILL_WAKE_UP_IND: case EHCILL_WAKE_UP_ACK: - log_info("EHCILL: WAKE_UP_IND or ACK"); + log_info("eHCILL: WAKE_UP_IND or ACK"); tx_state = TX_W4_PACKET_SENT; ehcill_state = EHCILL_STATE_AWAKE; btstack_uart->send_block(tx_data, tx_len); @@ -453,6 +466,43 @@ static void hci_transport_h4_ehcill_handle(uint8_t action){ break; } } + +static void hci_transport_h4_ehcill_handle_packet_sent(void){ + // now, send pending ehcill command if neccessary + switch (ehcill_command_to_send){ + case EHCILL_GO_TO_SLEEP_ACK: + hci_transport_h4_ehcill_sleep_ack_timer_setup(); + break; + case EHCILL_WAKE_UP_IND: + hci_transport_h4_ehcill_send_ehcill_command(); + break; + default: + break; + } +} + +static void hci_transport_h4_ehcill_handle_ehcill_command_sent(void){ + tx_state = TX_IDLE; + int command = ehcill_command_to_send; + ehcill_command_to_send = 0; + if (command == EHCILL_GO_TO_SLEEP_ACK) { + log_info("eHCILL: GO_TO_SLEEP_ACK sent, enter sleep mode"); + // UART not needed after EHCILL_GO_TO_SLEEP_ACK was sent + if (btstack_uart_sleep_mode != BTSTACK_UART_SLEEP_OFF){ + btstack_uart->set_sleep(btstack_uart_sleep_mode); + } + } + // already packet ready? then start wakeup + if (hci_transport_h4_ehcill_outgoing_packet_ready()){ + if (btstack_uart_sleep_mode){ + btstack_uart->set_sleep(BTSTACK_UART_SLEEP_OFF); + } + hci_transport_h4_echill_send_wakeup_ind(); + } + // TODO: trigger run loop + // btstack_run_loop_embedded_trigger(); +} + #endif // --- end of eHCILL implementation --------- From f6a20ec99f2b0088cdfa67e0f267fd1d10e3f0ec Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 15:18:55 +0200 Subject: [PATCH 33/74] eHCILL: use ENABLE_EHCILL instead of HAVE_EHCILL plus runtime enable call, updated docs --- chipset/cc256x/btstack_chipset_cc256x.c | 19 +++++-------------- chipset/cc256x/btstack_chipset_cc256x.h | 2 -- doc/manual/docs/how_to.md | 2 +- platform/embedded/hci_transport_h4_embedded.c | 2 +- port/ez430-rf2560/btstack_config.h | 2 +- port/ez430-rf2560/src/main.c | 3 --- port/msp-exp430f5438-cc2564b/btstack_config.h | 2 +- .../example/hid_demo.c | 3 --- port/msp-exp430f5438-cc2564b/src/main.c | 3 --- port/msp430f5229lp-cc2564b/btstack_config.h | 3 +-- port/msp430f5229lp-cc2564b/src/main.c | 3 --- port/nrf5x/btstack_config.h | 2 -- port/posix-h4/btstack_config.h | 2 +- port/posix-h4/main.c | 5 ++--- port/stm32-f103rb-nucleo/btstack_config.h | 2 +- port/stm32-f103rb-nucleo/main.c | 3 --- port/wiced/btstack_config.h | 1 - src/hci_transport_h4.c | 19 ++++++++++--------- 18 files changed, 24 insertions(+), 54 deletions(-) diff --git a/chipset/cc256x/btstack_chipset_cc256x.c b/chipset/cc256x/btstack_chipset_cc256x.c index 47336f759..2a3719ec9 100644 --- a/chipset/cc256x/btstack_chipset_cc256x.c +++ b/chipset/cc256x/btstack_chipset_cc256x.c @@ -84,7 +84,6 @@ extern const uint32_t cc256x_init_script_size; // init script static uint32_t init_script_offset = 0; static int16_t init_power_in_dB = 13; // 13 dBm -static int init_ehcill_enabled = 0; // support for SCO over HCI #ifdef ENABLE_SCO_OVER_HCI @@ -193,11 +192,11 @@ static void update_set_class2_single_power(uint8_t * hci_cmd_buffer){ // eHCILL activate from http://e2e.ti.com/support/low_power_rf/f/660/p/134855/484776.aspx static void update_sleep_mode_configurations(uint8_t * hci_cmd_buffer){ - if (init_ehcill_enabled) { - hci_cmd_buffer[4] = 1; - } else { - hci_cmd_buffer[4] = 0; - } +#ifdef ENABLE_EHCILL + hci_cmd_buffer[4] = 1; +#else + hci_cmd_buffer[4] = 0; +#endif } static void update_init_script_command(uint8_t *hci_cmd_buffer){ @@ -275,14 +274,6 @@ static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){ // MARK: public API -void btstack_chipset_cc256x_enable_ehcill(int on){ - init_ehcill_enabled = on; -} - -int btstack_chipset_cc256x_ehcill_enabled(void){ - return init_ehcill_enabled; -} - void btstack_chipset_cc256x_set_power(int16_t power_in_dB){ init_power_in_dB = power_in_dB; } diff --git a/chipset/cc256x/btstack_chipset_cc256x.h b/chipset/cc256x/btstack_chipset_cc256x.h index 8cf1fc692..ec2433fa3 100644 --- a/chipset/cc256x/btstack_chipset_cc256x.h +++ b/chipset/cc256x/btstack_chipset_cc256x.h @@ -50,8 +50,6 @@ extern "C" { #include #include "btstack_chipset.h" -void btstack_chipset_cc256x_enable_ehcill(int on); -int btstack_chipset_cc256x_ehcill_enabled(void); void btstack_chipset_cc256x_set_power(int16_t power_in_dB); const btstack_chipset_t * btstack_chipset_cc256x_instance(void); diff --git a/doc/manual/docs/how_to.md b/doc/manual/docs/how_to.md index b88e467d0..c6a7813bc 100644 --- a/doc/manual/docs/how_to.md +++ b/doc/manual/docs/how_to.md @@ -39,7 +39,6 @@ System properties: #define | Description -----------------------------------|------------------------------------- -HAVE_EHCILL | TI CC256x/WL18xx with eHCILL is used HAVE_MALLOC | Use dynamic memory @@ -70,6 +69,7 @@ BTstack properties: -------------------------|--------------------------------------------- ENABLE_CLASSIC | Enable Classic related code in HCI and L2CAP ENABLE_BLE | Enable BLE related code in HCI and L2CAP +ENABLE_EHCILL | Enable eHCILL low power mode on TI CC256x/WL18xx chipsets ENABLE_LOG_DEBUG | Enable log_debug messages ENABLE_LOG_ERROR | Enable log_error messages ENABLE_LOG_INFO | Enable log_info messages diff --git a/platform/embedded/hci_transport_h4_embedded.c b/platform/embedded/hci_transport_h4_embedded.c index 5fc034eac..90a525478 100644 --- a/platform/embedded/hci_transport_h4_embedded.c +++ b/platform/embedded/hci_transport_h4_embedded.c @@ -59,7 +59,7 @@ #error HCI_OUTGOING_PRE_BUFFER_SIZE not defined. Please update hci.h #endif -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL #error "HCI Transport H4 DMA does not support eHCILL. Please use hci_transport_h4_ehcill_dma.c instead." #endif diff --git a/port/ez430-rf2560/btstack_config.h b/port/ez430-rf2560/btstack_config.h index 91d2fc317..7db358a8d 100644 --- a/port/ez430-rf2560/btstack_config.h +++ b/port/ez430-rf2560/btstack_config.h @@ -8,7 +8,6 @@ // Port related features #define HAVE_INIT_SCRIPT #define HAVE_EMBEDDED_TICK -#define HAVE_EHCILL // BTstack features that can be enabled #define ENABLE_BLE @@ -16,6 +15,7 @@ #define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO +// #define ENABLE_EHCILL // BTstack configuration. buffers, sizes, ... #define HCI_ACL_PAYLOAD_SIZE 52 diff --git a/port/ez430-rf2560/src/main.c b/port/ez430-rf2560/src/main.c index 6b7d62e8c..a46d2dff8 100644 --- a/port/ez430-rf2560/src/main.c +++ b/port/ez430-rf2560/src/main.c @@ -114,9 +114,6 @@ int main(void) // inform about BTstack state hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); - - // use eHCILL - btstack_chipset_cc256x_enable_ehcill(1); // ready - enable irq used in h4 task __enable_interrupt(); diff --git a/port/msp-exp430f5438-cc2564b/btstack_config.h b/port/msp-exp430f5438-cc2564b/btstack_config.h index 171560e1f..1bd975fd7 100644 --- a/port/msp-exp430f5438-cc2564b/btstack_config.h +++ b/port/msp-exp430f5438-cc2564b/btstack_config.h @@ -6,7 +6,6 @@ #define __BTSTACK_CONFIG // Port related features -#define HAVE_EHCILL #define HAVE_INIT_SCRIPT #define HAVE_EMBEDDED_TICK @@ -16,6 +15,7 @@ // #define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO +// #define ENABLE_EHCILL // BTstack configuration. buffers, sizes, ... #define HCI_ACL_PAYLOAD_SIZE 52 diff --git a/port/msp-exp430f5438-cc2564b/example/hid_demo.c b/port/msp-exp430f5438-cc2564b/example/hid_demo.c index 886626653..87ec7ace2 100644 --- a/port/msp-exp430f5438-cc2564b/example/hid_demo.c +++ b/port/msp-exp430f5438-cc2564b/example/hid_demo.c @@ -384,9 +384,6 @@ int main(void){ hci_set_link_key_db(link_key_db); hci_set_chipset(btstack_chipset_cc256x_instance()); - // use eHCILL - btstack_chipset_cc256x_enable_ehcill(1); - // register for HCI events hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); diff --git a/port/msp-exp430f5438-cc2564b/src/main.c b/port/msp-exp430f5438-cc2564b/src/main.c index 08f02adbc..2c31fc5c9 100644 --- a/port/msp-exp430f5438-cc2564b/src/main.c +++ b/port/msp-exp430f5438-cc2564b/src/main.c @@ -114,9 +114,6 @@ static void btstack_setup(void){ // inform about BTstack state hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); - - // use eHCILL - btstack_chipset_cc256x_enable_ehcill(1); } int btstack_main(int argc, const char * argv[]); diff --git a/port/msp430f5229lp-cc2564b/btstack_config.h b/port/msp430f5229lp-cc2564b/btstack_config.h index a0d709db1..96ca2563a 100644 --- a/port/msp430f5229lp-cc2564b/btstack_config.h +++ b/port/msp430f5229lp-cc2564b/btstack_config.h @@ -9,14 +9,13 @@ #define HAVE_INIT_SCRIPT #define HAVE_EMBEDDED_TICK -// #define HAVE_EHCILL - // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC #define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO +// #define ENABLE_EHCILL // BTstack configuration. buffers, sizes, ... #define HCI_ACL_PAYLOAD_SIZE 52 diff --git a/port/msp430f5229lp-cc2564b/src/main.c b/port/msp430f5229lp-cc2564b/src/main.c index 7928b9e83..837995d03 100644 --- a/port/msp430f5229lp-cc2564b/src/main.c +++ b/port/msp430f5229lp-cc2564b/src/main.c @@ -121,9 +121,6 @@ static void btstack_setup(void){ // inform about BTstack state hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); - - // use eHCILL - // btstack_chipset_cc256x_enable_ehcill(1); } int btstack_main(int argc, const char * argv[]); diff --git a/port/nrf5x/btstack_config.h b/port/nrf5x/btstack_config.h index 377bb5181..d11bbc0fe 100644 --- a/port/nrf5x/btstack_config.h +++ b/port/nrf5x/btstack_config.h @@ -6,9 +6,7 @@ #define __BTSTACK_CONFIG // Port related features -#define HAVE_EHCILL #define HAVE_EMBEDDED_TIME_MS -#define WICED_BT_UART_MANUAL_CTS_RTS // BTstack features that can be enabled #define ENABLE_BLE diff --git a/port/posix-h4/btstack_config.h b/port/posix-h4/btstack_config.h index 574e9a4ec..34d701205 100644 --- a/port/posix-h4/btstack_config.h +++ b/port/posix-h4/btstack_config.h @@ -10,7 +10,6 @@ #define HAVE_POSIX_FILE_IO #define HAVE_POSIX_STDIN #define HAVE_POSIX_TIME -#define HAVE_EHCILL // BTstack features that can be enabled #define ENABLE_BLE @@ -20,6 +19,7 @@ #define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP +#define ENABLE_EHCILL // BTstack configuration. buffers, sizes, ... #define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy diff --git a/port/posix-h4/main.c b/port/posix-h4/main.c index eff8793e6..5c5f4402f 100644 --- a/port/posix-h4/main.c +++ b/port/posix-h4/main.c @@ -139,9 +139,8 @@ static void local_version_information_callback(uint8_t * packet){ printf("Texas Instruments - CC256x compatible chipset.\n"); use_fast_uart(); hci_set_chipset(btstack_chipset_cc256x_instance()); -#ifdef HAVE_EHCILL - printf("Enabling eHCILL\n"); - btstack_chipset_cc256x_enable_ehcill(1); +#ifdef ENABLE_EHCILL + printf("eHCILL enabled.\n"); #endif break; case COMPANY_ID_BROADCOM_CORPORATION: diff --git a/port/stm32-f103rb-nucleo/btstack_config.h b/port/stm32-f103rb-nucleo/btstack_config.h index adfd9841e..a3fb65477 100644 --- a/port/stm32-f103rb-nucleo/btstack_config.h +++ b/port/stm32-f103rb-nucleo/btstack_config.h @@ -8,13 +8,13 @@ // Port related features #define HAVE_INIT_SCRIPT #define HAVE_EMBEDDED_TICK -#define HAVE_EHCILL // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC // #define ENABLE_LOG_INFO // #define ENABLE_LOG_ERROR +// #define ENABLE_EHCILL // BTstack configuration. buffers, sizes, ... #define HCI_ACL_PAYLOAD_SIZE 52 diff --git a/port/stm32-f103rb-nucleo/main.c b/port/stm32-f103rb-nucleo/main.c index e09e8aa5d..c07828bd1 100644 --- a/port/stm32-f103rb-nucleo/main.c +++ b/port/stm32-f103rb-nucleo/main.c @@ -442,9 +442,6 @@ int main(void) hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); - // enable eHCILL - btstack_chipset_cc256x_enable_ehcill(1); - // hand over to btstack embedded code btstack_main(); diff --git a/port/wiced/btstack_config.h b/port/wiced/btstack_config.h index 377bb5181..e394b2b5d 100644 --- a/port/wiced/btstack_config.h +++ b/port/wiced/btstack_config.h @@ -6,7 +6,6 @@ #define __BTSTACK_CONFIG // Port related features -#define HAVE_EHCILL #define HAVE_EMBEDDED_TIME_MS #define WICED_BT_UART_MANUAL_CTS_RTS diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index a3ebcc522..86b562900 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -50,7 +50,7 @@ #include "hci_transport.h" #include "btstack_uart_block.h" -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL // eHCILL commands #define EHCILL_GO_TO_SLEEP_IND 0x030 @@ -80,6 +80,8 @@ typedef enum { static EHCILL_STATE ehcill_state; static uint8_t ehcill_command_to_send; +static btstack_uart_sleep_mode_t btstack_uart_sleep_mode; + // work around for eHCILL problem static btstack_timer_source_t ehcill_sleep_ack_timer; @@ -104,7 +106,7 @@ typedef enum { typedef enum { TX_IDLE = 1, TX_W4_PACKET_SENT, -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL TX_W4_WAKEUP, TX_W2_EHCILL_SEND, TX_W4_EHCILL_SENT, @@ -113,7 +115,6 @@ typedef enum { // UART Driver + Config static const btstack_uart_block_t * btstack_uart; -static btstack_uart_sleep_mode_t btstack_uart_sleep_mode; static btstack_uart_config_t uart_config; // write state @@ -169,7 +170,7 @@ static void hci_transport_h4_block_read(void){ bytes_to_read = HCI_SCO_HEADER_SIZE; h4_state = H4_W4_SCO_HEADER; break; -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL case EHCILL_GO_TO_SLEEP_IND: case EHCILL_GO_TO_SLEEP_ACK: case EHCILL_WAKE_UP_IND: @@ -223,7 +224,7 @@ static void hci_transport_h4_block_sent(void){ tx_len = 0; tx_state = TX_IDLE; -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL // notify eHCILL engine hci_transport_h4_ehcill_handle_packet_sent(); #endif @@ -231,7 +232,7 @@ static void hci_transport_h4_block_sent(void){ packet_handler(HCI_EVENT_PACKET, &packet_sent_event[0], sizeof(packet_sent_event)); break; -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL case TX_W4_EHCILL_SENT: hci_transport_h4_ehcill_handle_ehcill_command_sent(); break; @@ -256,7 +257,7 @@ static int hci_transport_h4_send_packet(uint8_t packet_type, uint8_t * packet, i tx_len = size; tx_data = packet; -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL if (hci_transport_h4_ehcill_sleep_mode_active()){ hci_transport_h4_ehcill_trigger_wakeup(); return 0; @@ -302,7 +303,7 @@ static int hci_transport_h4_open(void){ tx_state = TX_IDLE; -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL hci_transport_h4_ehcill_open(); #endif return 0; @@ -323,7 +324,7 @@ static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ // --- main part of eHCILL implementation --- // -#ifdef HAVE_EHCILL +#ifdef ENABLE_EHCILL static void hci_transport_h4_ehcill_open(void){ hci_transport_h4_ehcill_reset_statemachine(); From 019a10b5a3c4915af226f51a9a016baa2981759c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 15:20:27 +0200 Subject: [PATCH 34/74] hci_transport_h4: remove commented code about triggering run loop --- src/hci_transport_h4.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index 86b562900..ca1d5d220 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -383,9 +383,6 @@ static void hci_transport_h4_ehcill_sleep_ack_timer_setup(void){ btstack_run_loop_set_timer_handler(&ehcill_sleep_ack_timer, &hci_transport_h4_ehcill_sleep_ack_timer_handler); btstack_run_loop_set_timer(&ehcill_sleep_ack_timer, 50); btstack_run_loop_add_timer(&ehcill_sleep_ack_timer); - - // TODO: trigger run loop - // btstack_run_loop_embedded_trigger(); } static void hci_transport_h4_ehcill_trigger_wakeup(void){ @@ -500,8 +497,6 @@ static void hci_transport_h4_ehcill_handle_ehcill_command_sent(void){ } hci_transport_h4_echill_send_wakeup_ind(); } - // TODO: trigger run loop - // btstack_run_loop_embedded_trigger(); } #endif From d8e28fa375587fd0f46a02a64827e5a7a8cc44cc Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 15:50:05 +0200 Subject: [PATCH 35/74] h5: call uart set sleep if link enters sleep mode --- src/hci_transport_h5.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/hci_transport_h5.c b/src/hci_transport_h5.c index 95504c5af..00d748aae 100644 --- a/src/hci_transport_h5.c +++ b/src/hci_transport_h5.c @@ -120,6 +120,7 @@ static int hci_transport_link_actions; // UART Driver + Config static const btstack_uart_block_t * btstack_uart; static btstack_uart_config_t uart_config; +static btstack_uart_sleep_mode_t btstack_uart_sleep_mode; static int uart_write_active; @@ -487,7 +488,12 @@ static void hci_transport_h5_process_frame(uint16_t frame_size){ break; } if (memcmp(slip_payload, link_control_sleep, sizeof(link_control_sleep)) == 0){ - log_info("link: received sleep message"); + if (btstack_uart_sleep_mode){ + log_info("link: received sleep message. Enabling UART Sleep."); + btstack_uart->set_sleep(btstack_uart_sleep_mode); + } else { + log_info("link: received sleep message. UART Sleep not supported"); + } link_peer_asleep = 1; break; } @@ -585,6 +591,19 @@ static int hci_transport_h5_open(void){ return res; } + // check if wake on RX can be used + btstack_uart_sleep_mode = BTSTACK_UART_SLEEP_OFF; + int supported_sleep_modes = 0; + if (btstack_uart->get_supported_sleep_modes){ + supported_sleep_modes = btstack_uart->get_supported_sleep_modes(); + } + if (supported_sleep_modes & BTSTACK_UART_SLEEP_MASK_RTS_LOW_WAKE_ON_RX_EDGE){ + log_info("H5: using wake on RX"); + btstack_uart_sleep_mode = BTSTACK_UART_SLEEP_RTS_LOW_WAKE_ON_RX_EDGE; + } else { + log_info("H5: UART driver does not provide compatible sleep mode"); + } + // setup resend timeout hci_transport_link_update_resend_timeout(uart_config.baudrate); @@ -625,6 +644,10 @@ static int hci_transport_h5_send_packet(uint8_t packet_type, uint8_t *packet, in // send wakeup first if (link_peer_asleep){ + if (btstack_uart_sleep_mode){ + log_info("h5: disable UART sleep"); + btstack_uart->set_sleep(BTSTACK_UART_SLEEP_OFF); + } hci_transport_link_actions |= HCI_TRANSPORT_LINK_SEND_WAKEUP; hci_transport_link_set_timer(LINK_WAKEUP_MS); } else { From 8aa44d5a9ad1445096926ab42e48179218c2f31a Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 22:19:44 +0200 Subject: [PATCH 36/74] btstack_uart_embedded: fix typo, working --- platform/embedded/btstack_uart_block_embedded.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/embedded/btstack_uart_block_embedded.c b/platform/embedded/btstack_uart_block_embedded.c index ca5590d1d..092cadca7 100644 --- a/platform/embedded/btstack_uart_block_embedded.c +++ b/platform/embedded/btstack_uart_block_embedded.c @@ -85,8 +85,8 @@ static void btstack_uart_embedded_process(btstack_data_source_t *ds, btstack_dat send_complete = 0; block_sent(); } - if (block_received){ - block_received = 0; + if (receive_complete){ + receive_complete = 0; block_received(); } break; From 52984ae229b467c771959d7dd21df3f0c10b6a04 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 22:21:29 +0200 Subject: [PATCH 37/74] pic32: disable set baud in hal_uart_dma.h implementation --- port/pic32-harmony/src/btstack_port.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/port/pic32-harmony/src/btstack_port.c b/port/pic32-harmony/src/btstack_port.c index 983096505..cc3c5e67a 100644 --- a/port/pic32-harmony/src/btstack_port.c +++ b/port/pic32-harmony/src/btstack_port.c @@ -164,20 +164,6 @@ void hal_uart_dma_init(void){ // HACK: CTS doesn't seem to work right now msleep(250); - - // HACK: CSR seems to do an auto-baud on the uart, which makes the first HCI RESET fail - // 2 options: a) check for CTS going high within 10 ms, b) just send HCI RESET twice - -// const uint8_t hci_reset_cmd[] = {0x01, 0x03, 0x0c, 0x00}; -// int pos = 0; -// while(pos < sizeof(hci_reset_cmd)){ -// if (PLIB_USART_TransmitterIsEmpty(BT_USART_ID)){ -// PLIB_USART_TransmitterByteSend(BT_USART_ID, hci_reset_cmd[pos]); -// pos++; -// } -// } -// msleep(250); - } void hal_uart_dma_set_block_received( void (*the_block_handler)(void)){ @@ -193,9 +179,9 @@ void hal_uart_dma_set_csr_irq_handler( void (*the_irq_handler)(void)){ } int hal_uart_dma_set_baud(uint32_t baud){ - PLIB_USART_Disable(BT_USART_ID); - PLIB_USART_BaudRateSet(BT_USART_ID, SYS_CLK_PeripheralFrequencyGet(CLK_BUS_PERIPHERAL_1), baud); - PLIB_USART_Enable(BT_USART_ID); +// PLIB_USART_Disable(BT_USART_ID); +// PLIB_USART_BaudRateSet(BT_USART_ID, SYS_CLK_PeripheralFrequencyGet(CLK_BUS_PERIPHERAL_1), baud); +// PLIB_USART_Enable(BT_USART_ID); return 0; } @@ -237,7 +223,7 @@ void BTSTACK_Initialize ( void ) hci_dump_open(NULL, HCI_DUMP_STDOUT); - const hci_transport_t * transport = hci_transport_h4_instance(btstack_uart_block_embedded_instance); + const hci_transport_t * transport = hci_transport_h4_instance(btstack_uart_block_embedded_instance()); hci_init(transport, &config); hci_set_chipset(btstack_chipset_csr_instance()); From ebd8f44018d1fdddc77b7af1b9169de598d7d4d3 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 27 Apr 2016 22:22:18 +0200 Subject: [PATCH 38/74] pic32: update project for v1.0 --- .../app.X/nbproject/Makefile-default.mk | 82 ++++++++++++------- .../nbproject/Makefile-genesis.properties | 4 +- .../app.X/nbproject/configurations.xml | 13 ++- .../nbproject/private/configurations.xml | 4 +- .../app.X/nbproject/private/private.xml | 10 ++- 5 files changed, 76 insertions(+), 37 deletions(-) diff --git a/port/pic32-harmony/app.X/nbproject/Makefile-default.mk b/port/pic32-harmony/app.X/nbproject/Makefile-default.mk index be78f9f8d..172e35e9d 100644 --- a/port/pic32-harmony/app.X/nbproject/Makefile-default.mk +++ b/port/pic32-harmony/app.X/nbproject/Makefile-default.mk @@ -45,17 +45,17 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} # Source Files Quoted if spaced -SOURCEFILES_QUOTED_IF_SPACED=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../platform/embedded/hci_transport_h4_embedded.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c +SOURCEFILES_QUOTED_IF_SPACED=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../src/classic/spp_server.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/hci_transport_h4.c # Object Files Quoted if spaced -OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o -POSSIBLE_DEPFILES=${OBJECTDIR}/_ext/2048875307/system_init.o.d ${OBJECTDIR}/_ext/2048875307/system_tasks.o.d ${OBJECTDIR}/_ext/1360937237/btstack_port.o.d ${OBJECTDIR}/_ext/1360937237/app_debug.o.d ${OBJECTDIR}/_ext/1360937237/app.o.d ${OBJECTDIR}/_ext/1360937237/main.o.d ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d ${OBJECTDIR}/_ext/534563071/ad_parser.o.d ${OBJECTDIR}/_ext/534563071/att_db.o.d ${OBJECTDIR}/_ext/534563071/att_dispatch.o.d ${OBJECTDIR}/_ext/534563071/att_server.o.d ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d ${OBJECTDIR}/_ext/534563071/sm.o.d ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d ${OBJECTDIR}/_ext/1386528437/hci.o.d ${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d ${OBJECTDIR}/_ext/1386528437/hci_dump.o.d ${OBJECTDIR}/_ext/1386528437/l2cap.o.d ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d ${OBJECTDIR}/_ext/1386327864/rfcomm.o.d ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d ${OBJECTDIR}/_ext/1386327864/sdp_server.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d ${OBJECTDIR}/_ext/1386327864/sdp_util.o.d ${OBJECTDIR}/_ext/1386528437/btstack_util.o.d ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o.d ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d ${OBJECTDIR}/_ext/2147153351/sys_ports.o.d +OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o +POSSIBLE_DEPFILES=${OBJECTDIR}/_ext/2048875307/system_init.o.d ${OBJECTDIR}/_ext/2048875307/system_tasks.o.d ${OBJECTDIR}/_ext/1360937237/btstack_port.o.d ${OBJECTDIR}/_ext/1360937237/app_debug.o.d ${OBJECTDIR}/_ext/1360937237/app.o.d ${OBJECTDIR}/_ext/1360937237/main.o.d ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d ${OBJECTDIR}/_ext/534563071/ad_parser.o.d ${OBJECTDIR}/_ext/534563071/att_db.o.d ${OBJECTDIR}/_ext/534563071/att_dispatch.o.d ${OBJECTDIR}/_ext/534563071/att_server.o.d ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d ${OBJECTDIR}/_ext/534563071/sm.o.d ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d ${OBJECTDIR}/_ext/1386528437/hci.o.d ${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d ${OBJECTDIR}/_ext/1386528437/hci_dump.o.d ${OBJECTDIR}/_ext/1386528437/l2cap.o.d ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d ${OBJECTDIR}/_ext/1386327864/rfcomm.o.d ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d ${OBJECTDIR}/_ext/1386327864/sdp_server.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d ${OBJECTDIR}/_ext/1386327864/sdp_util.o.d ${OBJECTDIR}/_ext/1386528437/btstack_util.o.d ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d ${OBJECTDIR}/_ext/2147153351/sys_ports.o.d ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d ${OBJECTDIR}/_ext/1386327864/spp_server.o.d ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d # Object Files -OBJECTFILES=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o +OBJECTFILES=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o # Source Files -SOURCEFILES=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../platform/embedded/hci_transport_h4_embedded.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c +SOURCEFILES=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../src/classic/spp_server.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/hci_transport_h4.c CFLAGS= @@ -274,18 +274,6 @@ ${OBJECTDIR}/_ext/1386528437/btstack_util.o: ../../../src/btstack_util.c nbproj @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_util.o @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ../../../src/btstack_util.c -${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/993942601" - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c - -${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o: ../../../platform/embedded/hci_transport_h4_embedded.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/993942601" - @${RM} ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o.d - @${RM} ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o ../../../platform/embedded/hci_transport_h4_embedded.c - ${OBJECTDIR}/_ext/1880736137/drv_tmr.o: ../../../../driver/tmr/src/dynamic/drv_tmr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1880736137" @${RM} ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d @@ -328,6 +316,30 @@ ${OBJECTDIR}/_ext/2147153351/sys_ports.o: ../../../../system/ports/src/sys_ports @${RM} ${OBJECTDIR}/_ext/2147153351/sys_ports.o @${FIXDEPS} "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" -o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ../../../../system/ports/src/sys_ports.c +${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/993942601" + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c + +${OBJECTDIR}/_ext/1386327864/spp_server.o: ../../../src/classic/spp_server.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386327864" + @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o.d + @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c + +${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o: ../../../platform/embedded/btstack_uart_block_embedded.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/993942601" + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c + +${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o: ../../../src/hci_transport_h4.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386528437" + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c + else ${OBJECTDIR}/_ext/2048875307/system_init.o: ../src/system_config/bk-audio-dk/system_init.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/2048875307" @@ -509,18 +521,6 @@ ${OBJECTDIR}/_ext/1386528437/btstack_util.o: ../../../src/btstack_util.c nbproj @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_util.o @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ../../../src/btstack_util.c -${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/993942601" - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c - -${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o: ../../../platform/embedded/hci_transport_h4_embedded.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/993942601" - @${RM} ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o.d - @${RM} ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/hci_transport_h4_embedded.o ../../../platform/embedded/hci_transport_h4_embedded.c - ${OBJECTDIR}/_ext/1880736137/drv_tmr.o: ../../../../driver/tmr/src/dynamic/drv_tmr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1880736137" @${RM} ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d @@ -563,6 +563,30 @@ ${OBJECTDIR}/_ext/2147153351/sys_ports.o: ../../../../system/ports/src/sys_ports @${RM} ${OBJECTDIR}/_ext/2147153351/sys_ports.o @${FIXDEPS} "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" -o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ../../../../system/ports/src/sys_ports.c +${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/993942601" + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c + +${OBJECTDIR}/_ext/1386327864/spp_server.o: ../../../src/classic/spp_server.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386327864" + @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o.d + @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c + +${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o: ../../../platform/embedded/btstack_uart_block_embedded.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/993942601" + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c + +${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o: ../../../src/hci_transport_h4.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386528437" + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c + endif # ------------------------------------------------------------------------------------ diff --git a/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties b/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties index 9e9c57a22..693100866 100644 --- a/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties +++ b/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties @@ -1,8 +1,8 @@ # -#Mon Mar 07 22:03:33 CET 2016 +#Wed Apr 27 22:00:29 CEST 2016 default.com-microchip-mplab-nbide-toolchainXC32-XC32LanguageToolchain.md5=53fb2ac0203ca7bc347fa1cfc029d2dd default.languagetoolchain.dir=/Applications/microchip/xc32/v1.40/bin -configurations-xml=935f32d81efe418a2148905ef6c8a87c +configurations-xml=245c47cf2d07f60cc50126a4a19bbcb8 com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=4b47e815d50912689a67d0b162f47a58 default.languagetoolchain.version=1.40 host.platform=mac diff --git a/port/pic32-harmony/app.X/nbproject/configurations.xml b/port/pic32-harmony/app.X/nbproject/configurations.xml index c99d6479b..8301bbaef 100644 --- a/port/pic32-harmony/app.X/nbproject/configurations.xml +++ b/port/pic32-harmony/app.X/nbproject/configurations.xml @@ -35,6 +35,7 @@ ../../../src/classic/sdp_server.h ../../../src/classic/sdp_client.h ../../../src/classic/sdp_client_rfcomm.h + ../../../src/classic/spp_server.h ../../../platform/embedded/hal_cpu.h @@ -57,6 +58,7 @@ ../../../src/hci_transport.h ../../../src/l2cap.h ../../../src/l2cap_signaling.h + ../../../src/btstack_uart_block.h @@ -116,6 +118,10 @@ ../../../chipset/csr/btstack_chipset_csr.c + + ../../../platform/embedded/btstack_run_loop_embedded.c + ../../../platform/embedded/btstack_uart_block_embedded.c + ../../../src/btstack_memory.c ../../../src/hci.c @@ -133,8 +139,8 @@ ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c - ../../../platform/embedded/btstack_run_loop_embedded.c - ../../../platform/embedded/hci_transport_h4_embedded.c + ../../../src/classic/spp_server.c + ../../../src/hci_transport_h4.c @@ -201,7 +207,7 @@ PICkit3PlatformTool XC32 - + 1.40 4 @@ -377,6 +383,7 @@ + diff --git a/port/pic32-harmony/app.X/nbproject/private/configurations.xml b/port/pic32-harmony/app.X/nbproject/private/configurations.xml index 1102937f0..e6be655eb 100644 --- a/port/pic32-harmony/app.X/nbproject/private/configurations.xml +++ b/port/pic32-harmony/app.X/nbproject/private/configurations.xml @@ -4,8 +4,8 @@ 0 - - + :=MPLABComm-USB-Microchip:=<vid>04D8:=<pid>900A:=<rev>0002:=<man>Microchip Technology Inc.:=<prod>PICkit 3:=<sn>BUR140172964:=<drv>x:=<xpt>h:=end + /Applications/microchip/xc32/v1.40/bin place holder 1 place holder 2 diff --git a/port/pic32-harmony/app.X/nbproject/private/private.xml b/port/pic32-harmony/app.X/nbproject/private/private.xml index 65d519ac9..00c2fa251 100644 --- a/port/pic32-harmony/app.X/nbproject/private/private.xml +++ b/port/pic32-harmony/app.X/nbproject/private/private.xml @@ -1,7 +1,15 @@ + - + + file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/port/pic32-harmony/src/btstack_port.c + file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/src/hci_transport_h4.c + file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/platform/embedded/btstack_uart_block_embedded.c + file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/platform/embedded/btstack_run_loop_embedded.c + file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/src/btstack_run_loop.c + file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/platform/embedded/hci_transport_h4_embedded.c + From 914aaacb4d383379e7462fc68aaa23774c18ea5c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 28 Apr 2016 14:50:33 +0200 Subject: [PATCH 39/74] pic32: clear overrun uart flag --- port/pic32-harmony/src/btstack_port.c | 39 ++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/port/pic32-harmony/src/btstack_port.c b/port/pic32-harmony/src/btstack_port.c index cc3c5e67a..22f2425cc 100644 --- a/port/pic32-harmony/src/btstack_port.c +++ b/port/pic32-harmony/src/btstack_port.c @@ -123,10 +123,10 @@ static uint8_t * tx_buffer_ptr = 0; // reset Bluetooth using n_shutdown static void bluetooth_power_cycle(void){ - printf("Bluetooth power cycle Reset ON\n"); + printf("Bluetooth power cycle: Reset ON\n"); SYS_PORTS_PinClear(PORTS_ID_0, BT_RESET_PORT, BT_RESET_BIT); msleep(250); - printf("Bluetooth power cycle Reset OFF\n"); + printf("Bluetooth power cycle: Reset OFF\n"); SYS_PORTS_PinSet(PORTS_ID_0, BT_RESET_PORT, BT_RESET_BIT); } @@ -148,16 +148,24 @@ void hal_uart_dma_init(void){ PLIB_USART_HandshakeModeSelect(BT_USART_ID, USART_HANDSHAKE_MODE_FLOW_CONTROL); PLIB_USART_OperationModeSelect(BT_USART_ID, USART_ENABLE_TX_RX_CTS_RTS_USED); PLIB_USART_LineControlModeSelect(BT_USART_ID, USART_8N1); - PLIB_USART_TransmitterEnable(BT_USART_ID); -// PLIB_USART_TransmitterInterruptModeSelect(bluetooth_uart_id, USART_TRANSMIT_FIFO_IDLE); - PLIB_USART_ReceiverEnable(BT_USART_ID); -// PLIB_USART_ReceiverInterruptModeSelect(bluetooth_uart_id, USART_RECEIVE_FIFO_ONE_CHAR); + // BCSP on CSR requires even parity + // PLIB_USART_LineControlModeSelect(BT_USART_ID, USART_8E1); + + PLIB_USART_TransmitterEnable(BT_USART_ID); + // PLIB_USART_TransmitterInterruptModeSelect(bluetooth_uart_id, USART_TRANSMIT_FIFO_IDLE); + + // allow overrun mode: not needed for H4. CSR with BCSP/H5 does not enable RTS/CTS + PLIB_USART_RunInOverflowEnable(BT_USART_ID); + + PLIB_USART_ReceiverEnable(BT_USART_ID); + // PLIB_USART_ReceiverInterruptModeSelect(bluetooth_uart_id, USART_RECEIVE_FIFO_ONE_CHAR); + PLIB_USART_Enable(BT_USART_ID); // enable _RESET - SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, BT_RESET_PORT, BT_RESET_BIT); - + SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, BT_RESET_PORT, BT_RESET_BIT); + bluetooth_power_cycle(); // After reset, CTS is high and we need to wait until CTS is low again @@ -223,7 +231,7 @@ void BTSTACK_Initialize ( void ) hci_dump_open(NULL, HCI_DUMP_STDOUT); - const hci_transport_t * transport = hci_transport_h4_instance(btstack_uart_block_embedded_instance()); + const hci_transport_t * transport = hci_transport_h5_instance(btstack_uart_block_embedded_instance()); hci_init(transport, &config); hci_set_chipset(btstack_chipset_csr_instance()); @@ -236,15 +244,22 @@ void BTSTACK_Initialize ( void ) void BTSTACK_Tasks(void){ - if (bytes_to_read && PLIB_USART_ReceiverDataIsAvailable(BT_USART_ID)) { + + while (bytes_to_read && PLIB_USART_ReceiverDataIsAvailable(BT_USART_ID)) { *rx_buffer_ptr++ = PLIB_USART_ReceiverByteReceive(BT_USART_ID); bytes_to_read--; if (bytes_to_read == 0){ (*rx_done_handler)(); } } - - if (bytes_to_write && PLIB_USART_TransmitterIsEmpty(BT_USART_ID)){ + + if(PLIB_USART_ReceiverOverrunHasOccurred(BT_USART_ID)) + { + // printf("RX Overrun!\n"); + PLIB_USART_ReceiverOverrunErrorClear(BT_USART_ID); + } + + while (bytes_to_write && !PLIB_USART_TransmitterBufferIsFull(BT_USART_ID)){ PLIB_USART_TransmitterByteSend(BT_USART_ID, *tx_buffer_ptr++); bytes_to_write--; if (bytes_to_write == 0){ From cbc04f4886f81485639c5f80ce8fab5e35728ee5 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 28 Apr 2016 14:55:19 +0200 Subject: [PATCH 40/74] h5: accept partial config message --- src/hci_transport_h5.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hci_transport_h5.c b/src/hci_transport_h5.c index 00d748aae..d6e8ab872 100644 --- a/src/hci_transport_h5.c +++ b/src/hci_transport_h5.c @@ -87,6 +87,7 @@ typedef enum { static const uint8_t link_control_sync[] = { 0x01, 0x7e}; static const uint8_t link_control_sync_response[] = { 0x02, 0x7d}; static const uint8_t link_control_config[] = { 0x03, 0xfc, LINK_CONFIG_FIELD}; +static const uint8_t link_control_config_prefix_len = 2; static const uint8_t link_control_config_response[] = { 0x04, 0x7b, LINK_CONFIG_FIELD}; static const uint8_t link_control_config_response_prefix_len = 2; static const uint8_t link_control_wakeup[] = { 0x05, 0xfa}; @@ -429,7 +430,7 @@ static void hci_transport_h5_process_frame(uint16_t frame_size){ log_info("link: received sync"); hci_transport_link_actions |= HCI_TRANSPORT_LINK_SEND_SYNC_RESPONSE; } - if (memcmp(slip_payload, link_control_config, sizeof(link_control_config)) == 0){ + if (memcmp(slip_payload, link_control_config, link_control_config_prefix_len) == 0){ log_info("link: received config"); hci_transport_link_actions |= HCI_TRANSPORT_LINK_SEND_CONFIG_RESPONSE; } @@ -542,12 +543,12 @@ static void hci_transport_link_update_resend_timeout(uint32_t baudrate){ static uint8_t hci_transport_link_read_byte; static void hci_transport_h5_read_next_byte(void){ - log_info("hci_transport_h5_read_next_byte"); + log_debug("h5: rx nxt"); btstack_uart->receive_block(&hci_transport_link_read_byte, 1); } static void hci_transport_h5_block_received(){ - // log_info("slip: process 0x%02x", hci_transport_link_read_byte); + log_debug("slip: process 0x%02x", hci_transport_link_read_byte); btstack_slip_decoder_process(hci_transport_link_read_byte); uint16_t frame_size = btstack_slip_decoder_frame_size(); if (frame_size) { From 94764e99109946c1973cdfe0920944746421fced Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 28 Apr 2016 22:19:33 +0200 Subject: [PATCH 41/74] h5: support for auto-sleep mode after link inactivity --- src/hci_transport.h | 12 +++++-- src/hci_transport_h5.c | 76 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/src/hci_transport.h b/src/hci_transport.h index f50234a72..94814b59c 100644 --- a/src/hci_transport.h +++ b/src/hci_transport.h @@ -130,18 +130,24 @@ typedef struct { * @brief Setup H4 instance with uart_driver * @param uart_driver to use */ -extern const hci_transport_t * hci_transport_h4_instance(const btstack_uart_block_t * uart_driver); +const hci_transport_t * hci_transport_h4_instance(const btstack_uart_block_t * uart_driver); /* * @brief Setup H5 instance with uart_driver * @param uart_driver to use */ -extern const hci_transport_t * hci_transport_h5_instance(const btstack_uart_block_t * uart_driver); +const hci_transport_t * hci_transport_h5_instance(const btstack_uart_block_t * uart_driver); + +/* + * @brief Enable H5 Low Power Mode: enter sleep mode after x ms of inactivity + * @param inactivity_timeout_ms or 0 for off + */ +void hci_transport_h5_set_auto_sleep(uint16_t inactivity_timeout_ms); /* * @brief */ -extern const hci_transport_t * hci_transport_usb_instance(void); +const hci_transport_t * hci_transport_usb_instance(void); /* API_END */ diff --git a/src/hci_transport_h5.c b/src/hci_transport_h5.c index d6e8ab872..204c1f84d 100644 --- a/src/hci_transport_h5.c +++ b/src/hci_transport_h5.c @@ -60,10 +60,13 @@ typedef enum { HCI_TRANSPORT_LINK_SEND_SYNC_RESPONSE = 1 << 1, HCI_TRANSPORT_LINK_SEND_CONFIG = 1 << 2, HCI_TRANSPORT_LINK_SEND_CONFIG_RESPONSE = 1 << 3, - HCI_TRANSPORT_LINK_SEND_WOKEN = 1 << 4, - HCI_TRANSPORT_LINK_SEND_WAKEUP = 1 << 5, - HCI_TRANSPORT_LINK_SEND_QUEUED_PACKET = 1 << 6, - HCI_TRANSPORT_LINK_SEND_ACK_PACKET = 1 << 7, + HCI_TRANSPORT_LINK_SEND_SLEEP = 1 << 4, + HCI_TRANSPORT_LINK_SEND_WOKEN = 1 << 5, + HCI_TRANSPORT_LINK_SEND_WAKEUP = 1 << 6, + HCI_TRANSPORT_LINK_SEND_QUEUED_PACKET = 1 << 7, + HCI_TRANSPORT_LINK_SEND_ACK_PACKET = 1 << 8, + HCI_TRANSPORT_LINK_ENTER_SLEEP = 1 << 9, + } hci_transport_link_actions_t; // Configuration Field. No packet buffers -> sliding window = 1, no OOF flow control, no data integrity check @@ -108,6 +111,10 @@ static uint8_t link_ack_nr; static uint16_t link_resend_timeout_ms; static uint8_t link_peer_asleep; +// auto sleep-mode +static btstack_timer_source_t inactivity_timer; +static uint16_t link_inactivity_timeout_ms; // auto-sleep if set + // Outgoing packet static uint8_t hci_packet_type; static uint16_t hci_packet_size; @@ -135,8 +142,26 @@ static void hci_transport_link_run(void); static void hci_transport_slip_init(void); // ----------------------------- +static void hci_transport_inactivity_timeout_handler(btstack_timer_source_t * ts){ + log_info("h5: inactivity timeout. link state %u, peer asleep %u, actions 0x%02x, outgoing packet %u", + link_state, link_peer_asleep, hci_transport_link_actions, hci_transport_link_have_outgoing_packet()); + if (hci_transport_link_have_outgoing_packet()) return; + if (link_state != LINK_ACTIVE) return; + if (hci_transport_link_actions) return; + if (link_peer_asleep) return; + hci_transport_link_actions |= HCI_TRANSPORT_LINK_SEND_SLEEP; + hci_transport_link_run(); +} +static void hci_transport_inactivity_timer_set(void){ + if (!link_inactivity_timeout_ms) return; + btstack_run_loop_set_timer_handler(&inactivity_timer, &hci_transport_inactivity_timeout_handler); + btstack_run_loop_set_timer(&inactivity_timer, link_inactivity_timeout_ms); + btstack_run_loop_remove_timer(&inactivity_timer); + btstack_run_loop_add_timer(&inactivity_timer); +} +// ----------------------------- // SLIP Outgoing // format: 0xc0 HEADER PACKER 0xc0 @@ -231,6 +256,11 @@ static void hci_transport_link_send_wakeup(void){ hci_transport_link_send_control(link_control_wakeup, sizeof(link_control_wakeup)); } +static void hci_transport_link_send_sleep(void){ + log_info("link: send sleep"); + hci_transport_link_send_control(link_control_sleep, sizeof(link_control_sleep)); +} + static void hci_transport_link_send_queued_packet(void){ log_info("hci_transport_link_send_queued_packet: seq %u, ack %u, size %u", link_seq_nr, link_ack_nr, hci_packet_size); log_info_hexdump(hci_packet, hci_packet_size); @@ -238,6 +268,9 @@ static void hci_transport_link_send_queued_packet(void){ uint8_t header[4]; hci_transport_link_calc_header(header, link_seq_nr, link_ack_nr, 0, 1, hci_packet_type, hci_packet_size); hci_transport_slip_send_frame(header, hci_packet, hci_packet_size); + + // reset inactvitiy timer + hci_transport_inactivity_timer_set(); } static void hci_transport_link_send_ack_packet(void){ @@ -294,6 +327,13 @@ static void hci_transport_link_run(void){ hci_transport_link_send_ack_packet(); return; } + if (hci_transport_link_actions & HCI_TRANSPORT_LINK_SEND_SLEEP){ + hci_transport_link_actions &= ~HCI_TRANSPORT_LINK_SEND_SLEEP; + hci_transport_link_actions |= HCI_TRANSPORT_LINK_ENTER_SLEEP; + link_peer_asleep = 1; + hci_transport_link_send_sleep(); + return; + } } static void hci_transport_link_set_timer(uint16_t timeout_ms){ @@ -507,14 +547,19 @@ static void hci_transport_h5_process_frame(uint16_t frame_size){ if (memcmp(slip_payload, link_control_woken, sizeof(link_control_woken)) == 0){ log_info("link: received woken message"); link_peer_asleep = 0; - // TODO: send packet if queued.... + // queued packet will be sent in hci_transport_link_run if needed break; } break; case HCI_EVENT_PACKET: case HCI_ACL_DATA_PACKET: case HCI_SCO_DATA_PACKET: + // seems like peer is awake + link_peer_asleep = 0; + // forward packet to stack packet_handler(link_packet_type, slip_payload, link_payload_len); + // reset inactvitiy timer + hci_transport_inactivity_timer_set(); break; } @@ -560,6 +605,18 @@ static void hci_transport_h5_block_received(){ static void hci_transport_h5_block_sent(void){ uart_write_active = 0; + + // enter sleep mode after sending sleep message + if (hci_transport_link_actions & HCI_TRANSPORT_LINK_ENTER_SLEEP){ + hci_transport_link_actions &= ~HCI_TRANSPORT_LINK_ENTER_SLEEP; + if (btstack_uart_sleep_mode){ + log_info("link: sent sleep message. Enabling UART Sleep."); + btstack_uart->set_sleep(btstack_uart_sleep_mode); + } else { + log_info("link: sent sleep message. UART Sleep not supported"); + } + } + hci_transport_link_run(); } @@ -630,8 +687,9 @@ static void hci_transport_h5_register_packet_handler(void (*handler)(uint8_t pac } static int hci_transport_h5_can_send_packet_now(uint8_t packet_type){ - if (hci_transport_link_have_outgoing_packet()) return 0; - return link_state == LINK_ACTIVE; + int res = !hci_transport_link_have_outgoing_packet() && link_state == LINK_ACTIVE; + log_info("hci_transport_h5_can_send_packet_now: %u", res); + return res; } static int hci_transport_h5_send_packet(uint8_t packet_type, uint8_t *packet, int size){ @@ -700,3 +758,7 @@ const hci_transport_t * hci_transport_h5_instance(const btstack_uart_block_t * u btstack_uart = uart_driver; return &hci_transport_h5; } + +void hci_transport_h5_set_auto_sleep(uint16_t inactivity_timeout_ms){ + link_inactivity_timeout_ms = inactivity_timeout_ms; +} From 6ae10533e16cc5501c260c3db290f37f1ab2d17f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 29 Apr 2016 12:04:36 +0200 Subject: [PATCH 42/74] h5: chunk outgoing slip frames to avoid buffer size double the size of the hci buffer --- src/hci_transport_h5.c | 52 ++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/src/hci_transport_h5.c b/src/hci_transport_h5.c index 204c1f84d..e57ee3bb0 100644 --- a/src/hci_transport_h5.c +++ b/src/hci_transport_h5.c @@ -86,6 +86,9 @@ typedef enum { #define LINK_ACKNOWLEDGEMENT_TYPE 0x00 #define LINK_CONTROL_PACKET_TYPE 0x0f +// max size of write requests +#define LINK_SLIP_TX_CHUNK_LEN 64 + // --- static const uint8_t link_control_sync[] = { 0x01, 0x7e}; static const uint8_t link_control_sync_response[] = { 0x02, 0x7d}; @@ -100,8 +103,9 @@ static const uint8_t link_control_sleep[] = { 0x07, 0x78}; // incoming pre-bufffer + 4 bytes H5 header + max(acl header + acl payload, event header + event data) + 2 bytes opt CRC static uint8_t hci_packet_with_pre_buffer[HCI_INCOMING_PRE_BUFFER_SIZE + 6 + HCI_PACKET_BUFFER_SIZE]; -// Non-optimized outgoing buffer (EOF, 4 bytes header, payload, EOF) -static uint8_t slip_outgoing_buffer[2 + 2 * (HCI_PACKET_BUFFER_SIZE + 4)]; +// outgoing slip encoded buffer. +1 to assert that last SOF fits in buffer +static uint8_t slip_outgoing_buffer[LINK_SLIP_TX_CHUNK_LEN+1]; +static int slip_write_active; // H5 Link State static hci_transport_link_state_t link_state; @@ -130,8 +134,6 @@ static const btstack_uart_block_t * btstack_uart; static btstack_uart_config_t uart_config; static btstack_uart_sleep_mode_t btstack_uart_sleep_mode; -static int uart_write_active; - // Prototypes static void hci_transport_h5_process_frame(uint16_t frame_size); static int hci_transport_link_have_outgoing_packet(void); @@ -164,6 +166,24 @@ static void hci_transport_inactivity_timer_set(void){ // ----------------------------- // SLIP Outgoing +// Fill chunk and write +static void hci_transport_slip_encode_chunk_and_send(int pos){ + while (btstack_slip_encoder_has_data() & (pos < LINK_SLIP_TX_CHUNK_LEN)) { + slip_outgoing_buffer[pos++] = btstack_slip_encoder_get_byte(); + } + if (!btstack_slip_encoder_has_data()){ + // Start of Frame + slip_outgoing_buffer[pos++] = BTSTACK_SLIP_SOF; + } + slip_write_active = 1; + log_info("hci_transport_slip: send %u bytes", pos); + btstack_uart->send_block(slip_outgoing_buffer, pos); +} + +static inline void hci_transport_slip_send_next_chunk(void){ + hci_transport_slip_encode_chunk_and_send(0); +} + // format: 0xc0 HEADER PACKER 0xc0 // @param uint8_t header[4] static void hci_transport_slip_send_frame(const uint8_t * header, const uint8_t * packet, uint16_t packet_size){ @@ -181,15 +201,9 @@ static void hci_transport_slip_send_frame(const uint8_t * header, const uint8_t // Packet btstack_slip_encoder_start(packet, packet_size); - while (btstack_slip_encoder_has_data()){ - slip_outgoing_buffer[pos++] = btstack_slip_encoder_get_byte(); - } - // Start of Frame - slip_outgoing_buffer[pos++] = BTSTACK_SLIP_SOF; - - uart_write_active = 1; - btstack_uart->send_block(slip_outgoing_buffer, pos); + // Fill rest of chunk from packet and send + hci_transport_slip_encode_chunk_and_send(pos); } // SLIP Incoming @@ -282,7 +296,7 @@ static void hci_transport_link_send_ack_packet(void){ static void hci_transport_link_run(void){ // exit if outgoing active - if (uart_write_active) return; + if (slip_write_active) return; // process queued requests if (hci_transport_link_actions & HCI_TRANSPORT_LINK_SEND_SYNC){ @@ -604,7 +618,15 @@ static void hci_transport_h5_block_received(){ } static void hci_transport_h5_block_sent(void){ - uart_write_active = 0; + + // check if more data to send + if (btstack_slip_encoder_has_data()){ + hci_transport_slip_send_next_chunk(); + return; + } + + // done + slip_write_active = 0; // enter sleep mode after sending sleep message if (hci_transport_link_actions & HCI_TRANSPORT_LINK_ENTER_SLEEP){ @@ -688,7 +710,7 @@ static void hci_transport_h5_register_packet_handler(void (*handler)(uint8_t pac static int hci_transport_h5_can_send_packet_now(uint8_t packet_type){ int res = !hci_transport_link_have_outgoing_packet() && link_state == LINK_ACTIVE; - log_info("hci_transport_h5_can_send_packet_now: %u", res); + // log_info("hci_transport_h5_can_send_packet_now: %u", res); return res; } From 35dfa651882c8c9578ebb4d8c951d2ec91f8f2e1 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 29 Apr 2016 14:05:32 +0200 Subject: [PATCH 43/74] csr: enable RTS/CTS for BCSP and H5 --- chipset/csr/btstack_chipset_csr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chipset/csr/btstack_chipset_csr.c b/chipset/csr/btstack_chipset_csr.c index 83bcbf04d..f9f6177c4 100644 --- a/chipset/csr/btstack_chipset_csr.c +++ b/chipset/csr/btstack_chipset_csr.c @@ -71,6 +71,12 @@ static const uint8_t init_script[] = { 0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xc9, 0x22, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, #endif + // Enable RTS/CTS for BCSP (0806 -> 080e) + 0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xbf, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x08, + + // Enable RTS/CTS for H5 (1806 -> 180e, even parity still on) + 0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xc1, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x08, + // Set UART baudrate to 115200 0x01, 0x00, 0xFC, 0x15, 0xc2, 0x02, 0x00, 0x0a, 0x00, 0x02, 0x00, 0x03, 0x70, 0x00, 0x00, 0xea, 0x01, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc2, From 4b871b9e05ebf59c9f27b393f258d05f96f462ba Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 29 Apr 2016 14:06:25 +0200 Subject: [PATCH 44/74] posix-h5: don't enable auto sleep by default --- port/posix-h5/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/port/posix-h5/main.c b/port/posix-h5/main.c index c1a069dbc..2913cef8e 100644 --- a/port/posix-h5/main.c +++ b/port/posix-h5/main.c @@ -170,7 +170,10 @@ int main(int argc, const char * argv[]){ const btstack_link_key_db_t * link_key_db = btstack_link_key_db_fs_instance(); hci_init(transport, (void*) &config); hci_set_link_key_db(link_key_db); - + + // enable auto-sleep mode + // hci_transport_h5_set_auto_sleep(300); + // setup dynamic chipset driver setup hci_set_local_version_information_callback(&local_version_information_callback); From 05b338c5b881e87cab57ccfe534b10c98878852b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 29 Apr 2016 14:49:16 +0200 Subject: [PATCH 45/74] csr: fix ps key for h5 config --- chipset/csr/btstack_chipset_csr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chipset/csr/btstack_chipset_csr.c b/chipset/csr/btstack_chipset_csr.c index f9f6177c4..2f3dbc722 100644 --- a/chipset/csr/btstack_chipset_csr.c +++ b/chipset/csr/btstack_chipset_csr.c @@ -75,7 +75,7 @@ static const uint8_t init_script[] = { 0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xbf, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x08, // Enable RTS/CTS for H5 (1806 -> 180e, even parity still on) - 0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xc1, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x08, + 0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xc1, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x18, // Set UART baudrate to 115200 0x01, 0x00, 0xFC, 0x15, 0xc2, 0x02, 0x00, 0x0a, 0x00, 0x02, 0x00, 0x03, 0x70, 0x00, 0x00, 0xea, 0x01, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc2, From fd78d2a43fd46c98dfc673ba6a55f73129f4b5bf Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 2 May 2016 12:44:16 +0200 Subject: [PATCH 46/74] pic32: rename bk-audio-dk to bt_audio_dk --- .../app.X/nbproject/Makefile-default.mk | 130 +++++++++++------- .../nbproject/Makefile-genesis.properties | 4 +- .../app.X/nbproject/configurations.xml | 2 + .../app.X/nbproject/private/private.xml | 9 +- .../system_config.h | 0 .../system_definitions.h | 0 .../system_init.c | 0 .../system_tasks.c | 0 8 files changed, 82 insertions(+), 63 deletions(-) rename port/pic32-harmony/src/system_config/{bk-audio-dk => bt_audio_dk}/system_config.h (100%) rename port/pic32-harmony/src/system_config/{bk-audio-dk => bt_audio_dk}/system_definitions.h (100%) rename port/pic32-harmony/src/system_config/{bk-audio-dk => bt_audio_dk}/system_init.c (100%) rename port/pic32-harmony/src/system_config/{bk-audio-dk => bt_audio_dk}/system_tasks.c (100%) diff --git a/port/pic32-harmony/app.X/nbproject/Makefile-default.mk b/port/pic32-harmony/app.X/nbproject/Makefile-default.mk index 172e35e9d..cdca702de 100644 --- a/port/pic32-harmony/app.X/nbproject/Makefile-default.mk +++ b/port/pic32-harmony/app.X/nbproject/Makefile-default.mk @@ -45,17 +45,17 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} # Source Files Quoted if spaced -SOURCEFILES_QUOTED_IF_SPACED=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../src/classic/spp_server.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/hci_transport_h4.c +SOURCEFILES_QUOTED_IF_SPACED=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../src/classic/spp_server.c ../../../src/hci_transport_h4.c ../../../src/hci_transport_h5.c ../../../src/btstack_slip.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c # Object Files Quoted if spaced -OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o -POSSIBLE_DEPFILES=${OBJECTDIR}/_ext/2048875307/system_init.o.d ${OBJECTDIR}/_ext/2048875307/system_tasks.o.d ${OBJECTDIR}/_ext/1360937237/btstack_port.o.d ${OBJECTDIR}/_ext/1360937237/app_debug.o.d ${OBJECTDIR}/_ext/1360937237/app.o.d ${OBJECTDIR}/_ext/1360937237/main.o.d ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d ${OBJECTDIR}/_ext/534563071/ad_parser.o.d ${OBJECTDIR}/_ext/534563071/att_db.o.d ${OBJECTDIR}/_ext/534563071/att_dispatch.o.d ${OBJECTDIR}/_ext/534563071/att_server.o.d ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d ${OBJECTDIR}/_ext/534563071/sm.o.d ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d ${OBJECTDIR}/_ext/1386528437/hci.o.d ${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d ${OBJECTDIR}/_ext/1386528437/hci_dump.o.d ${OBJECTDIR}/_ext/1386528437/l2cap.o.d ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d ${OBJECTDIR}/_ext/1386327864/rfcomm.o.d ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d ${OBJECTDIR}/_ext/1386327864/sdp_server.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d ${OBJECTDIR}/_ext/1386327864/sdp_util.o.d ${OBJECTDIR}/_ext/1386528437/btstack_util.o.d ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d ${OBJECTDIR}/_ext/2147153351/sys_ports.o.d ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d ${OBJECTDIR}/_ext/1386327864/spp_server.o.d ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d +OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o +POSSIBLE_DEPFILES=${OBJECTDIR}/_ext/2048875307/system_init.o.d ${OBJECTDIR}/_ext/2048875307/system_tasks.o.d ${OBJECTDIR}/_ext/1360937237/btstack_port.o.d ${OBJECTDIR}/_ext/1360937237/app_debug.o.d ${OBJECTDIR}/_ext/1360937237/app.o.d ${OBJECTDIR}/_ext/1360937237/main.o.d ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d ${OBJECTDIR}/_ext/534563071/ad_parser.o.d ${OBJECTDIR}/_ext/534563071/att_db.o.d ${OBJECTDIR}/_ext/534563071/att_dispatch.o.d ${OBJECTDIR}/_ext/534563071/att_server.o.d ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d ${OBJECTDIR}/_ext/534563071/sm.o.d ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d ${OBJECTDIR}/_ext/1386528437/hci.o.d ${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d ${OBJECTDIR}/_ext/1386528437/hci_dump.o.d ${OBJECTDIR}/_ext/1386528437/l2cap.o.d ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d ${OBJECTDIR}/_ext/1386327864/rfcomm.o.d ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d ${OBJECTDIR}/_ext/1386327864/sdp_server.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d ${OBJECTDIR}/_ext/1386327864/sdp_util.o.d ${OBJECTDIR}/_ext/1386528437/btstack_util.o.d ${OBJECTDIR}/_ext/1386327864/spp_server.o.d ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d ${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d ${OBJECTDIR}/_ext/2147153351/sys_ports.o.d # Object Files -OBJECTFILES=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o +OBJECTFILES=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o # Source Files -SOURCEFILES=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../src/classic/spp_server.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/hci_transport_h4.c +SOURCEFILES=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../src/classic/spp_server.c ../../../src/hci_transport_h4.c ../../../src/hci_transport_h5.c ../../../src/btstack_slip.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c CFLAGS= @@ -178,6 +178,18 @@ ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o: ../../../chipset/csr/btstack @${RM} ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o @${FIXDEPS} "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" -o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ../../../chipset/csr/btstack_chipset_csr.c +${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/993942601" + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c + +${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o: ../../../platform/embedded/btstack_uart_block_embedded.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/993942601" + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c + ${OBJECTDIR}/_ext/1386528437/btstack_memory.o: ../../../src/btstack_memory.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d @@ -274,6 +286,30 @@ ${OBJECTDIR}/_ext/1386528437/btstack_util.o: ../../../src/btstack_util.c nbproj @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_util.o @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ../../../src/btstack_util.c +${OBJECTDIR}/_ext/1386327864/spp_server.o: ../../../src/classic/spp_server.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386327864" + @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o.d + @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c + +${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o: ../../../src/hci_transport_h4.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386528437" + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c + +${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o: ../../../src/hci_transport_h5.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386528437" + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ../../../src/hci_transport_h5.c + +${OBJECTDIR}/_ext/1386528437/btstack_slip.o: ../../../src/btstack_slip.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386528437" + @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d + @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_slip.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ../../../src/btstack_slip.c + ${OBJECTDIR}/_ext/1880736137/drv_tmr.o: ../../../../driver/tmr/src/dynamic/drv_tmr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1880736137" @${RM} ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d @@ -316,30 +352,6 @@ ${OBJECTDIR}/_ext/2147153351/sys_ports.o: ../../../../system/ports/src/sys_ports @${RM} ${OBJECTDIR}/_ext/2147153351/sys_ports.o @${FIXDEPS} "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" -o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ../../../../system/ports/src/sys_ports.c -${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/993942601" - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c - -${OBJECTDIR}/_ext/1386327864/spp_server.o: ../../../src/classic/spp_server.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/1386327864" - @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o.d - @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c - -${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o: ../../../platform/embedded/btstack_uart_block_embedded.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/993942601" - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c - -${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o: ../../../src/hci_transport_h4.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/1386528437" - @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d - @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c - else ${OBJECTDIR}/_ext/2048875307/system_init.o: ../src/system_config/bk-audio-dk/system_init.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/2048875307" @@ -425,6 +437,18 @@ ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o: ../../../chipset/csr/btstack @${RM} ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o @${FIXDEPS} "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" -o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ../../../chipset/csr/btstack_chipset_csr.c +${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/993942601" + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c + +${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o: ../../../platform/embedded/btstack_uart_block_embedded.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/993942601" + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d + @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c + ${OBJECTDIR}/_ext/1386528437/btstack_memory.o: ../../../src/btstack_memory.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d @@ -521,6 +545,30 @@ ${OBJECTDIR}/_ext/1386528437/btstack_util.o: ../../../src/btstack_util.c nbproj @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_util.o @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ../../../src/btstack_util.c +${OBJECTDIR}/_ext/1386327864/spp_server.o: ../../../src/classic/spp_server.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386327864" + @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o.d + @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c + +${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o: ../../../src/hci_transport_h4.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386528437" + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c + +${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o: ../../../src/hci_transport_h5.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386528437" + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d + @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ../../../src/hci_transport_h5.c + +${OBJECTDIR}/_ext/1386528437/btstack_slip.o: ../../../src/btstack_slip.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/1386528437" + @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d + @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_slip.o + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ../../../src/btstack_slip.c + ${OBJECTDIR}/_ext/1880736137/drv_tmr.o: ../../../../driver/tmr/src/dynamic/drv_tmr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1880736137" @${RM} ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d @@ -563,30 +611,6 @@ ${OBJECTDIR}/_ext/2147153351/sys_ports.o: ../../../../system/ports/src/sys_ports @${RM} ${OBJECTDIR}/_ext/2147153351/sys_ports.o @${FIXDEPS} "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" -o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ../../../../system/ports/src/sys_ports.c -${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/993942601" - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c - -${OBJECTDIR}/_ext/1386327864/spp_server.o: ../../../src/classic/spp_server.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/1386327864" - @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o.d - @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c - -${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o: ../../../platform/embedded/btstack_uart_block_embedded.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/993942601" - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d - @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c - -${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o: ../../../src/hci_transport_h4.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/1386528437" - @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d - @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c - endif # ------------------------------------------------------------------------------------ diff --git a/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties b/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties index 693100866..77606e075 100644 --- a/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties +++ b/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties @@ -1,8 +1,8 @@ # -#Wed Apr 27 22:00:29 CEST 2016 +#Mon May 02 12:40:53 CEST 2016 default.com-microchip-mplab-nbide-toolchainXC32-XC32LanguageToolchain.md5=53fb2ac0203ca7bc347fa1cfc029d2dd default.languagetoolchain.dir=/Applications/microchip/xc32/v1.40/bin -configurations-xml=245c47cf2d07f60cc50126a4a19bbcb8 +configurations-xml=35ba2a305a20b8d5e4d4910fd393d084 com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=4b47e815d50912689a67d0b162f47a58 default.languagetoolchain.version=1.40 host.platform=mac diff --git a/port/pic32-harmony/app.X/nbproject/configurations.xml b/port/pic32-harmony/app.X/nbproject/configurations.xml index 8301bbaef..d349cad28 100644 --- a/port/pic32-harmony/app.X/nbproject/configurations.xml +++ b/port/pic32-harmony/app.X/nbproject/configurations.xml @@ -141,6 +141,8 @@ ../../../src/btstack_util.c ../../../src/classic/spp_server.c ../../../src/hci_transport_h4.c + ../../../src/hci_transport_h5.c + ../../../src/btstack_slip.c diff --git a/port/pic32-harmony/app.X/nbproject/private/private.xml b/port/pic32-harmony/app.X/nbproject/private/private.xml index 00c2fa251..cd3e03d7e 100644 --- a/port/pic32-harmony/app.X/nbproject/private/private.xml +++ b/port/pic32-harmony/app.X/nbproject/private/private.xml @@ -3,13 +3,6 @@ - - file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/port/pic32-harmony/src/btstack_port.c - file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/src/hci_transport_h4.c - file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/platform/embedded/btstack_uart_block_embedded.c - file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/platform/embedded/btstack_run_loop_embedded.c - file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/src/btstack_run_loop.c - file:/Users/mringwal/microchip/harmony/v1_07/framework/btstack/platform/embedded/hci_transport_h4_embedded.c - + diff --git a/port/pic32-harmony/src/system_config/bk-audio-dk/system_config.h b/port/pic32-harmony/src/system_config/bt_audio_dk/system_config.h similarity index 100% rename from port/pic32-harmony/src/system_config/bk-audio-dk/system_config.h rename to port/pic32-harmony/src/system_config/bt_audio_dk/system_config.h diff --git a/port/pic32-harmony/src/system_config/bk-audio-dk/system_definitions.h b/port/pic32-harmony/src/system_config/bt_audio_dk/system_definitions.h similarity index 100% rename from port/pic32-harmony/src/system_config/bk-audio-dk/system_definitions.h rename to port/pic32-harmony/src/system_config/bt_audio_dk/system_definitions.h diff --git a/port/pic32-harmony/src/system_config/bk-audio-dk/system_init.c b/port/pic32-harmony/src/system_config/bt_audio_dk/system_init.c similarity index 100% rename from port/pic32-harmony/src/system_config/bk-audio-dk/system_init.c rename to port/pic32-harmony/src/system_config/bt_audio_dk/system_init.c diff --git a/port/pic32-harmony/src/system_config/bk-audio-dk/system_tasks.c b/port/pic32-harmony/src/system_config/bt_audio_dk/system_tasks.c similarity index 100% rename from port/pic32-harmony/src/system_config/bk-audio-dk/system_tasks.c rename to port/pic32-harmony/src/system_config/bt_audio_dk/system_tasks.c From 71f331874dd79dcc827830fd9d1cbe3a89945528 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 2 May 2016 17:26:08 +0200 Subject: [PATCH 47/74] pic32: create MPLAPX projects for all examples in harmony/vx_xx/apps/btstack --- port/pic32-harmony/README | 7 - port/pic32-harmony/README.md | 16 ++ .../app.X/nbproject/Makefile-default.mk | 218 +++++++++--------- .../nbproject/Makefile-genesis.properties | 4 +- .../app.X/nbproject/configurations.xml | 17 +- .../nbproject/private/configurations.xml | 2 +- port/pic32-harmony/create_examples.py | 113 +++++++++ 7 files changed, 249 insertions(+), 128 deletions(-) delete mode 100644 port/pic32-harmony/README create mode 100644 port/pic32-harmony/README.md create mode 100755 port/pic32-harmony/create_examples.py diff --git a/port/pic32-harmony/README b/port/pic32-harmony/README deleted file mode 100644 index 0316fa764..000000000 --- a/port/pic32-harmony/README +++ /dev/null @@ -1,7 +0,0 @@ -BTstack Port for the Microchip PIC32 Harmony Platform - -Status: Port started - -Installation: place BTstack tree into harmony/framework folder. -Examples: app.X can be opened and compiled in Microchip MPLABX - diff --git a/port/pic32-harmony/README.md b/port/pic32-harmony/README.md new file mode 100644 index 000000000..73f2eb0f6 --- /dev/null +++ b/port/pic32-harmony/README.md @@ -0,0 +1,16 @@ +# BTstack Port for the Microchip PIC32 Harmony Platform + +Status: All examples working, polling UART driver. Tested on Bluetooth Audio Development Kit only. + +## Setup + +- Place BTstack tree into harmony/framework folder. +-Rrun port/pic32-harmony/create_examples.py to create examples in harmony/apps/btstack folder. + +## Usage + +The examples can be opened and compiled in Microchip MPLABX. + +### Modifications to the GATT Database + +After changing the GATT definition in $example.gatt, please run ./update_gatt_db.h to regenerate $example.h in the $example folder. diff --git a/port/pic32-harmony/app.X/nbproject/Makefile-default.mk b/port/pic32-harmony/app.X/nbproject/Makefile-default.mk index cdca702de..1d67f7e9a 100644 --- a/port/pic32-harmony/app.X/nbproject/Makefile-default.mk +++ b/port/pic32-harmony/app.X/nbproject/Makefile-default.mk @@ -45,17 +45,17 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} # Source Files Quoted if spaced -SOURCEFILES_QUOTED_IF_SPACED=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../src/classic/spp_server.c ../../../src/hci_transport_h4.c ../../../src/hci_transport_h5.c ../../../src/btstack_slip.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c +SOURCEFILES_QUOTED_IF_SPACED=../src/system_config/bt_audio_dk/system_init.c ../src/system_config/bt_audio_dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../src/classic/spp_server.c ../../../src/hci_transport_h4.c ../../../src/hci_transport_h5.c ../../../src/btstack_slip.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c # Object Files Quoted if spaced -OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o -POSSIBLE_DEPFILES=${OBJECTDIR}/_ext/2048875307/system_init.o.d ${OBJECTDIR}/_ext/2048875307/system_tasks.o.d ${OBJECTDIR}/_ext/1360937237/btstack_port.o.d ${OBJECTDIR}/_ext/1360937237/app_debug.o.d ${OBJECTDIR}/_ext/1360937237/app.o.d ${OBJECTDIR}/_ext/1360937237/main.o.d ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d ${OBJECTDIR}/_ext/534563071/ad_parser.o.d ${OBJECTDIR}/_ext/534563071/att_db.o.d ${OBJECTDIR}/_ext/534563071/att_dispatch.o.d ${OBJECTDIR}/_ext/534563071/att_server.o.d ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d ${OBJECTDIR}/_ext/534563071/sm.o.d ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d ${OBJECTDIR}/_ext/1386528437/hci.o.d ${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d ${OBJECTDIR}/_ext/1386528437/hci_dump.o.d ${OBJECTDIR}/_ext/1386528437/l2cap.o.d ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d ${OBJECTDIR}/_ext/1386327864/rfcomm.o.d ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d ${OBJECTDIR}/_ext/1386327864/sdp_server.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d ${OBJECTDIR}/_ext/1386327864/sdp_util.o.d ${OBJECTDIR}/_ext/1386528437/btstack_util.o.d ${OBJECTDIR}/_ext/1386327864/spp_server.o.d ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d ${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d ${OBJECTDIR}/_ext/2147153351/sys_ports.o.d +OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/_ext/101891878/system_init.o ${OBJECTDIR}/_ext/101891878/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o +POSSIBLE_DEPFILES=${OBJECTDIR}/_ext/101891878/system_init.o.d ${OBJECTDIR}/_ext/101891878/system_tasks.o.d ${OBJECTDIR}/_ext/1360937237/btstack_port.o.d ${OBJECTDIR}/_ext/1360937237/app_debug.o.d ${OBJECTDIR}/_ext/1360937237/app.o.d ${OBJECTDIR}/_ext/1360937237/main.o.d ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d ${OBJECTDIR}/_ext/534563071/ad_parser.o.d ${OBJECTDIR}/_ext/534563071/att_db.o.d ${OBJECTDIR}/_ext/534563071/att_dispatch.o.d ${OBJECTDIR}/_ext/534563071/att_server.o.d ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d ${OBJECTDIR}/_ext/534563071/sm.o.d ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d ${OBJECTDIR}/_ext/1386528437/hci.o.d ${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d ${OBJECTDIR}/_ext/1386528437/hci_dump.o.d ${OBJECTDIR}/_ext/1386528437/l2cap.o.d ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d ${OBJECTDIR}/_ext/1386327864/rfcomm.o.d ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d ${OBJECTDIR}/_ext/1386327864/sdp_server.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client.o.d ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d ${OBJECTDIR}/_ext/1386327864/sdp_util.o.d ${OBJECTDIR}/_ext/1386528437/btstack_util.o.d ${OBJECTDIR}/_ext/1386327864/spp_server.o.d ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d ${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk.o.d ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d ${OBJECTDIR}/_ext/2147153351/sys_ports.o.d # Object Files -OBJECTFILES=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o +OBJECTFILES=${OBJECTDIR}/_ext/101891878/system_init.o ${OBJECTDIR}/_ext/101891878/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ${OBJECTDIR}/_ext/534563071/ad_parser.o ${OBJECTDIR}/_ext/534563071/att_db.o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ${OBJECTDIR}/_ext/534563071/att_server.o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ${OBJECTDIR}/_ext/534563071/sm.o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ${OBJECTDIR}/_ext/1386327864/spp_server.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o # Source Files -SOURCEFILES=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../src/classic/spp_server.c ../../../src/hci_transport_h4.c ../../../src/hci_transport_h5.c ../../../src/btstack_slip.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c +SOURCEFILES=../src/system_config/bt_audio_dk/system_init.c ../src/system_config/bt_audio_dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../example/spp_and_le_counter.c ../../../src/ble/ad_parser.c ../../../src/ble/att_db.c ../../../src/ble/att_dispatch.c ../../../src/ble/att_server.c ../../../src/ble/le_device_db_memory.c ../../../src/ble/sm.c ../../../chipset/csr/btstack_chipset_csr.c ../../../platform/embedded/btstack_run_loop_embedded.c ../../../platform/embedded/btstack_uart_block_embedded.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmd.c ../../../src/hci_dump.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/btstack_linked_list.c ../../../src/btstack_memory_pool.c ../../../src/classic/btstack_link_key_db_memory.c ../../../src/classic/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/classic/sdp_server.c ../../../src/classic/sdp_client.c ../../../src/classic/sdp_client_rfcomm.c ../../../src/classic/sdp_util.c ../../../src/btstack_util.c ../../../src/classic/spp_server.c ../../../src/hci_transport_h4.c ../../../src/hci_transport_h5.c ../../../src/btstack_slip.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c CFLAGS= @@ -94,522 +94,522 @@ endif # ------------------------------------------------------------------------------------ # Rules for buildStep: compile ifeq ($(TYPE_IMAGE), DEBUG_RUN) -${OBJECTDIR}/_ext/2048875307/system_init.o: ../src/system_config/bk-audio-dk/system_init.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/2048875307" - @${RM} ${OBJECTDIR}/_ext/2048875307/system_init.o.d - @${RM} ${OBJECTDIR}/_ext/2048875307/system_init.o - @${FIXDEPS} "${OBJECTDIR}/_ext/2048875307/system_init.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2048875307/system_init.o.d" -o ${OBJECTDIR}/_ext/2048875307/system_init.o ../src/system_config/bk-audio-dk/system_init.c +${OBJECTDIR}/_ext/101891878/system_init.o: ../src/system_config/bt_audio_dk/system_init.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/101891878" + @${RM} ${OBJECTDIR}/_ext/101891878/system_init.o.d + @${RM} ${OBJECTDIR}/_ext/101891878/system_init.o + @${FIXDEPS} "${OBJECTDIR}/_ext/101891878/system_init.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/101891878/system_init.o.d" -o ${OBJECTDIR}/_ext/101891878/system_init.o ../src/system_config/bt_audio_dk/system_init.c -${OBJECTDIR}/_ext/2048875307/system_tasks.o: ../src/system_config/bk-audio-dk/system_tasks.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/2048875307" - @${RM} ${OBJECTDIR}/_ext/2048875307/system_tasks.o.d - @${RM} ${OBJECTDIR}/_ext/2048875307/system_tasks.o - @${FIXDEPS} "${OBJECTDIR}/_ext/2048875307/system_tasks.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2048875307/system_tasks.o.d" -o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ../src/system_config/bk-audio-dk/system_tasks.c +${OBJECTDIR}/_ext/101891878/system_tasks.o: ../src/system_config/bt_audio_dk/system_tasks.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/101891878" + @${RM} ${OBJECTDIR}/_ext/101891878/system_tasks.o.d + @${RM} ${OBJECTDIR}/_ext/101891878/system_tasks.o + @${FIXDEPS} "${OBJECTDIR}/_ext/101891878/system_tasks.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/101891878/system_tasks.o.d" -o ${OBJECTDIR}/_ext/101891878/system_tasks.o ../src/system_config/bt_audio_dk/system_tasks.c ${OBJECTDIR}/_ext/1360937237/btstack_port.o: ../src/btstack_port.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/btstack_port.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/btstack_port.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/btstack_port.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/btstack_port.o.d" -o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ../src/btstack_port.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/btstack_port.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/btstack_port.o.d" -o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ../src/btstack_port.c ${OBJECTDIR}/_ext/1360937237/app_debug.o: ../src/app_debug.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/app_debug.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/app_debug.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/app_debug.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/app_debug.o.d" -o ${OBJECTDIR}/_ext/1360937237/app_debug.o ../src/app_debug.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/app_debug.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/app_debug.o.d" -o ${OBJECTDIR}/_ext/1360937237/app_debug.o ../src/app_debug.c ${OBJECTDIR}/_ext/1360937237/app.o: ../src/app.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/app.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/app.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/app.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/app.o.d" -o ${OBJECTDIR}/_ext/1360937237/app.o ../src/app.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/app.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/app.o.d" -o ${OBJECTDIR}/_ext/1360937237/app.o ../src/app.c ${OBJECTDIR}/_ext/1360937237/main.o: ../src/main.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/main.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/main.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/main.o.d" -o ${OBJECTDIR}/_ext/1360937237/main.o ../src/main.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/main.o.d" -o ${OBJECTDIR}/_ext/1360937237/main.o ../src/main.c ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o: ../../../example/spp_and_le_counter.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/97075643" @${RM} ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d @${RM} ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o - @${FIXDEPS} "${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d" -o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ../../../example/spp_and_le_counter.c + @${FIXDEPS} "${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d" -o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ../../../example/spp_and_le_counter.c ${OBJECTDIR}/_ext/534563071/ad_parser.o: ../../../src/ble/ad_parser.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/ad_parser.o.d @${RM} ${OBJECTDIR}/_ext/534563071/ad_parser.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/ad_parser.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/ad_parser.o.d" -o ${OBJECTDIR}/_ext/534563071/ad_parser.o ../../../src/ble/ad_parser.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/ad_parser.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/ad_parser.o.d" -o ${OBJECTDIR}/_ext/534563071/ad_parser.o ../../../src/ble/ad_parser.c ${OBJECTDIR}/_ext/534563071/att_db.o: ../../../src/ble/att_db.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/att_db.o.d @${RM} ${OBJECTDIR}/_ext/534563071/att_db.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_db.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_db.o.d" -o ${OBJECTDIR}/_ext/534563071/att_db.o ../../../src/ble/att_db.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_db.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_db.o.d" -o ${OBJECTDIR}/_ext/534563071/att_db.o ../../../src/ble/att_db.c ${OBJECTDIR}/_ext/534563071/att_dispatch.o: ../../../src/ble/att_dispatch.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/att_dispatch.o.d @${RM} ${OBJECTDIR}/_ext/534563071/att_dispatch.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_dispatch.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_dispatch.o.d" -o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ../../../src/ble/att_dispatch.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_dispatch.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_dispatch.o.d" -o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ../../../src/ble/att_dispatch.c ${OBJECTDIR}/_ext/534563071/att_server.o: ../../../src/ble/att_server.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/att_server.o.d @${RM} ${OBJECTDIR}/_ext/534563071/att_server.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_server.o.d" -o ${OBJECTDIR}/_ext/534563071/att_server.o ../../../src/ble/att_server.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_server.o.d" -o ${OBJECTDIR}/_ext/534563071/att_server.o ../../../src/ble/att_server.c ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o: ../../../src/ble/le_device_db_memory.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d @${RM} ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d" -o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ../../../src/ble/le_device_db_memory.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d" -o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ../../../src/ble/le_device_db_memory.c ${OBJECTDIR}/_ext/534563071/sm.o: ../../../src/ble/sm.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/sm.o.d @${RM} ${OBJECTDIR}/_ext/534563071/sm.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/sm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/sm.o.d" -o ${OBJECTDIR}/_ext/534563071/sm.o ../../../src/ble/sm.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/sm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/sm.o.d" -o ${OBJECTDIR}/_ext/534563071/sm.o ../../../src/ble/sm.c ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o: ../../../chipset/csr/btstack_chipset_csr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1768064806" @${RM} ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d @${RM} ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" -o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ../../../chipset/csr/btstack_chipset_csr.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" -o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ../../../chipset/csr/btstack_chipset_csr.c ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/993942601" @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o: ../../../platform/embedded/btstack_uart_block_embedded.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/993942601" @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c ${OBJECTDIR}/_ext/1386528437/btstack_memory.o: ../../../src/btstack_memory.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ../../../src/btstack_memory.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ../../../src/btstack_memory.c ${OBJECTDIR}/_ext/1386528437/hci.o: ../../../src/hci.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci.o ../../../src/hci.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci.o ../../../src/hci.c ${OBJECTDIR}/_ext/1386528437/hci_cmd.o: ../../../src/hci_cmd.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci_cmd.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ../../../src/hci_cmd.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ../../../src/hci_cmd.c ${OBJECTDIR}/_ext/1386528437/hci_dump.o: ../../../src/hci_dump.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci_dump.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci_dump.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_dump.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_dump.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ../../../src/hci_dump.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_dump.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_dump.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ../../../src/hci_dump.c ${OBJECTDIR}/_ext/1386528437/l2cap.o: ../../../src/l2cap.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/l2cap.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/l2cap.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/l2cap.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/l2cap.o.d" -o ${OBJECTDIR}/_ext/1386528437/l2cap.o ../../../src/l2cap.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/l2cap.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/l2cap.o.d" -o ${OBJECTDIR}/_ext/1386528437/l2cap.o ../../../src/l2cap.c ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o: ../../../src/l2cap_signaling.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d" -o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ../../../src/l2cap_signaling.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d" -o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ../../../src/l2cap_signaling.c ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o: ../../../src/btstack_linked_list.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ../../../src/btstack_linked_list.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ../../../src/btstack_linked_list.c ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o: ../../../src/btstack_memory_pool.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ../../../src/btstack_memory_pool.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ../../../src/btstack_memory_pool.c ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o: ../../../src/classic/btstack_link_key_db_memory.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d" -o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ../../../src/classic/btstack_link_key_db_memory.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d" -o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ../../../src/classic/btstack_link_key_db_memory.c ${OBJECTDIR}/_ext/1386327864/rfcomm.o: ../../../src/classic/rfcomm.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/rfcomm.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/rfcomm.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/rfcomm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/rfcomm.o.d" -o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ../../../src/classic/rfcomm.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/rfcomm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/rfcomm.o.d" -o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ../../../src/classic/rfcomm.c ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o: ../../../src/btstack_run_loop.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ../../../src/btstack_run_loop.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ../../../src/btstack_run_loop.c ${OBJECTDIR}/_ext/1386327864/sdp_server.o: ../../../src/classic/sdp_server.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_server.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_server.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ../../../src/classic/sdp_server.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ../../../src/classic/sdp_server.c ${OBJECTDIR}/_ext/1386327864/sdp_client.o: ../../../src/classic/sdp_client.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_client.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_client.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_client.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_client.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ../../../src/classic/sdp_client.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_client.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_client.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ../../../src/classic/sdp_client.c ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o: ../../../src/classic/sdp_client_rfcomm.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ../../../src/classic/sdp_client_rfcomm.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ../../../src/classic/sdp_client_rfcomm.c ${OBJECTDIR}/_ext/1386327864/sdp_util.o: ../../../src/classic/sdp_util.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_util.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_util.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_util.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ../../../src/classic/sdp_util.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_util.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ../../../src/classic/sdp_util.c ${OBJECTDIR}/_ext/1386528437/btstack_util.o: ../../../src/btstack_util.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_util.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_util.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ../../../src/btstack_util.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ../../../src/btstack_util.c ${OBJECTDIR}/_ext/1386327864/spp_server.o: ../../../src/classic/spp_server.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o: ../../../src/hci_transport_h4.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o: ../../../src/hci_transport_h5.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ../../../src/hci_transport_h5.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ../../../src/hci_transport_h5.c ${OBJECTDIR}/_ext/1386528437/btstack_slip.o: ../../../src/btstack_slip.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_slip.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ../../../src/btstack_slip.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ../../../src/btstack_slip.c ${OBJECTDIR}/_ext/1880736137/drv_tmr.o: ../../../../driver/tmr/src/dynamic/drv_tmr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1880736137" @${RM} ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d @${RM} ${OBJECTDIR}/_ext/1880736137/drv_tmr.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d" -o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ../../../../driver/tmr/src/dynamic/drv_tmr.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d" -o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ../../../../driver/tmr/src/dynamic/drv_tmr.c ${OBJECTDIR}/_ext/1112166103/sys_clk.o: ../../../../system/clk/src/sys_clk.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1112166103" @${RM} ${OBJECTDIR}/_ext/1112166103/sys_clk.o.d @${RM} ${OBJECTDIR}/_ext/1112166103/sys_clk.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1112166103/sys_clk.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1112166103/sys_clk.o.d" -o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ../../../../system/clk/src/sys_clk.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1112166103/sys_clk.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1112166103/sys_clk.o.d" -o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ../../../../system/clk/src/sys_clk.c ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o: ../../../../system/clk/src/sys_clk_pic32mx.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1112166103" @${RM} ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d @${RM} ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d" -o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ../../../../system/clk/src/sys_clk_pic32mx.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d" -o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ../../../../system/clk/src/sys_clk_pic32mx.c ${OBJECTDIR}/_ext/1510368962/sys_devcon.o: ../../../../system/devcon/src/sys_devcon.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1510368962" @${RM} ${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d @${RM} ${OBJECTDIR}/_ext/1510368962/sys_devcon.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d" -o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ../../../../system/devcon/src/sys_devcon.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d" -o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ../../../../system/devcon/src/sys_devcon.c ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o: ../../../../system/devcon/src/sys_devcon_pic32mx.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1510368962" @${RM} ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d @${RM} ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d" -o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ../../../../system/devcon/src/sys_devcon_pic32mx.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d" -o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ../../../../system/devcon/src/sys_devcon_pic32mx.c ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o: ../../../../system/int/src/sys_int_pic32.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/2087176412" @${RM} ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d @${RM} ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o - @${FIXDEPS} "${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d" -o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ../../../../system/int/src/sys_int_pic32.c + @${FIXDEPS} "${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d" -o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ../../../../system/int/src/sys_int_pic32.c ${OBJECTDIR}/_ext/2147153351/sys_ports.o: ../../../../system/ports/src/sys_ports.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/2147153351" @${RM} ${OBJECTDIR}/_ext/2147153351/sys_ports.o.d @${RM} ${OBJECTDIR}/_ext/2147153351/sys_ports.o - @${FIXDEPS} "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" -o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ../../../../system/ports/src/sys_ports.c + @${FIXDEPS} "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" -o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ../../../../system/ports/src/sys_ports.c else -${OBJECTDIR}/_ext/2048875307/system_init.o: ../src/system_config/bk-audio-dk/system_init.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/2048875307" - @${RM} ${OBJECTDIR}/_ext/2048875307/system_init.o.d - @${RM} ${OBJECTDIR}/_ext/2048875307/system_init.o - @${FIXDEPS} "${OBJECTDIR}/_ext/2048875307/system_init.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2048875307/system_init.o.d" -o ${OBJECTDIR}/_ext/2048875307/system_init.o ../src/system_config/bk-audio-dk/system_init.c +${OBJECTDIR}/_ext/101891878/system_init.o: ../src/system_config/bt_audio_dk/system_init.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/101891878" + @${RM} ${OBJECTDIR}/_ext/101891878/system_init.o.d + @${RM} ${OBJECTDIR}/_ext/101891878/system_init.o + @${FIXDEPS} "${OBJECTDIR}/_ext/101891878/system_init.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/101891878/system_init.o.d" -o ${OBJECTDIR}/_ext/101891878/system_init.o ../src/system_config/bt_audio_dk/system_init.c -${OBJECTDIR}/_ext/2048875307/system_tasks.o: ../src/system_config/bk-audio-dk/system_tasks.c nbproject/Makefile-${CND_CONF}.mk - @${MKDIR} "${OBJECTDIR}/_ext/2048875307" - @${RM} ${OBJECTDIR}/_ext/2048875307/system_tasks.o.d - @${RM} ${OBJECTDIR}/_ext/2048875307/system_tasks.o - @${FIXDEPS} "${OBJECTDIR}/_ext/2048875307/system_tasks.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2048875307/system_tasks.o.d" -o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ../src/system_config/bk-audio-dk/system_tasks.c +${OBJECTDIR}/_ext/101891878/system_tasks.o: ../src/system_config/bt_audio_dk/system_tasks.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/_ext/101891878" + @${RM} ${OBJECTDIR}/_ext/101891878/system_tasks.o.d + @${RM} ${OBJECTDIR}/_ext/101891878/system_tasks.o + @${FIXDEPS} "${OBJECTDIR}/_ext/101891878/system_tasks.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/101891878/system_tasks.o.d" -o ${OBJECTDIR}/_ext/101891878/system_tasks.o ../src/system_config/bt_audio_dk/system_tasks.c ${OBJECTDIR}/_ext/1360937237/btstack_port.o: ../src/btstack_port.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/btstack_port.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/btstack_port.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/btstack_port.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/btstack_port.o.d" -o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ../src/btstack_port.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/btstack_port.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/btstack_port.o.d" -o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ../src/btstack_port.c ${OBJECTDIR}/_ext/1360937237/app_debug.o: ../src/app_debug.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/app_debug.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/app_debug.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/app_debug.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/app_debug.o.d" -o ${OBJECTDIR}/_ext/1360937237/app_debug.o ../src/app_debug.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/app_debug.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/app_debug.o.d" -o ${OBJECTDIR}/_ext/1360937237/app_debug.o ../src/app_debug.c ${OBJECTDIR}/_ext/1360937237/app.o: ../src/app.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/app.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/app.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/app.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/app.o.d" -o ${OBJECTDIR}/_ext/1360937237/app.o ../src/app.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/app.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/app.o.d" -o ${OBJECTDIR}/_ext/1360937237/app.o ../src/app.c ${OBJECTDIR}/_ext/1360937237/main.o: ../src/main.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/main.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/main.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/main.o.d" -o ${OBJECTDIR}/_ext/1360937237/main.o ../src/main.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1360937237/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1360937237/main.o.d" -o ${OBJECTDIR}/_ext/1360937237/main.o ../src/main.c ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o: ../../../example/spp_and_le_counter.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/97075643" @${RM} ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d @${RM} ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o - @${FIXDEPS} "${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d" -o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ../../../example/spp_and_le_counter.c + @${FIXDEPS} "${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o.d" -o ${OBJECTDIR}/_ext/97075643/spp_and_le_counter.o ../../../example/spp_and_le_counter.c ${OBJECTDIR}/_ext/534563071/ad_parser.o: ../../../src/ble/ad_parser.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/ad_parser.o.d @${RM} ${OBJECTDIR}/_ext/534563071/ad_parser.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/ad_parser.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/ad_parser.o.d" -o ${OBJECTDIR}/_ext/534563071/ad_parser.o ../../../src/ble/ad_parser.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/ad_parser.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/ad_parser.o.d" -o ${OBJECTDIR}/_ext/534563071/ad_parser.o ../../../src/ble/ad_parser.c ${OBJECTDIR}/_ext/534563071/att_db.o: ../../../src/ble/att_db.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/att_db.o.d @${RM} ${OBJECTDIR}/_ext/534563071/att_db.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_db.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_db.o.d" -o ${OBJECTDIR}/_ext/534563071/att_db.o ../../../src/ble/att_db.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_db.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_db.o.d" -o ${OBJECTDIR}/_ext/534563071/att_db.o ../../../src/ble/att_db.c ${OBJECTDIR}/_ext/534563071/att_dispatch.o: ../../../src/ble/att_dispatch.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/att_dispatch.o.d @${RM} ${OBJECTDIR}/_ext/534563071/att_dispatch.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_dispatch.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_dispatch.o.d" -o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ../../../src/ble/att_dispatch.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_dispatch.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_dispatch.o.d" -o ${OBJECTDIR}/_ext/534563071/att_dispatch.o ../../../src/ble/att_dispatch.c ${OBJECTDIR}/_ext/534563071/att_server.o: ../../../src/ble/att_server.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/att_server.o.d @${RM} ${OBJECTDIR}/_ext/534563071/att_server.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_server.o.d" -o ${OBJECTDIR}/_ext/534563071/att_server.o ../../../src/ble/att_server.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/att_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/att_server.o.d" -o ${OBJECTDIR}/_ext/534563071/att_server.o ../../../src/ble/att_server.c ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o: ../../../src/ble/le_device_db_memory.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d @${RM} ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d" -o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ../../../src/ble/le_device_db_memory.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/le_device_db_memory.o.d" -o ${OBJECTDIR}/_ext/534563071/le_device_db_memory.o ../../../src/ble/le_device_db_memory.c ${OBJECTDIR}/_ext/534563071/sm.o: ../../../src/ble/sm.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/534563071" @${RM} ${OBJECTDIR}/_ext/534563071/sm.o.d @${RM} ${OBJECTDIR}/_ext/534563071/sm.o - @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/sm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/sm.o.d" -o ${OBJECTDIR}/_ext/534563071/sm.o ../../../src/ble/sm.c + @${FIXDEPS} "${OBJECTDIR}/_ext/534563071/sm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/534563071/sm.o.d" -o ${OBJECTDIR}/_ext/534563071/sm.o ../../../src/ble/sm.c ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o: ../../../chipset/csr/btstack_chipset_csr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1768064806" @${RM} ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d @${RM} ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" -o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ../../../chipset/csr/btstack_chipset_csr.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o.d" -o ${OBJECTDIR}/_ext/1768064806/btstack_chipset_csr.o ../../../chipset/csr/btstack_chipset_csr.c ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o: ../../../platform/embedded/btstack_run_loop_embedded.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/993942601" @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d @${RM} ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_run_loop_embedded.o ../../../platform/embedded/btstack_run_loop_embedded.c ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o: ../../../platform/embedded/btstack_uart_block_embedded.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/993942601" @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d @${RM} ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o - @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c + @${FIXDEPS} "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o.d" -o ${OBJECTDIR}/_ext/993942601/btstack_uart_block_embedded.o ../../../platform/embedded/btstack_uart_block_embedded.c ${OBJECTDIR}/_ext/1386528437/btstack_memory.o: ../../../src/btstack_memory.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ../../../src/btstack_memory.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_memory.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ../../../src/btstack_memory.c ${OBJECTDIR}/_ext/1386528437/hci.o: ../../../src/hci.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci.o ../../../src/hci.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci.o ../../../src/hci.c ${OBJECTDIR}/_ext/1386528437/hci_cmd.o: ../../../src/hci_cmd.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci_cmd.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ../../../src/hci_cmd.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_cmd.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_cmd.o ../../../src/hci_cmd.c ${OBJECTDIR}/_ext/1386528437/hci_dump.o: ../../../src/hci_dump.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci_dump.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci_dump.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_dump.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_dump.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ../../../src/hci_dump.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_dump.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_dump.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ../../../src/hci_dump.c ${OBJECTDIR}/_ext/1386528437/l2cap.o: ../../../src/l2cap.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/l2cap.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/l2cap.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/l2cap.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/l2cap.o.d" -o ${OBJECTDIR}/_ext/1386528437/l2cap.o ../../../src/l2cap.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/l2cap.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/l2cap.o.d" -o ${OBJECTDIR}/_ext/1386528437/l2cap.o ../../../src/l2cap.c ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o: ../../../src/l2cap_signaling.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d" -o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ../../../src/l2cap_signaling.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o.d" -o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ../../../src/l2cap_signaling.c ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o: ../../../src/btstack_linked_list.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ../../../src/btstack_linked_list.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_linked_list.o ../../../src/btstack_linked_list.c ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o: ../../../src/btstack_memory_pool.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ../../../src/btstack_memory_pool.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_memory_pool.o ../../../src/btstack_memory_pool.c ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o: ../../../src/classic/btstack_link_key_db_memory.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d" -o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ../../../src/classic/btstack_link_key_db_memory.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o.d" -o ${OBJECTDIR}/_ext/1386327864/btstack_link_key_db_memory.o ../../../src/classic/btstack_link_key_db_memory.c ${OBJECTDIR}/_ext/1386327864/rfcomm.o: ../../../src/classic/rfcomm.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/rfcomm.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/rfcomm.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/rfcomm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/rfcomm.o.d" -o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ../../../src/classic/rfcomm.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/rfcomm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/rfcomm.o.d" -o ${OBJECTDIR}/_ext/1386327864/rfcomm.o ../../../src/classic/rfcomm.c ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o: ../../../src/btstack_run_loop.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ../../../src/btstack_run_loop.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop.o ../../../src/btstack_run_loop.c ${OBJECTDIR}/_ext/1386327864/sdp_server.o: ../../../src/classic/sdp_server.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_server.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_server.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ../../../src/classic/sdp_server.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_server.o ../../../src/classic/sdp_server.c ${OBJECTDIR}/_ext/1386327864/sdp_client.o: ../../../src/classic/sdp_client.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_client.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_client.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_client.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_client.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ../../../src/classic/sdp_client.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_client.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_client.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_client.o ../../../src/classic/sdp_client.c ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o: ../../../src/classic/sdp_client_rfcomm.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ../../../src/classic/sdp_client_rfcomm.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_client_rfcomm.o ../../../src/classic/sdp_client_rfcomm.c ${OBJECTDIR}/_ext/1386327864/sdp_util.o: ../../../src/classic/sdp_util.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_util.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/sdp_util.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_util.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ../../../src/classic/sdp_util.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/sdp_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/sdp_util.o.d" -o ${OBJECTDIR}/_ext/1386327864/sdp_util.o ../../../src/classic/sdp_util.c ${OBJECTDIR}/_ext/1386528437/btstack_util.o: ../../../src/btstack_util.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_util.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_util.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ../../../src/btstack_util.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_util.o ../../../src/btstack_util.c ${OBJECTDIR}/_ext/1386327864/spp_server.o: ../../../src/classic/spp_server.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386327864" @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o.d @${RM} ${OBJECTDIR}/_ext/1386327864/spp_server.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386327864/spp_server.o.d" -o ${OBJECTDIR}/_ext/1386327864/spp_server.o ../../../src/classic/spp_server.c ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o: ../../../src/hci_transport_h4.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4.o ../../../src/hci_transport_h4.c ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o: ../../../src/hci_transport_h5.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ../../../src/hci_transport_h5.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o.d" -o ${OBJECTDIR}/_ext/1386528437/hci_transport_h5.o ../../../src/hci_transport_h5.c ${OBJECTDIR}/_ext/1386528437/btstack_slip.o: ../../../src/btstack_slip.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/btstack_slip.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ../../../src/btstack_slip.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1386528437/btstack_slip.o.d" -o ${OBJECTDIR}/_ext/1386528437/btstack_slip.o ../../../src/btstack_slip.c ${OBJECTDIR}/_ext/1880736137/drv_tmr.o: ../../../../driver/tmr/src/dynamic/drv_tmr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1880736137" @${RM} ${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d @${RM} ${OBJECTDIR}/_ext/1880736137/drv_tmr.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d" -o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ../../../../driver/tmr/src/dynamic/drv_tmr.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1880736137/drv_tmr.o.d" -o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ../../../../driver/tmr/src/dynamic/drv_tmr.c ${OBJECTDIR}/_ext/1112166103/sys_clk.o: ../../../../system/clk/src/sys_clk.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1112166103" @${RM} ${OBJECTDIR}/_ext/1112166103/sys_clk.o.d @${RM} ${OBJECTDIR}/_ext/1112166103/sys_clk.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1112166103/sys_clk.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1112166103/sys_clk.o.d" -o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ../../../../system/clk/src/sys_clk.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1112166103/sys_clk.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1112166103/sys_clk.o.d" -o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ../../../../system/clk/src/sys_clk.c ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o: ../../../../system/clk/src/sys_clk_pic32mx.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1112166103" @${RM} ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d @${RM} ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d" -o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ../../../../system/clk/src/sys_clk_pic32mx.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o.d" -o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ../../../../system/clk/src/sys_clk_pic32mx.c ${OBJECTDIR}/_ext/1510368962/sys_devcon.o: ../../../../system/devcon/src/sys_devcon.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1510368962" @${RM} ${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d @${RM} ${OBJECTDIR}/_ext/1510368962/sys_devcon.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d" -o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ../../../../system/devcon/src/sys_devcon.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1510368962/sys_devcon.o.d" -o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ../../../../system/devcon/src/sys_devcon.c ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o: ../../../../system/devcon/src/sys_devcon_pic32mx.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1510368962" @${RM} ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d @${RM} ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d" -o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ../../../../system/devcon/src/sys_devcon_pic32mx.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o.d" -o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ../../../../system/devcon/src/sys_devcon_pic32mx.c ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o: ../../../../system/int/src/sys_int_pic32.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/2087176412" @${RM} ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d @${RM} ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o - @${FIXDEPS} "${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d" -o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ../../../../system/int/src/sys_int_pic32.c + @${FIXDEPS} "${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o.d" -o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ../../../../system/int/src/sys_int_pic32.c ${OBJECTDIR}/_ext/2147153351/sys_ports.o: ../../../../system/ports/src/sys_ports.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/2147153351" @${RM} ${OBJECTDIR}/_ext/2147153351/sys_ports.o.d @${RM} ${OBJECTDIR}/_ext/2147153351/sys_ports.o - @${FIXDEPS} "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" -o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ../../../../system/ports/src/sys_ports.c + @${FIXDEPS} "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bt_audio_dk" -I"../../../src" -I"../../../chipset/csr" -I"../../../platform/embedded" -MMD -MF "${OBJECTDIR}/_ext/2147153351/sys_ports.o.d" -o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ../../../../system/ports/src/sys_ports.c endif @@ -624,12 +624,12 @@ endif ifeq ($(TYPE_IMAGE), DEBUG_RUN) dist/${CND_CONF}/${IMAGE_TYPE}/app.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk ../../../../../bin/framework/peripheral/PIC32MX450F256L_peripherals.a @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} - ${MP_CC} $(MP_EXTRA_LD_PRE) -mdebugger -D__MPLAB_DEBUGGER_PK3=1 -mprocessor=$(MP_PROCESSOR_OPTION) -o dist/${CND_CONF}/${IMAGE_TYPE}/app.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} ../../../../../bin/framework/peripheral/PIC32MX450F256L_peripherals.a -mreserve=boot@0x1FC02000:0x1FC02FEF -mreserve=boot@0x1FC02000:0x1FC0275F -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1,--defsym=__MPLAB_DEBUGGER_PK3=1,-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map",--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml + ${MP_CC} $(MP_EXTRA_LD_PRE) -mdebugger -D__MPLAB_DEBUGGER_PK3=1 -mprocessor=$(MP_PROCESSOR_OPTION) -o dist/${CND_CONF}/${IMAGE_TYPE}/app.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} ../../../../../bin/framework/peripheral/PIC32MX450F256L_peripherals.a -mreserve=boot@0x1FC02000:0x1FC02FEF -mreserve=boot@0x1FC02000:0x1FC0275F -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1,--defsym=__MPLAB_DEBUGGER_PK3=1,--defsym=_min_heap_size=16,-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map",--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml else dist/${CND_CONF}/${IMAGE_TYPE}/app.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk ../../../../../bin/framework/peripheral/PIC32MX450F256L_peripherals.a @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} - ${MP_CC} $(MP_EXTRA_LD_PRE) -mprocessor=$(MP_PROCESSOR_OPTION) -o dist/${CND_CONF}/${IMAGE_TYPE}/app.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} ../../../../../bin/framework/peripheral/PIC32MX450F256L_peripherals.a -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map",--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml + ${MP_CC} $(MP_EXTRA_LD_PRE) -mprocessor=$(MP_PROCESSOR_OPTION) -o dist/${CND_CONF}/${IMAGE_TYPE}/app.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} ../../../../../bin/framework/peripheral/PIC32MX450F256L_peripherals.a -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=_min_heap_size=16,-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map",--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml ${MP_CC_DIR}/xc32-bin2hex dist/${CND_CONF}/${IMAGE_TYPE}/app.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} endif diff --git a/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties b/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties index 77606e075..bf18f1220 100644 --- a/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties +++ b/port/pic32-harmony/app.X/nbproject/Makefile-genesis.properties @@ -1,8 +1,8 @@ # -#Mon May 02 12:40:53 CEST 2016 +#Mon May 02 17:06:20 CEST 2016 default.com-microchip-mplab-nbide-toolchainXC32-XC32LanguageToolchain.md5=53fb2ac0203ca7bc347fa1cfc029d2dd default.languagetoolchain.dir=/Applications/microchip/xc32/v1.40/bin -configurations-xml=35ba2a305a20b8d5e4d4910fd393d084 +configurations-xml=0df9182c13476f6c3a0ce9f91bd947c3 com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=4b47e815d50912689a67d0b162f47a58 default.languagetoolchain.version=1.40 host.platform=mac diff --git a/port/pic32-harmony/app.X/nbproject/configurations.xml b/port/pic32-harmony/app.X/nbproject/configurations.xml index d349cad28..42fa9fc69 100644 --- a/port/pic32-harmony/app.X/nbproject/configurations.xml +++ b/port/pic32-harmony/app.X/nbproject/configurations.xml @@ -6,9 +6,9 @@ projectFiles="true"> - - ../src/system_config/bk-audio-dk/system_definitions.h - ../src/system_config/bk-audio-dk/system_config.h + + ../src/system_config/bt_audio_dk/system_definitions.h + ../src/system_config/bt_audio_dk/system_config.h ../../../src/btstack_debug.h @@ -95,9 +95,9 @@ projectFiles="true"> - - ../src/system_config/bk-audio-dk/system_init.c - ../src/system_config/bk-audio-dk/system_tasks.c + + ../src/system_config/bt_audio_dk/system_init.c + ../src/system_config/bt_audio_dk/system_tasks.c ../src/btstack_port.c @@ -243,7 +243,7 @@ + value=".;../../../..;../src;../src/system_config/bt_audio_dk;../../../src;../../../chipset/csr;../../../platform/embedded"/> @@ -296,7 +296,7 @@ - + @@ -385,7 +385,6 @@ - diff --git a/port/pic32-harmony/app.X/nbproject/private/configurations.xml b/port/pic32-harmony/app.X/nbproject/private/configurations.xml index e6be655eb..6d60a6101 100644 --- a/port/pic32-harmony/app.X/nbproject/private/configurations.xml +++ b/port/pic32-harmony/app.X/nbproject/private/configurations.xml @@ -4,7 +4,7 @@ 0 - :=MPLABComm-USB-Microchip:=<vid>04D8:=<pid>900A:=<rev>0002:=<man>Microchip Technology Inc.:=<prod>PICkit 3:=<sn>BUR140172964:=<drv>x:=<xpt>h:=end + /Applications/microchip/xc32/v1.40/bin place holder 1 diff --git a/port/pic32-harmony/create_examples.py b/port/pic32-harmony/create_examples.py new file mode 100755 index 000000000..5dfece95e --- /dev/null +++ b/port/pic32-harmony/create_examples.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python +# +# Create project files for all BTstack embedded examples in harmony/apps/btstack + +import os +import shutil +import sys +import time +import subprocess +import re + +gatt_update_template = '''#!/bin/sh +DIR=`dirname $0` +BTSTACK_ROOT=$DIR/../../../framework/btstack +echo "Creating EXAMPLE.h from EXAMPLE.gatt" +$BTSTACK_ROOT/tool/compile_gatt.py $BTSTACK_ROOT/example/EXAMPLE.gatt $DIR/EXAMPLE.h +''' + +# get script path +script_path = os.path.abspath(os.path.dirname(sys.argv[0])) + +# validate Harmony root by reading version.txt +harmony_root = script_path + "/../../../../" +print harmony_root +harmony_version = "" +try: + with open(harmony_root + 'config/harmony.hconfig', 'r') as fin: + for line in fin: + m = re.search('default \"(.*)\"', line) + if m and len(m.groups()) == 1: + harmony_version = m.groups(1) + break +except: + pass + +if len(harmony_version) == 0: + print("Cannot find Harmony root. Make sure BTstack is checked out as harmony/vx_xx/frameworks/btstack") + sys.exit(1) + +# show Harmony version +print("Found Harmony version %s" % harmony_version) + +# path to examples +examples_embedded = script_path + "/../../example/" + +# path to WICED/apps/btstack +apps_btstack = harmony_root + "/apps/btstack/" + +print("Creating examples in apps/btstack") + +# iterate over btstack examples +for file in os.listdir(examples_embedded): + if not file.endswith(".c"): + continue + example = file[:-2] + + # recreate folder + apps_folder = apps_btstack + example + "/" + shutil.rmtree(apps_folder) + os.makedirs(apps_folder) + + # create update_gatt.sh if .gatt file is present + gatt_path = examples_embedded + example + ".gatt" + if os.path.exists(gatt_path): + update_gatt_script = apps_folder + "update_gatt_db.sh" + with open(update_gatt_script, "wt") as fout: + fout.write(gatt_update_template.replace("EXAMPLE", example)) + os.chmod(update_gatt_script, 0o755) + subprocess.call(update_gatt_script + "> /dev/null", shell=True) + print("- %s including compiled GATT DB" % example) + else: + print("- %s" % example) + + + # create $example.X + appX_folder = apps_folder + example + ".X/" + os.makedirs(appX_folder) + + # create makefife + shutil.copyfile(script_path + "/app.X/Makefile", appX_folder + "Makefile") + + nbproject_folder = appX_folder = appX_folder + "nbproject/" + os.makedirs(nbproject_folder) + + template_path = script_path + "/app.X/nbproject/" + for file in os.listdir(template_path): + src = template_path + file + dst = nbproject_folder + file + # copy private folder + if file == "private": + shutil.copytree(src, dst) + continue + # replace app.X and spp_and_le_counter.c + with open(src, 'r') as fin: + template = fin.read() + with open(dst, 'wt') as fout: + # template = template.replace('app', example) + template = template.replace("../../../example/spp_and_le_counter.c", "../../../../framework/btstack/example/" + example + ".c") + template = template.replace(">../../../../driver", ">../../../../framework/driver"); + template = template.replace(">../../../../system", ">../../../../framework/system"); + template = template.replace(">../../../chipset", ">../../../../framework/btstack/chipset"); + template = template.replace(">../../../platform", ">../../../../framework/btstack/platform"); + template = template.replace(">../../../src", ">../../../../framework/btstack/src"); + template = template.replace(">../src", ">../../../../framework/btstack/port/pic32-harmony/src"); + template = template.replace("app.X", example+".X") + template = template.replace(";../../../..", ";../../../../framework"); + template = template.replace(";../../../chipset", ";../../../../framework/btstack/chipset") + template = template.replace(";../../../platform", ";../../../../framework/btstack/platform") + template = template.replace(";../../../src", ";../../../../framework/btstack/src") + template = template.replace(";../src", ";../../../../framework/btstack/port/pic32-harmony/src") + template = template.replace(">../../../../../bin/framework/peripheral", ">../../../../bin/framework/peripheral") + template = template.replace('value=".;', 'value="..;') + fout.write(template) From 94d78ec3c1abdbaeedfec89a0650e3d2d36f1b57 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 3 May 2016 16:02:41 +0200 Subject: [PATCH 48/74] hsp_ag: fix ringing --- src/classic/hsp_ag.c | 60 ++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/src/classic/hsp_ag.c b/src/classic/hsp_ag.c index c4bf0d1ab..d055a3e5c 100644 --- a/src/classic/hsp_ag.c +++ b/src/classic/hsp_ag.c @@ -349,6 +349,7 @@ static void hsp_ringing_timeout_handler(btstack_timer_source_t * timer){ ag_ring = 1; btstack_run_loop_set_timer(&hs_timeout, 2000); // 2 seconds timeout btstack_run_loop_add_timer(&hs_timeout); + hsp_run(); } static void hsp_ringing_timer_start(void){ @@ -363,23 +364,23 @@ static void hsp_ringing_timer_stop(void){ } void hsp_ag_start_ringing(void){ - if (hsp_state != HSP_W2_CONNECT_SCO) return; ag_ring = 1; - hsp_state = HSP_W4_RING_ANSWER; + if (hsp_state == HSP_W2_CONNECT_SCO) { + hsp_state = HSP_W4_RING_ANSWER; + } hsp_ringing_timer_start(); } void hsp_ag_stop_ringing(void){ ag_ring = 0; - ag_num_button_press_received = 0; - hsp_state = HSP_W2_CONNECT_SCO; + if (hsp_state == HSP_W4_RING_ANSWER){ + hsp_state = HSP_W2_CONNECT_SCO; + } hsp_ringing_timer_stop(); } static void hsp_run(void){ - int err; - if (ag_send_ok){ if (!rfcomm_can_send_packet_now(rfcomm_cid)) { rfcomm_request_can_send_now_event(rfcomm_cid); @@ -396,10 +397,17 @@ static void hsp_run(void){ return; } ag_send_error = 0; - err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_ERROR); - if (err) { - ag_send_error = 1; + hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_ERROR); + return; + } + + if (ag_ring){ + if (!rfcomm_can_send_packet_now(rfcomm_cid)) { + rfcomm_request_can_send_now_event(rfcomm_cid); + return; } + ag_ring = 0; + hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_RING); return; } @@ -431,30 +439,18 @@ static void hsp_run(void){ break; case HSP_W4_RING_ANSWER: - if (ag_ring){ - if (!rfcomm_can_send_packet_now(rfcomm_cid)) { - rfcomm_request_can_send_now_event(rfcomm_cid); - return; - } - ag_ring = 0; - err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_RING); - if (err) { - ag_ring = 1; - } - break; + if (!ag_num_button_press_received) break; + + if (!rfcomm_can_send_packet_now(rfcomm_cid)) { + rfcomm_request_can_send_now_event(rfcomm_cid); + return; } - if (!ag_num_button_press_received) break; ag_send_ok = 0; - ag_num_button_press_received = 0; hsp_state = HSP_W2_CONNECT_SCO; - err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_OK); - if (err) { - hsp_state = HSP_W4_RING_ANSWER; - ag_num_button_press_received = 1; - } + hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_OK); break; case HSP_W2_CONNECT_SCO: @@ -486,10 +482,7 @@ static void hsp_run(void){ ag_microphone_gain = -1; char buffer[10]; sprintf(buffer, "%s=%d\r\n", HSP_MICROPHONE_GAIN, gain); - err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, buffer); - if (err) { - ag_microphone_gain = gain; - } + hsp_ag_send_str_over_rfcomm(rfcomm_cid, buffer); break; } @@ -502,10 +495,7 @@ static void hsp_run(void){ ag_speaker_gain = -1; char buffer[10]; sprintf(buffer, "%s=%d\r\n", HSP_SPEAKER_GAIN, gain); - err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, buffer); - if (err) { - ag_speaker_gain = gain; - } + hsp_ag_send_str_over_rfcomm(rfcomm_cid, buffer); break; } break; From 659d758c075fb6f1816a1837ccc86cff2a3c7631 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 3 May 2016 16:11:22 +0200 Subject: [PATCH 49/74] hci: increase HCI Reset resend timeout to 200 ms --- src/hci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hci.c b/src/hci.c index b8231d4a3..3aa22a97c 100644 --- a/src/hci.c +++ b/src/hci.c @@ -73,6 +73,7 @@ #define HCI_CONNECTION_TIMEOUT_MS 10000 +#define HCI_RESET_RESEND_TIMEOUT_MS 200 // prototypes static void hci_update_scan_enable(void); @@ -908,7 +909,7 @@ static void hci_initializing_run(void){ #ifndef HAVE_PLATFORM_IPHONE_OS // prepare reset if command complete not received in 100ms - btstack_run_loop_set_timer(&hci_stack->timeout, 100); + btstack_run_loop_set_timer(&hci_stack->timeout, HCI_RESET_RESEND_TIMEOUT_MS); btstack_run_loop_set_timer_handler(&hci_stack->timeout, hci_initialization_timeout_handler); btstack_run_loop_add_timer(&hci_stack->timeout); #endif @@ -923,7 +924,7 @@ static void hci_initializing_run(void){ case HCI_INIT_SEND_RESET_CSR_WARM_BOOT: hci_state_reset(); // prepare reset if command complete not received in 100ms - btstack_run_loop_set_timer(&hci_stack->timeout, 100); + btstack_run_loop_set_timer(&hci_stack->timeout, HCI_RESET_RESEND_TIMEOUT_MS); btstack_run_loop_set_timer_handler(&hci_stack->timeout, hci_initialization_timeout_handler); btstack_run_loop_add_timer(&hci_stack->timeout); // send command @@ -944,7 +945,7 @@ static void hci_initializing_run(void){ // STLC25000D: baudrate change happens within 0.5 s after command was send, // use timer to update baud rate after 100 ms (knowing exactly, when command was sent is non-trivial) if (hci_stack->manufacturer == COMPANY_ID_ST_MICROELECTRONICS){ - btstack_run_loop_set_timer(&hci_stack->timeout, 100); + btstack_run_loop_set_timer(&hci_stack->timeout, HCI_RESET_RESEND_TIMEOUT_MS); btstack_run_loop_add_timer(&hci_stack->timeout); } break; @@ -973,7 +974,7 @@ static void hci_initializing_run(void){ break; case 2: // CSR Warm Boot: Wait a bit, then send HCI Reset until HCI Command Complete log_info("CSR Warm Boot"); - btstack_run_loop_set_timer(&hci_stack->timeout, 100); + btstack_run_loop_set_timer(&hci_stack->timeout, HCI_RESET_RESEND_TIMEOUT_MS); btstack_run_loop_set_timer_handler(&hci_stack->timeout, hci_initialization_timeout_handler); btstack_run_loop_add_timer(&hci_stack->timeout); if (hci_stack->manufacturer == COMPANY_ID_CAMBRIDGE_SILICON_RADIO From e8609f3a5f9d1c1c86f862eb1a56dcf7f685e530 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 9 May 2016 18:36:20 +0200 Subject: [PATCH 50/74] util: fix nibble_for_char --- src/btstack_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/btstack_util.c b/src/btstack_util.c index 82bf075ae..d65b3844e 100644 --- a/src/btstack_util.c +++ b/src/btstack_util.c @@ -146,8 +146,8 @@ char char_for_nibble(int nibble){ int nibble_for_char(char c){ if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'a' && c <= 'f') return c - 'a'; - if (c >= 'A' && c <= 'F') return c - 'F'; + if (c >= 'a' && c <= 'f') return c - 'a' - 10; + if (c >= 'A' && c <= 'F') return c - 'A' - 10; return -1; } From 9f507070ebd233a1ff5a9faac992fca88fcdc330 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 10 May 2016 09:31:29 +0200 Subject: [PATCH 51/74] util: really fix char_for_nibble --- src/btstack_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/btstack_util.c b/src/btstack_util.c index d65b3844e..a495f5a82 100644 --- a/src/btstack_util.c +++ b/src/btstack_util.c @@ -146,8 +146,8 @@ char char_for_nibble(int nibble){ int nibble_for_char(char c){ if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'a' && c <= 'f') return c - 'a' - 10; - if (c >= 'A' && c <= 'F') return c - 'A' - 10; + if (c >= 'a' && c <= 'f') return c - 'a' + 10; + if (c >= 'A' && c <= 'F') return c - 'A' + 10; return -1; } From ebaeb1be2da7fbd12efcbeddd25dd4901330d9c6 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 10 May 2016 09:36:33 +0200 Subject: [PATCH 52/74] util: add btstack_min, btstack_max for uint32 --- src/btstack_util.c | 8 ++++++++ src/btstack_util.h | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/btstack_util.c b/src/btstack_util.c index a495f5a82..7529c638e 100644 --- a/src/btstack_util.c +++ b/src/btstack_util.c @@ -137,6 +137,14 @@ void reverse_bd_addr(const bd_addr_t src, bd_addr_t dest){ reverse_bytes(src, dest, 6); } +uint32_t btstack_min(uint32_t a, uint32_t b){ + return a < b ? a : b; +} + +uint32_t btstack_max(uint32_t a, uint32_t b){ + return a > b ? a : b; +} + char char_for_nibble(int nibble){ if (nibble < 10) return '0' + nibble; nibble -= 10; diff --git a/src/btstack_util.h b/src/btstack_util.h index 7d275f6df..1cd7b9c5b 100644 --- a/src/btstack_util.h +++ b/src/btstack_util.h @@ -72,6 +72,22 @@ extern "C" { typedef uint8_t device_name_t[DEVICE_NAME_LEN+1]; +/** + * @brief Minimum function for uint32_t + * @param a + * @param b + * @return value + */ +uint32_t btstack_min(uint32_t a, uint32_t b); + +/** + * @brief Maximum function for uint32_t + * @param a + * @param b + * @return value + */ +uint32_t btstack_max(uint32_t a, uint32_t b); + /** * @brief Read 16/24/32 bit little endian value from buffer From 7b6395ea5894399fcd0796038fd033a75749a791 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 10 May 2016 10:06:29 +0200 Subject: [PATCH 53/74] examples: fix chunk len calculation in att_read_callback for le_couner and spp_and_le_couner --- example/le_counter.c | 14 +++++++++++--- example/spp_and_le_counter.c | 28 +++++++++++++++++++++------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/example/le_counter.c b/example/le_counter.c index f2912c051..b918b632a 100644 --- a/example/le_counter.c +++ b/example/le_counter.c @@ -117,6 +117,9 @@ static void le_counter_setup(void){ heartbeat.process = &heartbeat_handler; btstack_run_loop_set_timer(&heartbeat, HEARTBEAT_PERIOD_MS); btstack_run_loop_add_timer(&heartbeat); + + // beat once + beat(); } /* LISTING_END */ @@ -189,13 +192,18 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack // - if buffer != NULL, copy data and return number bytes copied // @param offset defines start of attribute value static uint16_t att_read_callback(hci_con_handle_t connection_handle, uint16_t att_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){ + uint16_t size = 0; if (att_handle == ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_VALUE_HANDLE){ if (buffer){ - memcpy(buffer, &counter_string[offset], counter_string_len - offset); + // size is bound by actual value chunk and provided buffer + size = btstack_min(counter_string_len - offset, buffer_size); + memcpy(buffer, &counter_string[offset], size); + } else { + // size is only bound by actual value chunk + size = counter_string_len - offset; } - return counter_string_len - offset; } - return 0; + return size; } /* LISTING_END */ diff --git a/example/spp_and_le_counter.c b/example/spp_and_le_counter.c index 1bdd6c8c6..8f51727c9 100644 --- a/example/spp_and_le_counter.c +++ b/example/spp_and_le_counter.c @@ -176,14 +176,18 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack // - if buffer != NULL, copy data and return number bytes copied // @param offset defines start of attribute value static uint16_t att_read_callback(hci_con_handle_t con_handle, uint16_t att_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){ + uint16_t size = 0; if (att_handle == ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_VALUE_HANDLE){ if (buffer){ - log_info("att_read_callback for Characteristic *FF11*, value %s", counter_string); - memcpy(buffer, &counter_string[offset], counter_string_len - offset); + // size is bound by actual value chunk and provided buffer + size = btstack_min(counter_string_len - offset, buffer_size); + memcpy(buffer, &counter_string[offset], size); + } else { + // size is only bound by actual value chunk + size = counter_string_len - offset; } - return counter_string_len - offset; } - return 0; + return size; } // write requests @@ -207,6 +211,12 @@ static int att_write_callback(hci_con_handle_t con_handle, uint16_t att_handle, } } +static void beat(void){ + counter++; + counter_string_len = sprintf(counter_string, "BTstack counter %04u", counter); + puts(counter_string); +} + /* * @section Heartbeat Handler * @@ -217,9 +227,9 @@ static int att_write_callback(hci_con_handle_t con_handle, uint16_t att_handle, /* LISTING_START(heartbeat): Combined Heartbeat handler */ static void heartbeat_handler(struct btstack_timer_source *ts){ - counter++; - counter_string_len = sprintf(counter_string, "BTstack counter %04u\n", counter); - // log_info("%s", counter_string); + if (rfcomm_channel_id || le_notification_enabled) { + beat(); + } if (rfcomm_channel_id){ rfcomm_request_can_send_now_event(rfcomm_channel_id); @@ -228,6 +238,7 @@ static void heartbeat_handler(struct btstack_timer_source *ts){ if (le_notification_enabled) { att_server_request_can_send_now_event(att_con_handle); } + btstack_run_loop_set_timer(ts, HEARTBEAT_PERIOD_MS); btstack_run_loop_add_timer(ts); } @@ -288,6 +299,9 @@ int btstack_main(void) gap_advertisements_set_data(adv_data_len, (uint8_t*) adv_data); gap_advertisements_enable(1); + // beat once + beat(); + // turn on! hci_power_control(HCI_POWER_ON); From ea0565ceb1b5a277be95047d27aa512ff0ac3b33 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 10 May 2016 12:25:25 +0200 Subject: [PATCH 54/74] examples: simplify att_read_callback for le_couner and spp_and_le_counter again --- example/le_counter.c | 11 ++++------- example/spp_and_le_counter.c | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/example/le_counter.c b/example/le_counter.c index b918b632a..38a0baff6 100644 --- a/example/le_counter.c +++ b/example/le_counter.c @@ -192,18 +192,15 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack // - if buffer != NULL, copy data and return number bytes copied // @param offset defines start of attribute value static uint16_t att_read_callback(hci_con_handle_t connection_handle, uint16_t att_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){ - uint16_t size = 0; if (att_handle == ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_VALUE_HANDLE){ if (buffer){ - // size is bound by actual value chunk and provided buffer - size = btstack_min(counter_string_len - offset, buffer_size); - memcpy(buffer, &counter_string[offset], size); + memcpy(buffer, &counter_string[offset], buffer_size); + return buffer_size; } else { - // size is only bound by actual value chunk - size = counter_string_len - offset; + return counter_string_len; } } - return size; + return 0; } /* LISTING_END */ diff --git a/example/spp_and_le_counter.c b/example/spp_and_le_counter.c index 8f51727c9..d68956c78 100644 --- a/example/spp_and_le_counter.c +++ b/example/spp_and_le_counter.c @@ -176,18 +176,15 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack // - if buffer != NULL, copy data and return number bytes copied // @param offset defines start of attribute value static uint16_t att_read_callback(hci_con_handle_t con_handle, uint16_t att_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){ - uint16_t size = 0; if (att_handle == ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_VALUE_HANDLE){ if (buffer){ - // size is bound by actual value chunk and provided buffer - size = btstack_min(counter_string_len - offset, buffer_size); - memcpy(buffer, &counter_string[offset], size); + memcpy(buffer, &counter_string[offset], buffer_size); + return buffer_size; } else { - // size is only bound by actual value chunk - size = counter_string_len - offset; + return counter_string_len; } } - return size; + return 0; } // write requests From 288636a2d1a66fc79fb789b851685c4d4c9b80b8 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 18 May 2016 11:15:07 +0200 Subject: [PATCH 55/74] l2cap: correct list of fixed channels supported --- src/l2cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/l2cap.c b/src/l2cap.c index 51ce5320a..465315316 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -576,7 +576,7 @@ static void l2cap_run(void){ case 3: { // Fixed Channels Supported uint8_t map[8]; memset(map, 0, 8); - map[0] = 0x01; // L2CAP Signaling Channel (0x01) + Connectionless reception (0x02) + map[0] = 0x06; // L2CAP Signaling Channel (0x02) + Connectionless reception (0x04) l2cap_send_signaling_packet(handle, INFORMATION_RESPONSE, sig_id, infoType, 0, sizeof(map), &map); break; } From 18a2fc6f7f0397a3aac1653fb21517720ca04278 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 18 May 2016 11:21:34 +0200 Subject: [PATCH 56/74] ad_parser: use const where possible --- example/gap_le_advertisements.c | 6 +++--- src/ble/ad_parser.c | 22 +++++++++++----------- src/ble/ad_parser.h | 16 ++++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/example/gap_le_advertisements.c b/example/gap_le_advertisements.c index f5557ac6a..93e6655c1 100644 --- a/example/gap_le_advertisements.c +++ b/example/gap_le_advertisements.c @@ -133,9 +133,9 @@ static void dump_advertisement_data(const uint8_t * adv_data, uint8_t adv_size){ bd_addr_t address; uint8_t uuid_128[16]; for (ad_iterator_init(&context, adv_size, (uint8_t *)adv_data) ; ad_iterator_has_more(&context) ; ad_iterator_next(&context)){ - uint8_t data_type = ad_iterator_get_data_type(&context); - uint8_t size = ad_iterator_get_data_len(&context); - uint8_t * data = ad_iterator_get_data(&context); + uint8_t data_type = ad_iterator_get_data_type(&context); + uint8_t size = ad_iterator_get_data_len(&context); + const uint8_t * data = ad_iterator_get_data(&context); if (data_type > 0 && data_type < 0x1B){ printf(" %s: ", ad_types[data_type]); diff --git a/src/ble/ad_parser.c b/src/ble/ad_parser.c index eb74ad918..6a2c9a824 100644 --- a/src/ble/ad_parser.c +++ b/src/ble/ad_parser.c @@ -61,13 +61,13 @@ typedef enum { CompleteList128 = 0x07 } UUID_TYPE; -void ad_iterator_init(ad_context_t *context, uint8_t ad_len, uint8_t * ad_data){ +void ad_iterator_init(ad_context_t *context, uint8_t ad_len, const uint8_t * ad_data){ context->data = ad_data; context->length = ad_len; context->offset = 0; } -int ad_iterator_has_more(ad_context_t * context){ +int ad_iterator_has_more(const ad_context_t * context){ return context->offset < context->length; } @@ -81,24 +81,24 @@ void ad_iterator_next(ad_context_t * context){ context->offset = new_offset; } -uint8_t ad_iterator_get_data_len(ad_context_t * context){ +uint8_t ad_iterator_get_data_len(const ad_context_t * context){ return context->data[context->offset] - 1; } -uint8_t ad_iterator_get_data_type(ad_context_t * context){ +uint8_t ad_iterator_get_data_type(const ad_context_t * context){ return context->data[context->offset + 1]; } -uint8_t * ad_iterator_get_data(ad_context_t * context){ +const uint8_t * ad_iterator_get_data(const ad_context_t * context){ return &context->data[context->offset + 2]; } -int ad_data_contains_uuid16(uint8_t ad_len, uint8_t * ad_data, uint16_t uuid16){ +int ad_data_contains_uuid16(uint8_t ad_len, const uint8_t * ad_data, uint16_t uuid16){ ad_context_t context; for (ad_iterator_init(&context, ad_len, ad_data) ; ad_iterator_has_more(&context) ; ad_iterator_next(&context)){ - uint8_t data_type = ad_iterator_get_data_type(&context); - uint8_t data_len = ad_iterator_get_data_len(&context); - uint8_t * data = ad_iterator_get_data(&context); + uint8_t data_type = ad_iterator_get_data_type(&context); + uint8_t data_len = ad_iterator_get_data_len(&context); + const uint8_t * data = ad_iterator_get_data(&context); int i; uint8_t ad_uuid128[16], uuid128_bt[16]; @@ -127,7 +127,7 @@ int ad_data_contains_uuid16(uint8_t ad_len, uint8_t * ad_data, uint16_t uuid16){ return 0; } -int ad_data_contains_uuid128(uint8_t ad_len, uint8_t * ad_data, uint8_t * uuid128){ +int ad_data_contains_uuid128(uint8_t ad_len, const uint8_t * ad_data, const uint8_t * uuid128){ ad_context_t context; // input in big endian/network order, bluetooth data in little endian uint8_t uuid128_le[16]; @@ -135,7 +135,7 @@ int ad_data_contains_uuid128(uint8_t ad_len, uint8_t * ad_data, uint8_t * uuid12 for (ad_iterator_init(&context, ad_len, ad_data) ; ad_iterator_has_more(&context) ; ad_iterator_next(&context)){ uint8_t data_type = ad_iterator_get_data_type(&context); uint8_t data_len = ad_iterator_get_data_len(&context); - uint8_t * data = ad_iterator_get_data(&context); + const uint8_t * data = ad_iterator_get_data(&context); int i; uint8_t ad_uuid128[16]; diff --git a/src/ble/ad_parser.h b/src/ble/ad_parser.h index 70ac66a93..4fea026e3 100644 --- a/src/ble/ad_parser.h +++ b/src/ble/ad_parser.h @@ -53,24 +53,24 @@ extern "C" { /* API_START */ typedef struct ad_context { - uint8_t * data; + const uint8_t * data; uint8_t offset; uint8_t length; } ad_context_t; // Advertising or Scan Response data iterator -void ad_iterator_init(ad_context_t *context, uint8_t ad_len, uint8_t * ad_data); -int ad_iterator_has_more(ad_context_t * context); +void ad_iterator_init(ad_context_t *context, uint8_t ad_len, const uint8_t * ad_data); +int ad_iterator_has_more(const ad_context_t * context); void ad_iterator_next(ad_context_t * context); // Access functions -uint8_t ad_iterator_get_data_type(ad_context_t * context); -uint8_t ad_iterator_get_data_len(ad_context_t * context); -uint8_t * ad_iterator_get_data(ad_context_t * context); +uint8_t ad_iterator_get_data_type(const ad_context_t * context); +uint8_t ad_iterator_get_data_len(const ad_context_t * context); +const uint8_t * ad_iterator_get_data(const ad_context_t * context); // convenience function on complete advertisements -int ad_data_contains_uuid16(uint8_t ad_len, uint8_t * ad_data, uint16_t uuid); -int ad_data_contains_uuid128(uint8_t ad_len, uint8_t * ad_data, uint8_t * uuid128); +int ad_data_contains_uuid16(uint8_t ad_len, const uint8_t * ad_data, uint16_t uuid); +int ad_data_contains_uuid128(uint8_t ad_len, const uint8_t * ad_data, const uint8_t * uuid128); /* API_END */ From 95fd1475d5729e5bee7a5a0d070566bf890e4c7e Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 18 May 2016 11:23:41 +0200 Subject: [PATCH 57/74] ad_parser: use const where possible --- test/ble_client/advertising_data_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ble_client/advertising_data_parser.c b/test/ble_client/advertising_data_parser.c index 572e1dde2..d37ce55c6 100644 --- a/test/ble_client/advertising_data_parser.c +++ b/test/ble_client/advertising_data_parser.c @@ -132,7 +132,7 @@ bool nameHasPrefix(const char * name_prefix, uint16_t data_length, uint8_t * dat for (ad_iterator_init(&context, data_length, data) ; ad_iterator_has_more(&context) ; ad_iterator_next(&context)){ uint8_t data_type = ad_iterator_get_data_type(&context); uint8_t data_len = ad_iterator_get_data_len(&context); - uint8_t * data = ad_iterator_get_data(&context); + const uint8_t * data = ad_iterator_get_data(&context); int compare_len = name_prefix_len; switch(data_type){ case 8: // shortented local name @@ -172,7 +172,7 @@ TEST(ADParser, TestDataParsing){ for (ad_iterator_init(&context, ad_len, ad_data) ; ad_iterator_has_more(&context) ; ad_iterator_next(&context)){ uint8_t data_type = ad_iterator_get_data_type(&context); uint8_t data_len = ad_iterator_get_data_len(&context); - uint8_t * data = ad_iterator_get_data(&context); + const uint8_t * data = ad_iterator_get_data(&context); CHECK_EQUAL(expected_len[i], data_len); CHECK_EQUAL(expected_type[i], data_type); From a3fe55ccff32e8dbd9221275424b6315c4da8a23 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 20 May 2016 10:36:17 +0200 Subject: [PATCH 58/74] cc256x: support older chipsets --- chipset/cc256x/Makefile.inc | 53 +++++++++++++++++++++- chipset/cc256x/convert_bts_init_scripts.py | 3 +- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/chipset/cc256x/Makefile.inc b/chipset/cc256x/Makefile.inc index 5937c414d..bb312c532 100644 --- a/chipset/cc256x/Makefile.inc +++ b/chipset/cc256x/Makefile.inc @@ -4,6 +4,38 @@ # BASE_URL = https://git.ti.com/ti-bt/service-packs/blobs/raw/a027ae390d8790e56e1c78136c78fe6537470e91 +# first generation CC2560 - TIInit_6.2.31.bts part of .zip archive + +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 + bluetooth_init_cc2560B_1.2_BT_Spec_4.0.bts: curl -O $(BASE_URL)/bluetooth_init_cc2560B_1.2_BT_Spec_4.0.bts @@ -31,6 +63,17 @@ 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 +86,19 @@ 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) + 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 + + diff --git a/chipset/cc256x/convert_bts_init_scripts.py b/chipset/cc256x/convert_bts_init_scripts.py index 71a9b3c12..c4119ea42 100755 --- a/chipset/cc256x/convert_bts_init_scripts.py +++ b/chipset/cc256x/convert_bts_init_scripts.py @@ -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: From edc52946c24d9ab476077fb84eb31aad41033de2 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 20 May 2016 11:13:49 +0200 Subject: [PATCH 59/74] cc256x: support CC256xB v1.4 init scripts --- chipset/cc256x/Makefile.inc | 26 +++++++++++++++------- chipset/cc256x/convert_bts_init_scripts.py | 12 ++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/chipset/cc256x/Makefile.inc b/chipset/cc256x/Makefile.inc index bb312c532..732804df8 100644 --- a/chipset/cc256x/Makefile.inc +++ b/chipset/cc256x/Makefile.inc @@ -3,6 +3,7 @@ # 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 # first generation CC2560 - TIInit_6.2.31.bts part of .zip archive @@ -36,12 +37,7 @@ bluetooth_init_cc2564_2.14.bts: CC2564_BT_BLE_SP_BTS.zip # third generation -bluetooth_init_cc2560B_1.2_BT_Spec_4.0.bts: - curl -O $(BASE_URL)/bluetooth_init_cc2560B_1.2_BT_Spec_4.0.bts - -bluetooth_init_cc2564B_1.2_BT_Spec_4.0.bts: - curl -O $(BASE_URL)/bluetooth_init_cc2564B_1.2_BT_Spec_4.0.bts - +# 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 @@ -51,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 @@ -61,8 +65,6 @@ 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) @@ -86,6 +88,14 @@ 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) diff --git a/chipset/cc256x/convert_bts_init_scripts.py b/chipset/cc256x/convert_bts_init_scripts.py index c4119ea42..6b340aebf 100755 --- a/chipset/cc256x/convert_bts_init_scripts.py +++ b/chipset/cc256x/convert_bts_init_scripts.py @@ -282,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 @@ -289,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) @@ -298,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) From 36c8a70fe0e50121634358d17c605432da49ea8e Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 20 May 2016 11:27:32 +0200 Subject: [PATCH 60/74] cc256x:use v1.4 init script for CC2560B and CC2564B ports --- .gitignore | 5 +++-- port/ez430-rf2560/Makefile | 4 ++-- port/msp-exp430f5438-cc2564b/Makefile | 4 ++-- port/msp430f5229lp-cc2564b/Makefile | 4 ++-- port/posix-h4/Makefile | 2 +- port/posix-h5/Makefile | 2 +- port/stm32-f103rb-nucleo/Makefile | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index a4c85c315..0c0823b52 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/port/ez430-rf2560/Makefile b/port/ez430-rf2560/Makefile index b53f0136a..88c7786f7 100644 --- a/port/ez430-rf2560/Makefile +++ b/port/ez430-rf2560/Makefile @@ -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 = ../.. diff --git a/port/msp-exp430f5438-cc2564b/Makefile b/port/msp-exp430f5438-cc2564b/Makefile index 470e8cc74..433c9fe41 100644 --- a/port/msp-exp430f5438-cc2564b/Makefile +++ b/port/msp-exp430f5438-cc2564b/Makefile @@ -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 = ../.. diff --git a/port/msp430f5229lp-cc2564b/Makefile b/port/msp430f5229lp-cc2564b/Makefile index 9b0d95e94..abe9e94bf 100644 --- a/port/msp430f5229lp-cc2564b/Makefile +++ b/port/msp430f5229lp-cc2564b/Makefile @@ -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 = ../.. diff --git a/port/posix-h4/Makefile b/port/posix-h4/Makefile index 810b5aa2b..9002a15ad 100644 --- a/port/posix-h4/Makefile +++ b/port/posix-h4/Makefile @@ -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 \ diff --git a/port/posix-h5/Makefile b/port/posix-h5/Makefile index b98920889..b335fd85a 100644 --- a/port/posix-h5/Makefile +++ b/port/posix-h5/Makefile @@ -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 \ diff --git a/port/stm32-f103rb-nucleo/Makefile b/port/stm32-f103rb-nucleo/Makefile index 4e78f7df2..907371543 100644 --- a/port/stm32-f103rb-nucleo/Makefile +++ b/port/stm32-f103rb-nucleo/Makefile @@ -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 \ From 5415113f9fc6cad3e4ab204ca0c3279e4d2e73c8 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 20 May 2016 14:26:01 +0200 Subject: [PATCH 61/74] cc256x: follow recommendations for SCO over HCI --- chipset/cc256x/btstack_chipset_cc256x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chipset/cc256x/btstack_chipset_cc256x.c b/chipset/cc256x/btstack_chipset_cc256x.c index 2a3719ec9..63289ec2f 100644 --- a/chipset/cc256x/btstack_chipset_cc256x.c +++ b/chipset/cc256x/btstack_chipset_cc256x.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 From 483c50788b3c8c2f67b26032efb11fa77cad2be6 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 20 May 2016 14:26:48 +0200 Subject: [PATCH 62/74] hci: enable Default Erroneous Data Reporting for SCO over HCI --- src/hci.c | 9 +++++++-- src/hci.h | 2 ++ src/hci_cmd.c | 8 ++++++++ src/hci_cmd.h | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index 3aa22a97c..d0089a19f 100644 --- a/src/hci.c +++ b/src/hci.c @@ -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(); diff --git a/src/hci.h b/src/hci.h index ce9b15265..1edf83512 100644 --- a/src/hci.h +++ b/src/hci.h @@ -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, diff --git a/src/hci_cmd.c b/src/hci_cmd.c index 36bfd05ab..247cbb675 100644 --- a/src/hci_cmd.c +++ b/src/hci_cmd.c @@ -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 = { diff --git a/src/hci_cmd.h b/src/hci_cmd.h index 16eda89d2..28ac366b7 100644 --- a/src/hci_cmd.h +++ b/src/hci_cmd.h @@ -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; From db7b6733b7bdff335ec3fb76cbd1151e8f0610ba Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 20 May 2016 22:08:13 +0200 Subject: [PATCH 63/74] bnep: provide bnep_cid in packet handler for BNEP_DATA_PACKET --- src/classic/bnep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classic/bnep.c b/src/classic/bnep.c index 3617663fc..1665f6745 100644 --- a/src/classic/bnep.c +++ b/src/classic/bnep.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; From b3bf67571f931cf26b697841350612930d4a9862 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 23 May 2016 13:57:53 +0200 Subject: [PATCH 64/74] libusb: use more transfers for isochronous data --- port/libusb/hci_transport_h2_libusb.c | 42 ++++++++++++++++----------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/port/libusb/hci_transport_h2_libusb.c b/port/libusb/hci_transport_h2_libusb.c index 216328451..ae84b6084 100644 --- a/port/libusb/hci_transport_h2_libusb.c +++ b/port/libusb/hci_transport_h2_libusb.c @@ -69,11 +69,13 @@ #define HAVE_USB_VENDOR_ID_AND_PRODUCT_ID #endif -#define ASYNC_BUFFERS 2 -#define AYSNC_POLLING_INTERVAL_MS 1 +#define ASYNC_BUFFERS 3 +#define ISOC_BUFFERS 10 + +#define ASYNC_POLLING_INTERVAL_MS 1 // -// Bluetooth USB Transprot Alternate Settings: +// Bluetooth USB Transport Alternate Settings: // // 0: No active voice channels (for USB compliance) // 1: One 8 kHz voice channel with 8-bit encoding @@ -147,8 +149,8 @@ static H2_SCO_STATE sco_state; static uint8_t sco_buffer[255+3 + SCO_PACKET_SIZE]; static uint16_t sco_read_pos; static uint16_t sco_bytes_to_read; -static struct libusb_transfer *sco_in_transfer[ASYNC_BUFFERS]; -static uint8_t hci_sco_in_buffer[ASYNC_BUFFERS][SCO_PACKET_SIZE]; +static struct libusb_transfer *sco_in_transfer[ISOC_BUFFERS]; +static uint8_t hci_sco_in_buffer[ISOC_BUFFERS][SCO_PACKET_SIZE]; // outgoing SCO static uint8_t sco_ring_buffer[SCO_RING_BUFFER_SIZE]; @@ -439,7 +441,7 @@ static void usb_process_ts(btstack_timer_source_t *timer) { usb_process_ds((struct btstack_data_source *) NULL, DATA_SOURCE_CALLBACK_READ); // Get the amount of time until next event is due - long msec = AYSNC_POLLING_INTERVAL_MS; + long msec = ASYNC_POLLING_INTERVAL_MS; // Activate timer btstack_run_loop_set_timer(&usb_timer, msec); @@ -774,7 +776,7 @@ static int usb_open(void){ #ifdef ENABLE_SCO_OVER_HCI // incoming - for (c = 0 ; c < ASYNC_BUFFERS ; c++) { + for (c = 0 ; c < ISOC_BUFFERS ; c++) { sco_in_transfer[c] = libusb_alloc_transfer(NUM_ISO_PACKETS); // isochronous transfers SCO in log_info("Alloc iso transfer"); if (!sco_in_transfer[c]) { @@ -853,7 +855,7 @@ static int usb_open(void){ log_info("Async using timers:"); usb_timer.process = usb_process_ts; - btstack_run_loop_set_timer(&usb_timer, AYSNC_POLLING_INTERVAL_MS); + btstack_run_loop_set_timer(&usb_timer, ASYNC_POLLING_INTERVAL_MS); btstack_run_loop_add_timer(&usb_timer); usb_timer_active = 1; } @@ -882,10 +884,13 @@ 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 ENABLE_SCO_OVER_HCI - libusb_cancel_transfer(sco_in_transfer[c]); -#endif } +#ifdef ENABLE_SCO_OVER_HCI + // Cancel all synchronous transfer + for (c = 0 ; c < ISOC_BUFFERS ; c++) { + libusb_cancel_transfer(sco_in_transfer[c]); + } +#endif /* TODO - find a better way to ensure that all transfers have completed */ struct timeval tv; @@ -905,16 +910,19 @@ static int usb_close(void){ } case LIB_USB_INTERFACE_CLAIMED: + // Cancel any asynchronous transfers 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 ENABLE_SCO_OVER_HCI - if (sco_in_transfer[c]) libusb_free_transfer(sco_in_transfer[c]); -#endif + libusb_cancel_transfer(event_in_transfer[c]); + libusb_cancel_transfer(acl_in_transfer[c]); } +#ifdef ENABLE_SCO_OVER_HCI + // Cancel all synchronous transfer + for (c = 0 ; c < ISOC_BUFFERS ; c++) { + libusb_cancel_transfer(sco_in_transfer[c]); + } +#endif // TODO free control and acl out transfers - libusb_release_interface(handle, 0); case LIB_USB_DEVICE_OPENDED: From 47c58a2a6e7c34a530f98c9c35883c5cdaaabde7 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 23 May 2016 18:02:21 +0200 Subject: [PATCH 65/74] posix-h4: disable ehcill - sleep mode entered while data transferred via SCO-via-HCI --- port/posix-h4/btstack_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/posix-h4/btstack_config.h b/port/posix-h4/btstack_config.h index 34d701205..c37cb3ab3 100644 --- a/port/posix-h4/btstack_config.h +++ b/port/posix-h4/btstack_config.h @@ -19,7 +19,7 @@ #define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP -#define ENABLE_EHCILL +// #define ENABLE_EHCILL // BTstack configuration. buffers, sizes, ... #define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy From 185c8cd41d180fc243951d3e0fbaa89088e1c73b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 23 May 2016 18:03:11 +0200 Subject: [PATCH 66/74] example/hsp+hfp: extract SCO test code into sco_demo_util --- example/Makefile.inc | 8 +++---- example/hfp_ag_demo.c | 54 ++++++++---------------------------------- example/hfp_hf_demo.c | 30 ++++++++++++++++++++--- example/hsp_ag_demo.c | 52 ++++------------------------------------ example/hsp_hs_demo.c | 52 ++++------------------------------------ port/libusb/Makefile | 7 ++++++ port/posix-h4/Makefile | 10 +++++++- port/posix-h5/Makefile | 7 ++++++ 8 files changed, 74 insertions(+), 146 deletions(-) diff --git a/example/Makefile.inc b/example/Makefile.inc index c0eed68e9..e8f4a25e8 100644 --- a/example/Makefile.inc +++ b/example/Makefile.inc @@ -160,16 +160,16 @@ led_counter: ${CORE_OBJ} ${COMMON_OBJ} led_counter.c gap_le_advertisements: ${CORE_OBJ} ${COMMON_OBJ} ad_parser.c gap_le_advertisements.c ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ -hsp_hs_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} hsp_hs.o hsp_hs_demo.c +hsp_hs_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sco_demo_util.o hsp_hs.o hsp_hs_demo.c ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ -hsp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} hsp_ag.o hsp_ag_demo.c +hsp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sco_demo_util.o hsp_ag.o hsp_ag_demo.c ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ -hfp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} hfp.o hfp_gsm_model.o hfp_ag.o hfp_ag_demo.c +hfp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sco_demo_util.o hfp.o hfp_gsm_model.o hfp_ag.o hfp_ag_demo.c ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ -hfp_hf_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} hfp.o hfp_hf.o hfp_hf_demo.c +hfp_hf_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sco_demo_util.o hfp.o hfp_hf.o hfp_hf_demo.c ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ clean: diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index 4a9234bb4..352241a8c 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -56,22 +56,11 @@ #include #include "btstack.h" +#include "sco_demo_util.h" #ifdef HAVE_POSIX_STDIN #include "stdin_support.h" #endif - -static int phase = 0; - -// input signal: pre-computed sine wave, 160 Hz -static const uint8_t sine[] = { - 0, 15, 31, 46, 61, 74, 86, 97, 107, 114, - 120, 124, 126, 126, 124, 120, 114, 107, 97, 86, - 74, 61, 46, 31, 15, 0, 241, 225, 210, 195, - 182, 170, 159, 149, 142, 136, 132, 130, 130, 132, - 136, 142, 149, 159, 170, 182, 195, 210, 225, 241, -}; - uint8_t hfp_service_buffer[150]; const uint8_t rfcomm_channel_nr = 1; const char hfp_ag_service_name[] = "BTstack HFP AG Test"; @@ -79,7 +68,9 @@ const char hfp_ag_service_name[] = "BTstack HFP AG Test"; // PTS // static bd_addr_t device_addr = {0x00,0x15,0x83,0x5F,0x9D,0x46}; // BT-201 -static bd_addr_t device_addr = {0x00, 0x07, 0xB0, 0x83, 0x02, 0x5E}; +// static bd_addr_t device_addr = {0x00, 0x07, 0xB0, 0x83, 0x02, 0x5E}; +// CC256x +bd_addr_t device_addr = { 0xD0, 0x39, 0x72, 0xCD, 0x83, 0x45}; static uint8_t codecs[1] = {HFP_CODEC_CVSD}; static uint16_t handle = -1; @@ -565,36 +556,6 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } #endif -#define SCO_REPORT_PERIOD 100 -static void send_sco_data(void){ - if (!sco_handle) return; - - const int sco_packet_length = hci_get_sco_packet_length(); - const int sco_payload_length = sco_packet_length - 3; - const int frames_per_packet = sco_payload_length; // for 8-bit data. for 16-bit data it's /2 - - hci_reserve_packet_buffer(); - uint8_t * sco_packet = hci_get_outgoing_packet_buffer(); - // set handle + flags - little_endian_store_16(sco_packet, 0, sco_handle); - // set len - sco_packet[2] = sco_payload_length; - int i; - for (i=0;i= sizeof(sine)) phase = 0; - } - hci_send_sco_packet_buffer(sco_packet_length); - - // request another send event - hci_request_sco_can_send_now_event(); - - static int count = 0; - count++; - if ((count % SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); -} - static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ switch (packet_type){ case HCI_EVENT_PACKET: @@ -606,7 +567,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even inquiry_packet_handler(HCI_EVENT_PACKET, event, event_size); break; case HCI_EVENT_SCO_CAN_SEND_NOW: - send_sco_data(); + sco_demo_send(sco_handle); break; default: break; @@ -680,6 +641,9 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even printf("Event not handled %u\n", event[2]); break; } + case HCI_SCO_DATA_PACKET: + sco_demo_receive(event, event_size); + break; default: break; } @@ -703,6 +667,8 @@ static hfp_phone_number_t subscriber_number = { int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ + sco_demo_init(); + gap_discoverable_control(1); // L2CAP diff --git a/example/hfp_hf_demo.c b/example/hfp_hf_demo.c index 693d07e10..eb5453386 100644 --- a/example/hfp_hf_demo.c +++ b/example/hfp_hf_demo.c @@ -59,20 +59,24 @@ #include #include "btstack.h" +#include "sco_demo_util.h" #ifdef HAVE_POSIX_STDIN #include "stdin_support.h" #endif + uint8_t hfp_service_buffer[150]; const uint8_t rfcomm_channel_nr = 1; const char hfp_hf_service_name[] = "BTstack HFP HF Demo"; #ifdef HAVE_POSIX_STDIN -static bd_addr_t device_addr = {0xD8,0xBb,0x2C,0xDf,0xF1,0x08}; +static bd_addr_t device_addr = {0x80,0xbe,0x05,0xd5,0x28,0x48}; +// 80:BE:05:D5:28:48 // prototypes static void show_usage(void); #endif static uint16_t handle = -1; +static hci_con_handle_t sco_handle; static uint8_t codecs[] = {HFP_CODEC_CVSD, HFP_CODEC_MSBC}; static uint16_t indicators[1] = {0x01}; @@ -445,6 +449,12 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac #endif static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ + + if (event[0] == HCI_EVENT_SCO_CAN_SEND_NOW){ + sco_demo_send(sco_handle); + return; + } + if (event[0] != HCI_EVENT_HFP_META) return; switch (event[2]) { @@ -456,10 +466,18 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even printf("Service level connection released.\n\n"); break; case HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED: - printf("\n** Audio connection established **\n"); + if (hfp_subevent_audio_connection_established_get_status(event)){ + sco_handle = 0; + printf("Audio connection establishment failed with status %u\n", hfp_subevent_audio_connection_established_get_status(event)); + } else { + sco_handle = hfp_subevent_audio_connection_established_get_handle(event); + printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); + hci_request_sco_can_send_now_event(); + } break; case HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED: - printf("\n** Audio connection released **\n"); + sco_handle = 0; + printf("Audio connection released\n"); break; case HFP_SUBEVENT_COMPLETE: switch (cmd){ @@ -512,6 +530,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even /* LISTING_START(MainConfiguration): Setup HFP Hands-Free unit */ int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ + + sco_demo_init(); + + gap_discoverable_control(1); + // HFP AG address is hardcoded, please change it // init L2CAP l2cap_init(); @@ -524,6 +547,7 @@ int btstack_main(int argc, const char * argv[]){ hfp_hf_init_codecs(sizeof(codecs), codecs); hfp_hf_register_packet_handler(packet_handler); + hci_register_sco_packet_handler(&packet_handler); memset(hfp_service_buffer, 0, sizeof(hfp_service_buffer)); hfp_hf_create_sdp_record(hfp_service_buffer, 0x10001, rfcomm_channel_nr, hfp_hf_service_name, 0); diff --git a/example/hsp_ag_demo.c b/example/hsp_ag_demo.c index e6fe0ac31..da1fb078f 100644 --- a/example/hsp_ag_demo.c +++ b/example/hsp_ag_demo.c @@ -59,12 +59,11 @@ #include #include "btstack.h" +#include "sco_demo_util.h" #ifdef HAVE_POSIX_STDIN #include "stdin_support.h" #endif -#define SCO_REPORT_PERIOD 255 - static uint8_t hsp_service_buffer[150]; static const uint8_t rfcomm_channel_nr = 1; static const char hsp_ag_service_name[] = "Audio Gateway Test"; @@ -74,17 +73,6 @@ static char hs_cmd_buffer[100]; static bd_addr_t device_addr = {0x00,0x1b,0xDC,0x07,0x32,0xEF}; -static int phase = 0; - -// input signal: pre-computed sine wave, 160 Hz -static const uint8_t sine[] = { - 0, 15, 31, 46, 61, 74, 86, 97, 107, 114, - 120, 124, 126, 126, 124, 120, 114, 107, 97, 86, - 74, 61, 46, 31, 15, 0, 241, 225, 210, 195, - 182, 170, 159, 149, 142, 136, 132, 130, 130, 132, - 136, 142, 149, 159, 170, 182, 195, 210, 225, 241, -}; - /* @section Audio Transfer Setup * * @text A pre-computed sine wave (160Hz) is used as the input audio signal. 160 Hz. @@ -190,44 +178,12 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } #endif -static void send_sco_data(void){ - if (!sco_handle) return; - - const int sco_packet_length = hci_get_sco_packet_length(); - const int sco_payload_length = sco_packet_length - 3; - const int frames_per_packet = sco_payload_length; // for 8-bit data. for 16-bit data it's /2 - - hci_reserve_packet_buffer(); - uint8_t * sco_packet = hci_get_outgoing_packet_buffer(); - // set handle + flags - little_endian_store_16(sco_packet, 0, sco_handle); - // set len - sco_packet[2] = sco_payload_length; - int i; - for (i=0;i= sizeof(sine)) phase = 0; - } - hci_send_sco_packet_buffer(sco_packet_length); - - // request another send event - hci_request_sco_can_send_now_event(); - - static int count = 0; - if ((count % SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); -} - static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ - static int count = 0; - switch (packet_type){ case HCI_SCO_DATA_PACKET: - count++; - if ((count & SCO_REPORT_PERIOD)) return; - printf("SCO packets received: %u\n", count); + sco_demo_receive(event, event_size); break; case HCI_EVENT_PACKET: @@ -237,7 +193,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even show_usage(); break; case HCI_EVENT_SCO_CAN_SEND_NOW: - send_sco_data(); + sco_demo_send(sco_handle); break; case HCI_EVENT_HSP_META: switch (event[2]) { @@ -319,6 +275,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ + sco_demo_init(); + l2cap_init(); sdp_init(); diff --git a/example/hsp_hs_demo.c b/example/hsp_hs_demo.c index 81aae70fe..4d870f4d0 100644 --- a/example/hsp_hs_demo.c +++ b/example/hsp_hs_demo.c @@ -59,12 +59,11 @@ #include #include "btstack.h" +#include "sco_demo_util.h" #ifdef HAVE_POSIX_STDIN #include "stdin_support.h" #endif -#define SCO_REPORT_PERIOD 255 - static btstack_packet_callback_registration_t hci_event_callback_registration; static uint8_t hsp_service_buffer[150]; @@ -75,17 +74,6 @@ static hci_con_handle_t sco_handle = 0; static char hs_cmd_buffer[100]; static bd_addr_t device_addr = {0x00,0x1b,0xDC,0x07,0x32,0xEF}; -static int phase = 0; - -// input signal: pre-computed sine wave, 160 Hz -static const uint8_t sine[] = { - 0, 15, 31, 46, 61, 74, 86, 97, 107, 114, - 120, 124, 126, 126, 124, 120, 114, 107, 97, 86, - 74, 61, 46, 31, 15, 0, 241, 225, 210, 195, - 182, 170, 159, 149, 142, 136, 132, 130, 130, 132, - 136, 142, 149, 159, 170, 182, 195, 210, 225, 241, -}; - /* @section Audio Transfer Setup * * @text A pre-computed sine wave (160Hz) is used as the input audio signal. 160 Hz. @@ -190,42 +178,10 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac } #endif -static void send_sco_data(void){ - if (!sco_handle) return; - - const int sco_packet_length = hci_get_sco_packet_length(); - const int sco_payload_length = sco_packet_length - 3; - const int frames_per_packet = sco_payload_length; // for 8-bit data. for 16-bit data it's /2 - - hci_reserve_packet_buffer(); - uint8_t * sco_packet = hci_get_outgoing_packet_buffer(); - // set handle + flags - little_endian_store_16(sco_packet, 0, sco_handle); - // set len - sco_packet[2] = sco_payload_length; - int i; - for (i=0;i= sizeof(sine)) phase = 0; - } - hci_send_sco_packet_buffer(sco_packet_length); - - // request another send event - hci_request_sco_can_send_now_event(); - - static int count = 0; - count++; - if ((count % SCO_REPORT_PERIOD) == 0) printf("Sent %u\n", count); -} - static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ - static int sco_rev_count = 0; switch (packet_type){ case HCI_SCO_DATA_PACKET: - sco_rev_count++; - if ((sco_rev_count & SCO_REPORT_PERIOD)) break; - printf("SCO packets received: %u\n", sco_rev_count); + sco_demo_receive(event, event_size); break; case HCI_EVENT_PACKET: switch (event[0]) { @@ -234,7 +190,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even show_usage(); break; case HCI_EVENT_SCO_CAN_SEND_NOW: - send_sco_data(); + sco_demo_send(sco_handle); break; case HCI_EVENT_HSP_META: switch (event[2]) { @@ -321,6 +277,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ + sco_demo_init(); + // register for HCI events hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); diff --git a/port/libusb/Makefile b/port/libusb/Makefile index a56e8c3a9..340f8f02c 100644 --- a/port/libusb/Makefile +++ b/port/libusb/Makefile @@ -28,4 +28,11 @@ CFLAGS += $(shell pkg-config libusb-1.0 --cflags) LDFLAGS += $(shell pkg-config libusb-1.0 --libs) endif +# use pkg-config for portaudio +# CFLAGS += $(shell pkg-config portaudio-2.0 --cflags) -DHAVE_PORTAUDIO +# LDFLAGS += $(shell pkg-config portaudio-2.0 --libs) +# hard coded flags for portaudio in /usr/local/lib +# CFLAGS += -I/usr/local/include -DHAVE_PORTAUDIO +# LDFLAGS += -L/sw/lib -lportaudio -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,Carbon + all: ${EXAMPLES} diff --git a/port/posix-h4/Makefile b/port/posix-h4/Makefile index 9002a15ad..d407713c3 100644 --- a/port/posix-h4/Makefile +++ b/port/posix-h4/Makefile @@ -2,7 +2,6 @@ BTSTACK_ROOT = ../.. CORE += \ - bluetooth_init_cc2564B_1.4_BT_Spec_4.1.c \ btstack_chipset_cc256x.c \ btstack_chipset_csr.c \ btstack_chipset_em9301.c \ @@ -14,6 +13,8 @@ CORE += \ hci_transport_h4.c \ main.c \ stdin_support.c \ + bluetooth_init_cc2564B_1.4_BT_Spec_4.1.c \ +# bluetooth_init_cc2564_2.14.c \ # btstack_chipset_bcm.c \ # TI-WL183x requires TIInit_11.8.32.c @@ -53,4 +54,11 @@ ifneq ($(OS),Windows_NT) EXAMPLES += ${EXAMPLES_CLI} endif +# use pkg-config for portaudio +# CFLAGS += $(shell pkg-config portaudio-2.0 --cflags) -DHAVE_PORTAUDIO +# LDFLAGS += $(shell pkg-config portaudio-2.0 --libs) +# hard coded flags for portaudio in /usr/local/lib +# CFLAGS += -I/usr/local/include -DHAVE_PORTAUDIO +# LDFLAGS += -L/sw/lib -lportaudio -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,Carbon + all: ${EXAMPLES} diff --git a/port/posix-h5/Makefile b/port/posix-h5/Makefile index b335fd85a..dab67446d 100644 --- a/port/posix-h5/Makefile +++ b/port/posix-h5/Makefile @@ -54,4 +54,11 @@ ifneq ($(OS),Windows_NT) EXAMPLES += ${EXAMPLES_CLI} endif +# use pkg-config for portaudio +# CFLAGS += $(shell pkg-config portaudio-2.0 --cflags) -DHAVE_PORTAUDIO +# LDFLAGS += $(shell pkg-config portaudio-2.0 --libs) +# hard coded flags for portaudio in /usr/local/lib +# CFLAGS += -I/usr/local/include -DHAVE_PORTAUDIO +# LDFLAGS += -L/sw/lib -lportaudio -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,Carbon + all: ${EXAMPLES} From f7c85330b9f3d4bd7d09de78eedacfe6f41e7561 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 23 May 2016 18:04:57 +0200 Subject: [PATCH 67/74] example/hsp+hfp: extract SCO test code into sco_demo_util --- example/sco_demo_util.c | 219 ++++++++++++++++++++++++++++++++++++++++ example/sco_demo_util.h | 72 +++++++++++++ 2 files changed, 291 insertions(+) create mode 100644 example/sco_demo_util.c create mode 100644 example/sco_demo_util.h diff --git a/example/sco_demo_util.c b/example/sco_demo_util.c new file mode 100644 index 000000000..d80edc21c --- /dev/null +++ b/example/sco_demo_util.c @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2016 BlueKitchen GmbH + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holders nor the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * 4. Any redistribution, use, or modification is done solely for + * personal benefit and not for any commercial purpose or for + * monetary gain. + * + * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS + * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Please inquire about commercial licensing options at + * contact@bluekitchen-gmbh.com + * + */ + +/* + * sco_demo_util.c - send/receive test data via SCO, used by hfp_*_demo and hsp_*_demo + */ + +#include "sco_demo_util.h" +#include + +// configure test mode +#define SCO_DEMO_MODE_SINE 0 +#define SCO_DEMO_MODE_ASCII 1 +#define SCO_DEMO_MODE_COUNTER 2 + +// SCO demo configuration +#define SCO_DEMO_MODE SCO_DEMO_MODE_SINE +#define SCO_REPORT_PERIOD 100 + +// portaudio config +#define NUM_CHANNELS 1 +#define SAMPLE_RATE 8000 +#define FRAMES_PER_BUFFER 24 +#define PA_SAMPLE_TYPE paInt8 + +#if defined(HAVE_PORTAUDIO) && (SCO_DEMO_MODE == SCO_DEMO_MODE_SINE) +#define USE_PORTAUDIO +#endif + + +#ifdef USE_PORTAUDIO +#include +// portaudio globals +static PaStream * stream; +#endif + +#if SCO_DEMO_MODE == SCO_DEMO_MODE_SINE +// input signal: pre-computed sine wave, 160 Hz +static const uint8_t sine[] = { + 0, 15, 31, 46, 61, 74, 86, 97, 107, 114, + 120, 124, 126, 126, 124, 120, 114, 107, 97, 86, + 74, 61, 46, 31, 15, 0, 241, 225, 210, 195, + 182, 170, 159, 149, 142, 136, 132, 130, 130, 132, + 136, 142, 149, 159, 170, 182, 195, 210, 225, 241, +}; +#endif + +static int phase; + +void sco_demo_init(void){ + + // status +#if SCO_DEMO_MODE == SCO_DEMO_MODE_SINE +#ifdef HAVE_PORTAUDIO + printf("SCO Demo: Sending sine wave, audio output via portaudio.\n"); +#else + printf("SCO Demo: Sending sine wave, hexdump received data.\n"); +#endif +#endif +#if SCO_DEMO_MODE == SCO_DEMO_MODE_ASCII + printf("SCO Demo: Sending ASCII blocks, print received data.\n"); +#endif +#if SCO_DEMO_MODE == SCO_DEMO_MODE_COUNTER + printf("SCO Demo: Sending counter value, hexdump received data.\n"); +#endif + +#ifdef USE_PORTAUDIO + int err; + PaStreamParameters outputParameters; + + /* -- initialize PortAudio -- */ + err = Pa_Initialize(); + if( err != paNoError ) return; + /* -- setup input and output -- */ + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = NUM_CHANNELS; + outputParameters.sampleFormat = PA_SAMPLE_TYPE; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + /* -- setup stream -- */ + err = Pa_OpenStream( + &stream, + NULL, // &inputParameters, + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) return; + /* -- start stream -- */ + err = Pa_StartStream( stream ); + if( err != paNoError ) return; +#endif + +#if SCO_DEMO_MODE != SCO_DEMO_MODE_SINE + hci_set_sco_voice_setting(0x03); // linear, unsigned, 8-bit, transparent +#endif + +#if SCO_DEMO_MODE == SCO_DEMO_MODE_ASCII + phase = 'a'; +#endif +} + + +void sco_demo_send(hci_con_handle_t sco_handle){ + + if (!sco_handle) return; + + const int sco_packet_length = 24 + 3; // hci_get_sco_packet_length(); + const int sco_payload_length = sco_packet_length - 3; + + hci_reserve_packet_buffer(); + uint8_t * sco_packet = hci_get_outgoing_packet_buffer(); + // set handle + flags + little_endian_store_16(sco_packet, 0, sco_handle); + // set len + sco_packet[2] = sco_payload_length; + const int frames_per_packet = sco_payload_length; // for 8-bit data. for 16-bit data it's /2 + +#if SCO_DEMO_MODE == SCO_DEMO_MODE_SINE + int i; + for (i=0;i= sizeof(sine)) phase = 0; + } +#else +#if SCO_DEMO_MODE == SCO_DEMO_MODE_ASCII + memset(&sco_packet[3], phase++, frames_per_packet); + if (phase > 'z') phase = 'a'; +#else + for (i=0;i> 4); + printf_hexdump(&packet[3], size-3); + return; + } + +#if SCO_DEMO_MODE == SCO_DEMO_MODE_SINE +#ifdef USE_PORTAUDIO + uint32_t start = btstack_run_loop_get_time_ms(); + Pa_WriteStream( stream, &packet[3], size -3); + uint32_t end = btstack_run_loop_get_time_ms(); + if (end - start > 5){ + printf("Portaudio: write stream took %u ms\n", end - start); + } +#else + printf_hexdump(&packet[3], size-3); +#endif +#else + printf("data: "); +#if SCO_DEMO_MODE == SCO_DEMO_MODE_ASCII + int i; + for (i=3;i Date: Wed, 25 May 2016 11:15:56 +0200 Subject: [PATCH 68/74] nrf5x: support scan window/interval, pick random channel per scan interval, fix line endings --- port/nrf5x/main.c | 1175 ++++++++++++++++++++++++--------------------- 1 file changed, 625 insertions(+), 550 deletions(-) diff --git a/port/nrf5x/main.c b/port/nrf5x/main.c index b74a22b6b..eadec3e8a 100755 --- a/port/nrf5x/main.c +++ b/port/nrf5x/main.c @@ -1,550 +1,625 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -/** - * BTstack Link Layer implementation - */ - -#include -#include -#include -#include - -#include "app_uart.h" -#include "app_error.h" -#include "nrf_delay.h" -#include "nrf.h" -#include "bsp.h" - -#include "btstack_config.h" -#include "btstack_memory.h" -#include "btstack_run_loop.h" -#include "btstack_run_loop_embedded.h" -#include "hci_transport.h" -#include "hci_dump.h" -#include "hal_cpu.h" -#include "hal_time_ms.h" - -// bluetooth.h -#define ADVERTISING_RADIO_ACCESS_ADDRESS 0x8E89BED6 -#define ADVERTISING_CRC_INIT 0x555555 - -typedef enum { - LL_STATE_STANDBY, - LL_STATE_SCANNING, - LL_STATE_ADVERTISING, - LL_STATE_INITIATING, - LL_STATE_CONNECTED -} ll_state_t; - -// from SDK UART exzmple -#define UART_TX_BUF_SIZE 128 /**< UART TX buffer size. */ -#define UART_RX_BUF_SIZE 1 /**< UART RX buffer size. */ - -// packet receive buffer -#define MAXLEN 255 -static uint8_t rx_adv_buffer[2 + MAXLEN]; - -// hci transport -static void (*packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size); -static hci_transport_t hci_transport; -static uint8_t hci_outgoing_event[258]; -static volatile uint8_t hci_outgoing_event_ready; -static volatile uint8_t hci_outgoing_event_free; -static btstack_data_source_t hci_transport_data_source; - -// Link Layer State -static ll_state_t ll_state; -static uint32_t ll_scan_interval_us; -static uint32_t ll_scan_window_us; - - -void uart_error_handle(app_uart_evt_t * p_event) -{ - if (p_event->evt_type == APP_UART_COMMUNICATION_ERROR) - { - APP_ERROR_HANDLER(p_event->data.error_communication); - } - else if (p_event->evt_type == APP_UART_FIFO_ERROR) - { - APP_ERROR_HANDLER(p_event->data.error_code); - } -} - -static void init_timer(void) { - -#if 1 - // start high frequency clock source if not done yet - if ( !NRF_CLOCK->EVENTS_HFCLKSTARTED ) { - printf("1\n"); - NRF_CLOCK->TASKS_HFCLKSTART = 1; - while ( !NRF_CLOCK->EVENTS_HFCLKSTARTED ){ - // just wait - } - } -#endif - - NRF_TIMER0->MODE = TIMER_MODE_MODE_Timer << TIMER_MODE_MODE_Pos; - NRF_TIMER0->BITMODE = TIMER_BITMODE_BITMODE_32Bit; - NRF_TIMER0->PRESCALER = 4; // 16 Mhz / (2 ^ 4) = 1 Mhz == 1 us - - NRF_TIMER0->TASKS_STOP = 1; - NRF_TIMER0->TASKS_CLEAR = 1; -#if 0 - NRF_TIMER0->EVENTS_COMPARE[ 0 ] = 0; - NRF_TIMER0->EVENTS_COMPARE[ 1 ] = 0; - NRF_TIMER0->EVENTS_COMPARE[ 2 ] = 0; - NRF_TIMER0->EVENTS_COMPARE[ 3 ] = 0; - NRF_TIMER0->INTENCLR = 0xffffffff; -#endif - NRF_TIMER0->TASKS_START = 1; -} - -static void radio_set_access_address(uint32_t access_address) { - NRF_RADIO->BASE0 = ( access_address << 8 ) & 0xFFFFFF00; - NRF_RADIO->PREFIX0 = ( access_address >> 24 ) & RADIO_PREFIX0_AP0_Msk; -} - -static void radio_set_crc_init(uint32_t crc_init){ - NRF_RADIO->CRCINIT = crc_init; -} - -// look up RF Center Frequency for data channels 0..36 and advertising channels 37..39 -static uint8_t radio_frequency_for_channel(uint8_t channel){ - if (channel <= 10){ - return 4 + 2 * channel; - } - if (channel <= 36){ - return 6 + 2 * channel; - } - if (channel == 37){ - return 2; - } - if (channel == 38){ - return 26; - } - return 80; -} - -static void radio_init(void){ - -#ifdef NRF51 - // Handle BLE Radio tuning parameters from production if required. - // Does not exist on NRF52 - // See PCN-083. - if (NRF_FICR->OVERRIDEEN & FICR_OVERRIDEEN_BLE_1MBIT_Msk){ - NRF_RADIO->OVERRIDE0 = NRF_FICR->BLE_1MBIT[0]; - NRF_RADIO->OVERRIDE1 = NRF_FICR->BLE_1MBIT[1]; - NRF_RADIO->OVERRIDE2 = NRF_FICR->BLE_1MBIT[2]; - NRF_RADIO->OVERRIDE3 = NRF_FICR->BLE_1MBIT[3]; - NRF_RADIO->OVERRIDE4 = NRF_FICR->BLE_1MBIT[4] | 0x80000000; - } -#endif // NRF51 - - // Mode: BLE 1 Mbps - NRF_RADIO->MODE = RADIO_MODE_MODE_Ble_1Mbit << RADIO_MODE_MODE_Pos; - - // PacketConfig 0: - // --- - // LENGTH field in bits = 8 - // S0 field in bytes = 1 - // S1 field not used - // 8 bit preamble - NRF_RADIO->PCNF0 = - ( 8 << RADIO_PCNF0_LFLEN_Pos ) | - ( 1 << RADIO_PCNF0_S0LEN_Pos ) | - ( 0 << RADIO_PCNF0_S1LEN_Pos ); - - // PacketConfig 1: - // --- - // Payload MAXLEN = MAXLEN - // No additional bytes - // 4 address bytes (1 + 3) - // S0, LENGTH, S1, PAYLOAD in little endian - // Packet whitening enabled - NRF_RADIO->PCNF1 = - ( MAXLEN << RADIO_PCNF1_MAXLEN_Pos) | - ( 0 << RADIO_PCNF1_STATLEN_Pos ) | - ( 3 << RADIO_PCNF1_BALEN_Pos ) | - ( RADIO_PCNF1_ENDIAN_Little << RADIO_PCNF1_ENDIAN_Pos ) | - ( RADIO_PCNF1_WHITEEN_Enabled << RADIO_PCNF1_WHITEEN_Pos ); - - // Use logical address 0 for sending and receiving - NRF_RADIO->TXADDRESS = 0; - NRF_RADIO->RXADDRESSES = 1 << 0; - - // 24 bit CRC, skip address field - NRF_RADIO->CRCCNF = - ( RADIO_CRCCNF_SKIPADDR_Skip << RADIO_CRCCNF_SKIPADDR_Pos ) | - ( RADIO_CRCCNF_LEN_Three << RADIO_CRCCNF_LEN_Pos ); - - // The polynomial has the form of x^24 +x^10 +x^9 +x^6 +x^4 +x^3 +x+1 - NRF_RADIO->CRCPOLY = 0x100065B; - - // Inter frame spacing 150 us - NRF_RADIO->TIFS = 150; - - // Shorts: - // - READY->START - // - ADDRESS0>RSSISTART - NRF_RADIO->SHORTS = RADIO_SHORTS_READY_START_Enabled << RADIO_SHORTS_READY_START_Pos - | RADIO_SHORTS_ADDRESS_RSSISTART_Enabled << RADIO_SHORTS_ADDRESS_RSSISTART_Pos; - - // Disable all interrrupts - NRF_RADIO->INTENCLR = 0xffffffff; -} - - -void radio_dump_state(void){ - printf("Radio state: %lx\n", NRF_RADIO->STATE); -} - -// static -void radio_receive_on_channel(int channel){ - // set frequency based on channel - NRF_RADIO->FREQUENCY = radio_frequency_for_channel( channel ); - - // initializes data whitening with channel index - NRF_RADIO->DATAWHITEIV = channel & 0x3F; - - // set receive buffer - NRF_RADIO->PACKETPTR = (uintptr_t) rx_adv_buffer; - - // set MAXLEN based on receive buffer size - NRF_RADIO->PCNF1 = ( NRF_RADIO->PCNF1 & ~RADIO_PCNF1_MAXLEN_Msk ) | ( MAXLEN << RADIO_PCNF1_MAXLEN_Pos ); - - // clear events - NRF_RADIO->EVENTS_END = 0; - NRF_RADIO->EVENTS_DISABLED = 0; - NRF_RADIO->EVENTS_READY = 0; - NRF_RADIO->EVENTS_ADDRESS = 0; - - radio_set_access_address(ADVERTISING_RADIO_ACCESS_ADDRESS); - radio_set_crc_init(ADVERTISING_CRC_INIT); - - // ramp up receiver - NRF_RADIO->TASKS_RXEN = 1; - - // enable IRQ for END event - NRF_RADIO->INTENSET = RADIO_INTENSET_END_Enabled << RADIO_INTENSET_END_Pos; -} - -// static -void radio_disable(void){ - // testing - NRF_RADIO->TASKS_DISABLE = 1; - - // wait for ready - while (!NRF_RADIO->EVENTS_DISABLED) { - // just wait - } -} - -// static -void radio_dump_packet(void){ - // print data - int len = rx_adv_buffer[1] & 0x3f; - int i; - for (i=0;iEVENTS_END = 0; - - if (ll_state == LL_STATE_SCANNING){ - - // check if outgoing buffer available and if CRC was ok - if (hci_outgoing_event_free && - ((NRF_RADIO->CRCSTATUS & RADIO_CRCSTATUS_CRCSTATUS_Msk) == (RADIO_CRCSTATUS_CRCSTATUS_CRCOk << RADIO_CRCSTATUS_CRCSTATUS_Pos))){ - hci_outgoing_event_free = 0; - int len = rx_adv_buffer[1] & 0x3f; - hci_outgoing_event[0] = HCI_EVENT_LE_META; - hci_outgoing_event[1] = 11 + len - 6; - hci_outgoing_event[2] = HCI_SUBEVENT_LE_ADVERTISING_REPORT; - hci_outgoing_event[3] = 1; - hci_outgoing_event[4] = rx_adv_buffer[0] & 0x0f; - hci_outgoing_event[5] = (rx_adv_buffer[0] & 0x40) ? 1 : 0; - memcpy(&hci_outgoing_event[6], &rx_adv_buffer[2], 6); - hci_outgoing_event[12] = len - 6; // rest after bd addr - memcpy(&hci_outgoing_event[13], &rx_adv_buffer[8], len - 6); - hci_outgoing_event[13 + len - 6] = -NRF_RADIO->RSSISAMPLE; // RSSI is stored without sign but is negative - hci_outgoing_event_ready = 1; - } else { - // ... for now, we just throw the adv away and try to receive the next one - } - } - // restart receiving - NRF_RADIO->TASKS_START = 1; -} - -static uint8_t random_generator_next(void){ - NRF_RNG->SHORTS = RNG_SHORTS_VALRDY_STOP_Enabled << RNG_SHORTS_VALRDY_STOP_Pos; - NRF_RNG->TASKS_START = 1; - while (!NRF_RNG->EVENTS_VALRDY){ - } - return NRF_RNG->VALUE; -} - -static uint32_t get_time_us(void){ - NRF_TIMER0->TASKS_CAPTURE[0] = 1; - return NRF_TIMER0->CC[0]; -} - -// static -void tick(void){ - uint32_t now = 0; - while (1){ - uint8_t random = random_generator_next(); - printf("Tick %02x\n", random); - now = get_time_us(); - uint32_t tick_at = now + 1000000; - while (now < tick_at){ - now = get_time_us(); - } - } -} - -// static -void ll_set_scan_params(uint8_t le_scan_type, uint16_t le_scan_interval, uint16_t le_scan_window, uint8_t own_address_type, uint8_t scanning_filter_policy){ - // TODO .. store other params - ll_scan_interval_us = ((uint32_t) le_scan_interval) * 625; - ll_scan_window_us = ((uint32_t) le_scan_window) * 625; -} - -static uint8_t ll_start_scanning(uint8_t filter_duplicates){ - // COMMAND DISALLOWED if wrong state. - if (ll_state != LL_STATE_STANDBY) return 0x0c; - - ll_state = LL_STATE_SCANNING; - - // reset timer - NRF_TIMER0->TASKS_CLEAR; - - // set timer to disable radio after end of scan_window - - // set timer to trigger IRQ for next scan interval - - // start receive - // .. - - // TODO: use all channels - radio_receive_on_channel(37); - - return 0; -} - -static uint8_t ll_stop_scanning(void){ - // COMMAND DISALLOWED if wrong state. - if (ll_state != LL_STATE_SCANNING) return 0x0c; - - ll_state = LL_STATE_STANDBY; - - // stop radio - radio_disable(); - - return 0; -} - -// static -uint8_t ll_set_scan_enable(uint8_t le_scan_enable, uint8_t filter_duplicates){ - if (le_scan_enable){ - return ll_start_scanning(filter_duplicates); - } else { - return ll_stop_scanning(); - } -} - -static void transport_run(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type){ - // deliver hci packet on main thread - if (hci_outgoing_event_ready){ - hci_outgoing_event_ready = 0; - packet_handler(HCI_EVENT_PACKET, hci_outgoing_event, hci_outgoing_event[1]+2); - hci_outgoing_event_free = 1; - return 0; - } - return 0; -} - -/** - * init transport - * @param transport_config - */ -void transport_init(const void *transport_config){ - -} - -/** - * open transport connection - */ -static int transport_open(void){ - btstack_run_loop_set_data_source_handler(&hci_transport_data_source, &transport_run); - btstack_run_loop_enable_data_source_callbacks(&hci_transport_data_source, DATA_SOURCE_CALLBACK_POLL); - btstack_run_loop_add_data_source(&hci_transport_data_source); - return 0; -} - -/** - * close transport connection - */ -static int transport_close(void){ - btstack_run_loop_remove_data_source(&hci_transport_data_source); - return 0; -} - -/** - * register packet handler for HCI packets: ACL, SCO, and Events - */ -static void transport_register_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)){ - packet_handler = handler; -} - -// /** -// * support async transport layers, e.g. IRQ driven without buffers -// */ -// int transport_can_send_packet_now(uint8_t packet_type){ -// return 1; -// } - -// TODO: implement -void hal_cpu_disable_irqs(void){} -void hal_cpu_enable_irqs(void){} -void hal_cpu_enable_irqs_and_sleep(void){} - - -// TODO: get time from RTC -uint32_t hal_time_ms(void){ - return 999; -} - -static void fake_command_complete(uint16_t opcode){ - hci_outgoing_event[0] = HCI_EVENT_COMMAND_COMPLETE; - hci_outgoing_event[1] = 4; - hci_outgoing_event[2] = 1; - little_endian_store_16(hci_outgoing_event, 3, opcode); - hci_outgoing_event[5] = 0; - hci_outgoing_event_ready = 1; -} - -int transport_send_packet(uint8_t packet_type, uint8_t *packet, int size){ - // process packet - uint16_t opcode = little_endian_read_16(packet, 0); - if (opcode == hci_reset.opcode) { - fake_command_complete(opcode); - return 0; - } - if (opcode == hci_le_set_scan_enable.opcode){ - ll_set_scan_enable(packet[3], packet[4]); - fake_command_complete(opcode); - return 0; - } - // try with "OK" - printf("CMD opcode %02x not handled yet\n", opcode); - fake_command_complete(opcode); - return 0; -} - -int btstack_main(void); - -/** - * @brief Function for main application entry. - */ -int main(void) -{ - - LEDS_CONFIGURE(LEDS_MASK); - LEDS_OFF(LEDS_MASK); - uint32_t err_code; - const app_uart_comm_params_t comm_params = { - RX_PIN_NUMBER, - TX_PIN_NUMBER, - RTS_PIN_NUMBER, - CTS_PIN_NUMBER, - APP_UART_FLOW_CONTROL_ENABLED, - false, - UART_BAUDRATE_BAUDRATE_Baud115200 - }; - - APP_UART_FIFO_INIT(&comm_params, - UART_RX_BUF_SIZE, - UART_TX_BUF_SIZE, - uart_error_handle, - APP_IRQ_PRIORITY_LOW, - err_code); - - APP_ERROR_CHECK(err_code); - - init_timer(); - radio_init(); - hci_outgoing_event_free = 1; - - // enable Radio IRQs - NVIC_SetPriority( RADIO_IRQn, 0 ); - NVIC_ClearPendingIRQ( RADIO_IRQn ); - NVIC_EnableIRQ( RADIO_IRQn ); - - // Bring up BTstack - - printf("BTstack on Nordic nRF5 SDK\n"); - - btstack_memory_init(); - btstack_run_loop_init(btstack_run_loop_embedded_get_instance()); - - // setup hci transport wrapper - hci_transport.name = "nRF5"; - hci_transport.init = transport_init; - hci_transport.open = transport_open; - hci_transport.close = transport_close; - hci_transport.register_packet_handler = transport_register_packet_handler; - hci_transport.can_send_packet_now = NULL; - hci_transport.send_packet = transport_send_packet; - hci_transport.set_baudrate = NULL; - - // init HCI - hci_init(&hci_transport, NULL); - - // enable full log output while porting - hci_dump_open(NULL, HCI_DUMP_STDOUT); - - // hand over to btstack embedded code - btstack_main(); - - // go - btstack_run_loop_execute(); - - while (1){}; - -#if 0 - - // start listening - radio_receive_on_channel(37); - - while (1){ - if (NRF_RADIO->EVENTS_END){ - NRF_RADIO->EVENTS_END = 0; - // process packet - radio_dump_packet(); - // receive next packet - NRF_RADIO->TASKS_START = 1; - } - } - - radio_disable(); -#endif -} - - -/** @} */ +/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. + * + * The information contained herein is property of Nordic Semiconductor ASA. + * Terms and conditions of usage are described in detail in NORDIC + * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. + * + * Licensees are granted free, non-transferable use of the information. NO + * WARRANTY of ANY KIND is provided. This heading must NOT be removed from + * the file. + * + */ + +/** + * BTstack Link Layer implementation + */ + +#include +#include +#include +#include + +#include "app_uart.h" +#include "app_error.h" +#include "nrf_delay.h" +#include "nrf.h" +#include "bsp.h" + +#include "btstack_config.h" +#include "btstack_debug.h" +#include "btstack_memory.h" +#include "btstack_run_loop.h" +#include "btstack_run_loop_embedded.h" +#include "hci_transport.h" +#include "hci_dump.h" +#include "hal_cpu.h" +#include "hal_time_ms.h" + +// bluetooth.h +#define ADVERTISING_RADIO_ACCESS_ADDRESS 0x8E89BED6 +#define ADVERTISING_CRC_INIT 0x555555 + +// HCI CMD OGF/OCF +#define READ_CMD_OGF(buffer) (buffer[1] >> 2) +#define READ_CMD_OCF(buffer) ((buffer[1] & 0x03) << 8 | buffer[0]) + +typedef enum { + LL_STATE_STANDBY, + LL_STATE_SCANNING, + LL_STATE_ADVERTISING, + LL_STATE_INITIATING, + LL_STATE_CONNECTED +} ll_state_t; + +// from SDK UART exzmple +#define UART_TX_BUF_SIZE 128 /**< UART TX buffer size. */ +#define UART_RX_BUF_SIZE 1 /**< UART RX buffer size. */ + +// packet receive buffer +#define MAXLEN 255 +static uint8_t rx_adv_buffer[2 + MAXLEN]; + +// hci transport +static void (*packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size); +static hci_transport_t hci_transport; +static uint8_t hci_outgoing_event[258]; +static volatile uint8_t hci_outgoing_event_ready; +static volatile uint8_t hci_outgoing_event_free; +static btstack_data_source_t hci_transport_data_source; + +// Link Layer State +static ll_state_t ll_state; +static uint32_t ll_scan_interval_us; +static uint32_t ll_scan_window_us; + + +void uart_error_handle(app_uart_evt_t * p_event) +{ + if (p_event->evt_type == APP_UART_COMMUNICATION_ERROR) + { + APP_ERROR_HANDLER(p_event->data.error_communication); + } + else if (p_event->evt_type == APP_UART_FIFO_ERROR) + { + APP_ERROR_HANDLER(p_event->data.error_code); + } +} + +static void init_timer(void) { + +#if 1 + // start high frequency clock source if not done yet + if ( !NRF_CLOCK->EVENTS_HFCLKSTARTED ) { + NRF_CLOCK->TASKS_HFCLKSTART = 1; + while ( !NRF_CLOCK->EVENTS_HFCLKSTARTED ){ + // just wait + } + } +#endif + + NRF_TIMER0->MODE = TIMER_MODE_MODE_Timer << TIMER_MODE_MODE_Pos; + NRF_TIMER0->BITMODE = TIMER_BITMODE_BITMODE_32Bit; + NRF_TIMER0->PRESCALER = 4; // 16 Mhz / (2 ^ 4) = 1 Mhz == 1 us + + NRF_TIMER0->TASKS_STOP = 1; + NRF_TIMER0->TASKS_CLEAR = 1; + NRF_TIMER0->EVENTS_COMPARE[0] = 0; + NRF_TIMER0->EVENTS_COMPARE[1] = 0; + NRF_TIMER0->EVENTS_COMPARE[2] = 0; + NRF_TIMER0->EVENTS_COMPARE[3] = 0; + NRF_TIMER0->INTENCLR = 0xffffffff; + NRF_TIMER0->TASKS_START = 1; +} + +static void radio_set_access_address(uint32_t access_address) { + NRF_RADIO->BASE0 = ( access_address << 8 ) & 0xFFFFFF00; + NRF_RADIO->PREFIX0 = ( access_address >> 24 ) & RADIO_PREFIX0_AP0_Msk; +} + +static void radio_set_crc_init(uint32_t crc_init){ + NRF_RADIO->CRCINIT = crc_init; +} + +// look up RF Center Frequency for data channels 0..36 and advertising channels 37..39 +static uint8_t radio_frequency_for_channel(uint8_t channel){ + if (channel <= 10){ + return 4 + 2 * channel; + } + if (channel <= 36){ + return 6 + 2 * channel; + } + if (channel == 37){ + return 2; + } + if (channel == 38){ + return 26; + } + return 80; +} + +static void radio_init(void){ + +#ifdef NRF51 + // Handle BLE Radio tuning parameters from production if required. + // Does not exist on NRF52 + // See PCN-083. + if (NRF_FICR->OVERRIDEEN & FICR_OVERRIDEEN_BLE_1MBIT_Msk){ + NRF_RADIO->OVERRIDE0 = NRF_FICR->BLE_1MBIT[0]; + NRF_RADIO->OVERRIDE1 = NRF_FICR->BLE_1MBIT[1]; + NRF_RADIO->OVERRIDE2 = NRF_FICR->BLE_1MBIT[2]; + NRF_RADIO->OVERRIDE3 = NRF_FICR->BLE_1MBIT[3]; + NRF_RADIO->OVERRIDE4 = NRF_FICR->BLE_1MBIT[4] | 0x80000000; + } +#endif // NRF51 + + // Mode: BLE 1 Mbps + NRF_RADIO->MODE = RADIO_MODE_MODE_Ble_1Mbit << RADIO_MODE_MODE_Pos; + + // PacketConfig 0: + // --- + // LENGTH field in bits = 8 + // S0 field in bytes = 1 + // S1 field not used + // 8 bit preamble + NRF_RADIO->PCNF0 = + ( 8 << RADIO_PCNF0_LFLEN_Pos ) | + ( 1 << RADIO_PCNF0_S0LEN_Pos ) | + ( 0 << RADIO_PCNF0_S1LEN_Pos ); + + // PacketConfig 1: + // --- + // Payload MAXLEN = MAXLEN + // No additional bytes + // 4 address bytes (1 + 3) + // S0, LENGTH, S1, PAYLOAD in little endian + // Packet whitening enabled + NRF_RADIO->PCNF1 = + ( MAXLEN << RADIO_PCNF1_MAXLEN_Pos) | + ( 0 << RADIO_PCNF1_STATLEN_Pos ) | + ( 3 << RADIO_PCNF1_BALEN_Pos ) | + ( RADIO_PCNF1_ENDIAN_Little << RADIO_PCNF1_ENDIAN_Pos ) | + ( RADIO_PCNF1_WHITEEN_Enabled << RADIO_PCNF1_WHITEEN_Pos ); + + // Use logical address 0 for sending and receiving + NRF_RADIO->TXADDRESS = 0; + NRF_RADIO->RXADDRESSES = 1 << 0; + + // 24 bit CRC, skip address field + NRF_RADIO->CRCCNF = + ( RADIO_CRCCNF_SKIPADDR_Skip << RADIO_CRCCNF_SKIPADDR_Pos ) | + ( RADIO_CRCCNF_LEN_Three << RADIO_CRCCNF_LEN_Pos ); + + // The polynomial has the form of x^24 +x^10 +x^9 +x^6 +x^4 +x^3 +x+1 + NRF_RADIO->CRCPOLY = 0x100065B; + + // Inter frame spacing 150 us + NRF_RADIO->TIFS = 150; + + // Shorts: + // - READY->START + // - ADDRESS0>RSSISTART + NRF_RADIO->SHORTS = RADIO_SHORTS_READY_START_Enabled << RADIO_SHORTS_READY_START_Pos + | RADIO_SHORTS_ADDRESS_RSSISTART_Enabled << RADIO_SHORTS_ADDRESS_RSSISTART_Pos; + + // Disable all interrrupts + NRF_RADIO->INTENCLR = 0xffffffff; +} + + +void radio_dump_state(void){ + printf("Radio state: %lx\n", NRF_RADIO->STATE); +} + +// static +void radio_receive_on_channel(int channel){ + // set frequency based on channel + NRF_RADIO->FREQUENCY = radio_frequency_for_channel( channel ); + + // initializes data whitening with channel index + NRF_RADIO->DATAWHITEIV = channel & 0x3F; + + // set receive buffer + NRF_RADIO->PACKETPTR = (uintptr_t) rx_adv_buffer; + + // set MAXLEN based on receive buffer size + NRF_RADIO->PCNF1 = ( NRF_RADIO->PCNF1 & ~RADIO_PCNF1_MAXLEN_Msk ) | ( MAXLEN << RADIO_PCNF1_MAXLEN_Pos ); + + // clear events + NRF_RADIO->EVENTS_END = 0; + NRF_RADIO->EVENTS_DISABLED = 0; + NRF_RADIO->EVENTS_READY = 0; + NRF_RADIO->EVENTS_ADDRESS = 0; + + radio_set_access_address(ADVERTISING_RADIO_ACCESS_ADDRESS); + radio_set_crc_init(ADVERTISING_CRC_INIT); + + // ramp up receiver + NRF_RADIO->TASKS_RXEN = 1; + + // enable IRQ for END event + NRF_RADIO->INTENSET = RADIO_INTENSET_END_Enabled << RADIO_INTENSET_END_Pos; +} + +// static +void radio_disable(void){ + // testing + NRF_RADIO->TASKS_DISABLE = 1; + + // wait for ready + while (!NRF_RADIO->EVENTS_DISABLED) { + // just wait + } +} + +// static +void radio_dump_packet(void){ + // print data + int len = rx_adv_buffer[1] & 0x3f; + int i; + for (i=0;iEVENTS_END = 0; + + if (ll_state == LL_STATE_SCANNING){ + + // check if outgoing buffer available and if CRC was ok + if (hci_outgoing_event_free && + ((NRF_RADIO->CRCSTATUS & RADIO_CRCSTATUS_CRCSTATUS_Msk) == (RADIO_CRCSTATUS_CRCSTATUS_CRCOk << RADIO_CRCSTATUS_CRCSTATUS_Pos))){ + hci_outgoing_event_free = 0; + int len = rx_adv_buffer[1] & 0x3f; + hci_outgoing_event[0] = HCI_EVENT_LE_META; + hci_outgoing_event[1] = 11 + len - 6; + hci_outgoing_event[2] = HCI_SUBEVENT_LE_ADVERTISING_REPORT; + hci_outgoing_event[3] = 1; + hci_outgoing_event[4] = rx_adv_buffer[0] & 0x0f; + hci_outgoing_event[5] = (rx_adv_buffer[0] & 0x40) ? 1 : 0; + memcpy(&hci_outgoing_event[6], &rx_adv_buffer[2], 6); + hci_outgoing_event[12] = len - 6; // rest after bd addr + memcpy(&hci_outgoing_event[13], &rx_adv_buffer[8], len - 6); + hci_outgoing_event[13 + len - 6] = -NRF_RADIO->RSSISAMPLE; // RSSI is stored without sign but is negative + hci_outgoing_event_ready = 1; + } else { + // ... for now, we just throw the adv away and try to receive the next one + } + + // TODO: check if there's enough time left before the end of the scan interval + + // restart receiving + NRF_RADIO->TASKS_START = 1; + } +} + +uint8_t random_generator_next(void){ + NRF_RNG->SHORTS = RNG_SHORTS_VALRDY_STOP_Enabled << RNG_SHORTS_VALRDY_STOP_Pos; + NRF_RNG->TASKS_START = 1; + while (!NRF_RNG->EVENTS_VALRDY){ + } + return NRF_RNG->VALUE; +} + +// uses TIMER0-CC2 for reads +uint32_t get_time_us(void){ + NRF_TIMER0->TASKS_CAPTURE[2] = 1; + return NRF_TIMER0->CC[2]; +} + +volatile int timer_irq_happened; +void TIMER0_IRQHandler(void){ + // Reset IRQ flag + NRF_TIMER0->EVENTS_COMPARE[0] = 0; + NRF_TIMER0->TASKS_CLEAR = 1; + + timer_irq_happened = 1; + + // if (ll_state == LL_STATE_SCANNING){ + // // Restart scanning + // // TODO: use all channels + // radio_receive_on_channel(37); + // } +} + +// TODO: implement +void hal_cpu_disable_irqs(void){} +void hal_cpu_enable_irqs(void){} +void hal_cpu_enable_irqs_and_sleep(void){} + +// TODO: get time from RTC +uint32_t hal_time_ms(void){ + return 999; +} + +static void ll_set_scan_parameters(uint8_t le_scan_type, uint16_t le_scan_interval, uint16_t le_scan_window, uint8_t own_address_type, uint8_t scanning_filter_policy){ + // TODO .. store other params + ll_scan_interval_us = ((uint32_t) le_scan_interval) * 625; + ll_scan_window_us = ((uint32_t) le_scan_window) * 625; + log_info("LE Scan Params: window %lu, interval %lu ms", ll_scan_interval_us, ll_scan_window_us); +} + +static uint8_t ll_start_scanning(uint8_t filter_duplicates){ + // COMMAND DISALLOWED if wrong state. + if (ll_state != LL_STATE_STANDBY) return 0x0c; + + ll_state = LL_STATE_SCANNING; + + log_info("LE Scan Start: window %lu, interval %lu ms", ll_scan_interval_us, ll_scan_window_us); + + // reset timer and capature events + NRF_TIMER0->TASKS_CLEAR = 1; + NRF_TIMER0->TASKS_STOP = 1; + NRF_TIMER0->EVENTS_COMPARE[0] = 0; + NRF_TIMER0->EVENTS_COMPARE[1] = 0; + + // limit scanning + if (ll_scan_window_us < ll_scan_interval_us){ + // setup PPI to disable radio after end of scan_window + NRF_TIMER0->CC[1] = ll_scan_window_us; + NRF_PPI->CHENSET = 1 << 22; // TIMER0->EVENTS_COMPARE[1] -> RADIO->TASKS_DISABLE + } + + // set timer to trigger IRQ for next scan interval + NRF_TIMER0->CC[0] = ll_scan_interval_us; + NRF_TIMER0->INTENSET = TIMER_INTENSET_COMPARE0_Enabled << TIMER_INTENSET_COMPARE0_Pos; + + // next channel to scan + int adv_channel = (random_generator_next() % 3) + 37; + log_debug("LE Scan Channel: %u", adv_channel); + + // start receiving + NRF_TIMER0->TASKS_START = 1; + radio_receive_on_channel(adv_channel); + + return 0; +} + +static uint8_t ll_stop_scanning(void){ + // COMMAND DISALLOWED if wrong state. + if (ll_state != LL_STATE_SCANNING) return 0x0c; + + log_info("LE Scan Stop"); + + ll_state = LL_STATE_STANDBY; + + // stop radio + radio_disable(); + + return 0; +} + +static uint8_t ll_set_scan_enable(uint8_t le_scan_enable, uint8_t filter_duplicates){ + if (le_scan_enable){ + return ll_start_scanning(filter_duplicates); + } else { + return ll_stop_scanning(); + } +} + +static void fake_command_complete(uint16_t opcode){ + hci_outgoing_event[0] = HCI_EVENT_COMMAND_COMPLETE; + hci_outgoing_event[1] = 4; + hci_outgoing_event[2] = 1; + little_endian_store_16(hci_outgoing_event, 3, opcode); + hci_outgoing_event[5] = 0; + hci_outgoing_event_ready = 1; +} + +static void send_hardware_error(uint8_t error_code){ + hci_outgoing_event[0] = HCI_EVENT_HARDWARE_ERROR; + hci_outgoing_event[1] = 1; + hci_outgoing_event[2] = error_code; + hci_outgoing_event_ready = 1; +} + + +// command handler +static void controller_handle_hci_command(uint8_t * packet, uint16_t size){ + uint16_t opcode = little_endian_read_16(packet, 0); +#if 0 + uint16_t ocf = READ_CMD_OCF(packet); + switch (READ_CMD_OGF(packet)){ + case OGF_CONTROLLER_BASEBAND: + switch (ocf): + break; + default: + break; + } +#endif + if (opcode == hci_reset.opcode) { + fake_command_complete(opcode); + return; + } + if (opcode == hci_le_set_scan_enable.opcode){ + ll_set_scan_enable(packet[3], packet[4]); + fake_command_complete(opcode); + return; + } + if (opcode == hci_le_set_scan_parameters.opcode){ + ll_set_scan_parameters(packet[3], little_endian_read_16(packet, 4), little_endian_read_16(packet, 6), packet[8], packet[9]); + fake_command_complete(opcode); + return; + } + // try with "OK" + printf("CMD opcode %02x not handled yet\n", opcode); + fake_command_complete(opcode); +} + +// ACL handler +static void controller_handle_acl_data(uint8_t * packet, uint16_t size){ + // TODO +} + +static void transport_run(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type){ + // deliver hci packet on main thread + if (hci_outgoing_event_ready){ + hci_outgoing_event_ready = 0; + packet_handler(HCI_EVENT_PACKET, hci_outgoing_event, hci_outgoing_event[1]+2); + hci_outgoing_event_free = 1; + } + if (timer_irq_happened){ + // printf("Timer irq occured\n"); + // radio_dump_state(); + timer_irq_happened = 0; + + if (ll_state == LL_STATE_SCANNING){ + // next channel to scan + int adv_channel = (random_generator_next() % 3) + 37; + log_debug("Restart scan on channel %u", adv_channel); + radio_receive_on_channel(adv_channel); + } + } +} + +/** + * init transport + * @param transport_config + */ +void transport_init(const void *transport_config){ + +} + +/** + * open transport connection + */ +static int transport_open(void){ + btstack_run_loop_set_data_source_handler(&hci_transport_data_source, &transport_run); + btstack_run_loop_enable_data_source_callbacks(&hci_transport_data_source, DATA_SOURCE_CALLBACK_POLL); + btstack_run_loop_add_data_source(&hci_transport_data_source); + return 0; +} + +/** + * close transport connection + */ +static int transport_close(void){ + btstack_run_loop_remove_data_source(&hci_transport_data_source); + return 0; +} + +/** + * register packet handler for HCI packets: ACL, SCO, and Events + */ +static void transport_register_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)){ + packet_handler = handler; +} + +int transport_send_packet(uint8_t packet_type, uint8_t *packet, int size){ + + switch (packet_type){ + case HCI_COMMAND_DATA_PACKET: + controller_handle_hci_command(packet, size); + break; + case HCI_ACL_DATA_PACKET: + controller_handle_acl_data(packet, size); + break; + default: + send_hardware_error(0x01); // invalid HCI packet + break; + } + return 0; +} + +int btstack_main(void); + +/** + * @brief Function for main application entry. + */ +int main(void) +{ + + LEDS_CONFIGURE(LEDS_MASK); + LEDS_OFF(LEDS_MASK); + uint32_t err_code; + const app_uart_comm_params_t comm_params = { + RX_PIN_NUMBER, + TX_PIN_NUMBER, + RTS_PIN_NUMBER, + CTS_PIN_NUMBER, + APP_UART_FLOW_CONTROL_ENABLED, + false, + UART_BAUDRATE_BAUDRATE_Baud115200 + }; + + APP_UART_FIFO_INIT(&comm_params, + UART_RX_BUF_SIZE, + UART_TX_BUF_SIZE, + uart_error_handle, + APP_IRQ_PRIORITY_LOW, + err_code); + + APP_ERROR_CHECK(err_code); + + init_timer(); + radio_init(); + hci_outgoing_event_free = 1; + + // enable Radio IRQs + NVIC_SetPriority( RADIO_IRQn, 0 ); + NVIC_ClearPendingIRQ( RADIO_IRQn ); + NVIC_EnableIRQ( RADIO_IRQn ); + + // enable Timer IRQs + NVIC_SetPriority( TIMER0_IRQn, 0 ); + NVIC_ClearPendingIRQ( TIMER0_IRQn ); + NVIC_EnableIRQ( TIMER0_IRQn ); + + // HCI Controller Defaults + ll_scan_window_us = 10000; + ll_scan_interval_us = 10000; + + // Bring up BTstack + printf("BTstack on Nordic nRF5 SDK\n"); + + btstack_memory_init(); + btstack_run_loop_init(btstack_run_loop_embedded_get_instance()); + + // setup hci transport wrapper + hci_transport.name = "nRF5"; + hci_transport.init = transport_init; + hci_transport.open = transport_open; + hci_transport.close = transport_close; + hci_transport.register_packet_handler = transport_register_packet_handler; + hci_transport.can_send_packet_now = NULL; + hci_transport.send_packet = transport_send_packet; + hci_transport.set_baudrate = NULL; + + // init HCI + hci_init(&hci_transport, NULL); + + // enable full log output while porting + hci_dump_open(NULL, HCI_DUMP_STDOUT); + + // hand over to btstack embedded code + btstack_main(); + + // go + btstack_run_loop_execute(); + + while (1){}; + +#if 0 + + // start listening + radio_receive_on_channel(37); + + while (1){ + if (NRF_RADIO->EVENTS_END){ + NRF_RADIO->EVENTS_END = 0; + // process packet + radio_dump_packet(); + // receive next packet + NRF_RADIO->TASKS_START = 1; + } + } + + radio_disable(); +#endif +} + + +/** @} */ From 7d20d6a4372a119972ee5dddb8a0bb9e2855330f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 25 May 2016 11:45:46 +0200 Subject: [PATCH 69/74] rfcomm: finalize multiplexer on l2cap disconnect in any state --- src/classic/rfcomm.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/classic/rfcomm.c b/src/classic/rfcomm.c index 75e607ea6..e5f1f00ac 100644 --- a/src/classic/rfcomm.c +++ b/src/classic/rfcomm.c @@ -1027,19 +1027,8 @@ static int rfcomm_hci_event_handler(uint8_t *packet, uint16_t size){ log_info("L2CAP_EVENT_CHANNEL_CLOSED cid 0x%0x, mult %p", l2cap_cid, multiplexer); if (!multiplexer) break; log_info("L2CAP_EVENT_CHANNEL_CLOSED state %u", multiplexer->state); - switch (multiplexer->state) { - case RFCOMM_MULTIPLEXER_W4_CONNECT: - case RFCOMM_MULTIPLEXER_SEND_SABM_0: - case RFCOMM_MULTIPLEXER_W4_SABM_0: - case RFCOMM_MULTIPLEXER_SEND_UA_0: - case RFCOMM_MULTIPLEXER_W4_UA_0: - case RFCOMM_MULTIPLEXER_OPEN: - // don't call l2cap_disconnect as it's alreay closed - rfcomm_multiplexer_finalize(multiplexer); - return 1; - default: - break; - } + // no need to call l2cap_disconnect here, as it's already closed + rfcomm_multiplexer_finalize(multiplexer); break; default: break; From d5499c6f2d6556cf857249a04449caa2b290d922 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 25 May 2016 21:02:39 +0200 Subject: [PATCH 70/74] rfcomm: fix previous commit, return 1 although it's not used currently --- src/classic/rfcomm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/classic/rfcomm.c b/src/classic/rfcomm.c index e5f1f00ac..7efead4c3 100644 --- a/src/classic/rfcomm.c +++ b/src/classic/rfcomm.c @@ -1029,7 +1029,8 @@ static int rfcomm_hci_event_handler(uint8_t *packet, uint16_t size){ log_info("L2CAP_EVENT_CHANNEL_CLOSED state %u", multiplexer->state); // no need to call l2cap_disconnect here, as it's already closed rfcomm_multiplexer_finalize(multiplexer); - break; + return 1; + default: break; } From 3e40861c0c74c4011f5e60298369a82ee304f2e6 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Fri, 3 Jun 2016 12:06:02 +0200 Subject: [PATCH 71/74] util: fix sscanf_bd_addr --- src/btstack_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/btstack_util.c b/src/btstack_util.c index 7529c638e..8557e4c9c 100644 --- a/src/btstack_util.c +++ b/src/btstack_util.c @@ -261,7 +261,7 @@ int sscanf_bd_addr(const char * addr_string, bd_addr_t addr){ int single_byte = scan_hex_byte(addr_string); if (single_byte < 0) break; addr_string += 2; - addr[i] = single_byte; + buffer[i] = single_byte; // don't check seperator after last byte if (i == BD_ADDR_LEN - 1) { result = 1; From 969fc1c5012c6dba7780d5c32045aeb3530e5f29 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Fri, 3 Jun 2016 15:52:59 +0200 Subject: [PATCH 72/74] util: fix docu to match function return value --- src/btstack_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/btstack_util.c b/src/btstack_util.c index 8557e4c9c..db675dacf 100644 --- a/src/btstack_util.c +++ b/src/btstack_util.c @@ -54,7 +54,7 @@ * @brief Compare two Bluetooth addresses * @param a * @param b - * @return true if equal + * @return 0 if equal */ int bd_addr_cmp(bd_addr_t a, bd_addr_t b){ return memcmp(a,b, BD_ADDR_LEN); From 0f09bd9698afb66ceb5189da0275ad8994d5cf47 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Fri, 3 Jun 2016 15:54:29 +0200 Subject: [PATCH 73/74] battery example: add round-robin blacklist for devices that do not have battery service --- example/gatt_battery_query.c | 146 +++++++++++++++++++++++------------ 1 file changed, 98 insertions(+), 48 deletions(-) diff --git a/example/gatt_battery_query.c b/example/gatt_battery_query.c index d38d93844..14d754a66 100644 --- a/example/gatt_battery_query.c +++ b/example/gatt_battery_query.c @@ -68,6 +68,10 @@ typedef enum { TC_W4_BATTERY_DATA } gc_state_t; +static int blacklist_index = 0; +static bd_addr_t blacklist[20]; +static advertising_report_t report; + static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); static bd_addr_t cmdline_addr = { }; @@ -90,6 +94,24 @@ static void printUUID(uint8_t * uuid128, uint16_t uuid16){ } } +static int blacklist_size(){ + return sizeof(blacklist) / sizeof(bd_addr_t); +} + +static int blacklist_contains(bd_addr_t addr){ + int i; + for (i=0; ievent_type, e->address_type, bd_addr_to_str(e->address), e->rssi, e->length); @@ -116,36 +138,27 @@ static void dump_service(gatt_client_service_t * service){ printf("\n"); } -static void error_code(int status){ - switch(status){ - case ATT_ERROR_INSUFFICIENT_AUTHENTICATION: - printf("ATT_ERROR_INSUFFICIENT_AUTHENTICATION. TODO: security manager is not complete yet.\n"); - break; - default: - printf(" status 0x%02x\n", status); - break; - } -} static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ + int status; + uint8_t battery_level; switch(state){ case TC_W4_SERVICE_RESULT: switch(hci_event_packet_get_type(packet)){ case GATT_EVENT_SERVICE_QUERY_RESULT: gatt_event_service_query_result_get_service(packet, &battery_service); - printf("Battery service found:\n"); dump_service(&battery_service); break; case GATT_EVENT_QUERY_COMPLETE: - if (!packet[4]){ - printf("Battery service not found. Restart scan.\n"); - state = TC_W4_SCAN_RESULT; - gap_start_scan(); + if (packet[4] != 0){ + printf("SERVICE_QUERY_RESULT - Error status %x.\n", packet[4]); + add_to_blacklist(report.address); + gap_disconnect(connection_handle); break; } state = TC_W4_CHARACTERISTIC_RESULT; - printf("\nSearch for battery level characteristic in battery service. "); + printf("\nSearch for battery level characteristic.\n"); gatt_client_discover_characteristics_for_service_by_uuid16(handle_gatt_client_event, connection_handle, &battery_service, battery_level_characteristic_uuid); break; default: @@ -156,30 +169,54 @@ static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint case TC_W4_CHARACTERISTIC_RESULT: switch(hci_event_packet_get_type(packet)){ case GATT_EVENT_CHARACTERISTIC_QUERY_RESULT: - printf("Battery level characteristic found:\n"); gatt_event_characteristic_query_result_get_characteristic(packet, &config_characteristic); dump_characteristic(&config_characteristic); break; case GATT_EVENT_QUERY_COMPLETE: + if (packet[4] != 0){ + printf("CHARACTERISTIC_QUERY_RESULT - Error status %x.\n", packet[4]); + add_to_blacklist(report.address); + gap_disconnect(connection_handle); + break; + } state = TC_W4_BATTERY_DATA; - printf("\nConfigure battery level characteristic for notify."); - gatt_client_write_client_characteristic_configuration(handle_gatt_client_event, connection_handle, &config_characteristic, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION); + printf("\nConfigure battery level characteristic for notify.\n"); + status = gatt_client_write_client_characteristic_configuration(handle_gatt_client_event, connection_handle, &config_characteristic, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION); + if (status != 0){ + printf("\nNotification not supported. Query value of characteristic.\n"); + gatt_client_read_value_of_characteristic(handle_gatt_client_event, connection_handle, &config_characteristic); + } + break; default: break; } break; case TC_W4_BATTERY_DATA: - if (hci_event_packet_get_type(packet) == GATT_EVENT_QUERY_COMPLETE){ - if (packet[4] != 0){ - printf("\nNotification is not possible: "); - error_code(packet[4]); - } - break; + switch(hci_event_packet_get_type(packet)){ + case GATT_EVENT_NOTIFICATION: + printf("\nBattery Data:\n"); + dump_characteristic_value(&packet[8], little_endian_read_16(packet, 6)); + break; + case GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT: + + if (gatt_event_characteristic_value_query_result_get_value_length(packet) < 1) break; + battery_level = gatt_event_characteristic_value_query_result_get_value(packet)[0]; + printf("Battry level %d \n", battery_level); + break; + + case GATT_EVENT_QUERY_COMPLETE: + if (packet[4] != 0){ + printf("CHARACTERISTIC_VALUE_QUERY_RESULT - Error status %x.\n", packet[4]); + break; + } + // Use timer if repeated request is needed and notification is not supperted + gap_disconnect(connection_handle); + break; + default: + printf("Unknown packet type %x\n", hci_event_packet_get_type(packet)); + break; } - if (hci_event_packet_get_type(packet) != GATT_EVENT_NOTIFICATION) break; - printf("\nBattery Data:\n"); - dump_characteristic_value(&packet[8], little_endian_read_16(packet, 6)); break; default: @@ -189,30 +226,30 @@ static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint } -static void fill_advertising_report_from_packet(advertising_report_t * report, uint8_t *packet){ - gap_event_advertising_report_get_address(packet, report->address); - report->event_type = gap_event_advertising_report_get_advertising_event_type(packet); - report->address_type = gap_event_advertising_report_get_address_type(packet); - report->rssi = gap_event_advertising_report_get_rssi(packet); - report->length = gap_event_advertising_report_get_data_length(packet); - report->data = gap_event_advertising_report_get_data(packet); +static void fill_advertising_report_from_packet(advertising_report_t * adv_report, uint8_t *packet){ + gap_event_advertising_report_get_address(packet, adv_report->address); + adv_report->event_type = gap_event_advertising_report_get_advertising_event_type(packet); + adv_report->address_type = gap_event_advertising_report_get_address_type(packet); + adv_report->rssi = gap_event_advertising_report_get_rssi(packet); + adv_report->length = gap_event_advertising_report_get_data_length(packet); + adv_report->data = gap_event_advertising_report_get_data(packet); } static void hci_event_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ if (packet_type != HCI_EVENT_PACKET) return; - advertising_report_t report; + uint8_t event = hci_event_packet_get_type(packet); switch (event) { case BTSTACK_EVENT_STATE: // BTstack activated, get started if (btstack_event_state_get_state(packet) != HCI_STATE_WORKING) break; if (cmdline_addr_found){ - printf("Start connect to %s\n", bd_addr_to_str(cmdline_addr)); + printf("Connect to %s\n", bd_addr_to_str(cmdline_addr)); state = TC_W4_CONNECT; gap_connect(cmdline_addr, 0); break; } - printf("BTstack activated, start scanning!\n"); + printf("Start scanning!\n"); state = TC_W4_SCAN_RESULT; gap_set_scan_parameters(0,0x0030, 0x0030); gap_start_scan(); @@ -220,13 +257,17 @@ static void hci_event_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa case GAP_EVENT_ADVERTISING_REPORT: if (state != TC_W4_SCAN_RESULT) return; fill_advertising_report_from_packet(&report, packet); + + if (blacklist_contains(report.address)) { + break; + } dump_advertising_report(&report); - // stop scanning, and connect to the device state = TC_W4_CONNECT; gap_stop_scan(); - printf("Stop scan. Start connect to device with addr %s.\n", bd_addr_to_str(report.address)); + printf("Stop scan. Connect to device with addr %s.\n", bd_addr_to_str(report.address)); gap_connect(report.address,report.address_type); + break; case HCI_EVENT_LE_META: // wait for connection complete @@ -240,8 +281,16 @@ static void hci_event_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa gatt_client_discover_primary_services_by_uuid16(handle_gatt_client_event, connection_handle, battery_service_uuid); break; case HCI_EVENT_DISCONNECTION_COMPLETE: - printf("\nDISCONNECTED\n"); - exit(0); + + if (cmdline_addr_found){ + printf("\nDisconnected %s\n", bd_addr_to_str(cmdline_addr)); + exit(0); + } + + printf("\nDisconnected %s\n", bd_addr_to_str(report.address)); + printf("Restart scan.\n"); + state = TC_W4_SCAN_RESULT; + gap_start_scan(); break; default: break; @@ -249,8 +298,8 @@ static void hci_event_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa } static void usage(const char *name){ - fprintf(stderr, "\nUsage: %s [-a|--address aa:bb:cc:dd:ee:ff]\n", name); - fprintf(stderr, "If no argument is provided, GATT browser will start scanning and connect to the first found device.\nTo connect to a specific device use argument [-a].\n\n"); + fprintf(stderr, "\nUsage: %s [-a|--address aa:bb:cc:dd:ee:ff]\n", name); + fprintf(stderr, "If no argument is provided, GATT browser will start scanning and connect to the first found device.\nTo connect to a specific device use argument [-a].\n\n"); } int btstack_main(int argc, const char * argv[]); @@ -260,15 +309,16 @@ int btstack_main(int argc, const char * argv[]){ cmdline_addr_found = 0; while (arg < argc) { - if(!strcmp(argv[arg], "-a") || !strcmp(argv[arg], "--address")){ - arg++; - cmdline_addr_found = sscanf_bd_addr(argv[arg], cmdline_addr); + if(!strcmp(argv[arg], "-a") || !strcmp(argv[arg], "--address")){ arg++; + cmdline_addr_found = sscanf_bd_addr(argv[arg], cmdline_addr); + arg++; + if (!cmdline_addr_found) exit(1); continue; } usage(argv[0]); return 0; - } + } hci_event_callback_registration.callback = &hci_event_handler; hci_add_event_handler(&hci_event_callback_registration); From 287eecff9a96ee994e9040cfd7bd9ff0d4168d9d Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Fri, 3 Jun 2016 15:58:50 +0200 Subject: [PATCH 74/74] example: add void --- example/gatt_battery_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/gatt_battery_query.c b/example/gatt_battery_query.c index 14d754a66..e063c57b8 100644 --- a/example/gatt_battery_query.c +++ b/example/gatt_battery_query.c @@ -94,7 +94,7 @@ static void printUUID(uint8_t * uuid128, uint16_t uuid16){ } } -static int blacklist_size(){ +static int blacklist_size(void){ return sizeof(blacklist) / sizeof(bd_addr_t); }