From 993287af6132924f952d2368d45fec2882e79a8b Mon Sep 17 00:00:00 2001 From: snake Date: Thu, 22 Sep 2016 16:40:31 +0800 Subject: [PATCH 1/8] add btdm_controller 1st --- components/bt/bt.c | 117 +++++++++++++++++++++++++++++ components/bt/component.mk | 25 ++++++ components/bt/include/bt.h | 30 ++++++++ components/bt/lib/libbtdm_app.a | Bin 0 -> 61822 bytes components/esp32/cpu_start.c | 8 +- components/esp32/include/soc/soc.h | 6 +- components/esp32/lib | 2 +- 7 files changed, 183 insertions(+), 5 deletions(-) create mode 100644 components/bt/bt.c create mode 100644 components/bt/component.mk create mode 100644 components/bt/include/bt.h create mode 100644 components/bt/lib/libbtdm_app.a diff --git a/components/bt/bt.c b/components/bt/bt.c new file mode 100644 index 000000000..4b623ca20 --- /dev/null +++ b/components/bt/bt.c @@ -0,0 +1,117 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/queue.h" +#include "freertos/semphr.h" +#include "freertos/xtensa_api.h" +#include "freertos/portmacro.h" +#include "esp_types.h" +#include "esp_system.h" +#include "esp_intr.h" +#include "esp_attr.h" +#include "bt.h" + +#if CONFIG_BT_ENABLED + +static bt_app_startup_cb_t app_startup_cb; +static void *app_startup_ctx; + +#define BT_DEBUG(...) +#define BT_API_CALL_CHECK(info, api_call, ret) \ +do{\ + esp_err_t __err = (api_call);\ + if ((ret) != __err) {\ + BT_DEBUG("%s %d %s ret=%d\n", __FUNCTION__, __LINE__, (info), __err);\ + return __err;\ + }\ +} while(0) + +extern void btdm_controller_init(void); +extern void API_osi_funcs_register(void *osi_funcs); + +struct osi_funcs_t { + xt_handler (*_set_isr)(int n, xt_handler f, void *arg); + void (*_ints_on)(unsigned int mask); + void (*_interrupt_disable)(void); + void (*_interrupt_restore)(void); + void (*_task_yield)(void); + void *(*_semphr_create)(uint32_t max, uint32_t init); + void *(*_semphr_give_from_isr)(void *semphr, void *hptw); + void *(*_semphr_take)(void *semphr, uint32_t block_time); + esp_err_t (* _read_efuse_mac)(uint8_t mac[6]); +}; + +static portMUX_TYPE global_int_mux = portMUX_INITIALIZER_UNLOCKED; + +static inline void IRAM_ATTR interrupt_disable(void) +{ + portENTER_CRITICAL(&global_int_mux); +} + +static inline void IRAM_ATTR interrupt_restore(void) +{ + portEXIT_CRITICAL(&global_int_mux); +} + +static inline void *IRAM_ATTR semphr_take_wrapped(void *semphr, uint32_t block_time) +{ + return (void *)xSemaphoreTake(semphr, block_time); +} + +static struct osi_funcs_t osi_funcs = { + ._set_isr = xt_set_interrupt_handler, + ._ints_on = xt_ints_on, + ._interrupt_disable = interrupt_disable, + ._interrupt_restore = interrupt_restore, + ._task_yield = vPortYield, + ._semphr_create = xQueueCreateCountingSemaphore, + ._semphr_give_from_isr = (void *)xQueueGiveFromISR, + ._semphr_take = semphr_take_wrapped, + ._read_efuse_mac = system_efuse_read_mac, +}; + +static void bt_controller_task(void *pvParam) +{ + API_osi_funcs_register(&osi_funcs); + btdm_controller_init(); +} + + +static void bt_init_task(void *pvParameters) +{ + xTaskCreatePinnedToCore(bt_controller_task, "btControllerTask", BT_CONTROLLER_TASK_STACK_SIZE, NULL, BT_CONTROLLER_TASK_PRIO, NULL, 0); + + if (app_startup_cb) + app_startup_cb(app_startup_ctx); + + vTaskDelete(NULL); +} + + +esp_err_t esp_bt_startup(bt_app_startup_cb_t cb, void *ctx) +{ + app_startup_cb = cb; + app_startup_ctx = ctx; + + xTaskCreatePinnedToCore(bt_init_task, "btInitTask", BT_INIT_TASK_STACK_SIZE, NULL, BT_INIT_TASK_PRIO, NULL, 0); + + return ESP_OK; +} +#endif diff --git a/components/bt/component.mk b/components/bt/component.mk new file mode 100644 index 000000000..110d02267 --- /dev/null +++ b/components/bt/component.mk @@ -0,0 +1,25 @@ +# +# Component Makefile +# + +#COMPONENT_ADD_INCLUDEDIRS := + +CURRENT_DIR=$(IDF_PATH)/components/bt + +COMPONENT_ADD_INCLUDEDIRS := ./include + +CFLAGS += -Wno-error=unused-label -Wno-error=return-type -Wno-error=missing-braces -Wno-error=pointer-sign -Wno-error=parentheses + +LIBS := btdm_app + +COMPONENT_ADD_LDFLAGS := -lbt -L$(abspath lib) \ + $(addprefix -l,$(LIBS)) \ + $(LINKER_SCRIPTS) + + +ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS)) +$(COMPONENT_LIBRARY): $(ALL_LIB_FILES) + +COMPONENT_SRCDIRS := ./ + +include $(IDF_PATH)/make/component_common.mk diff --git a/components/bt/include/bt.h b/components/bt/include/bt.h new file mode 100644 index 000000000..04bb466c4 --- /dev/null +++ b/components/bt/include/bt.h @@ -0,0 +1,30 @@ +#ifndef __BT_H__ +#define __BT_H__ + +#include "freertos/FreeRTOS.h" +#include "esp_err.h" + +#define BT_TASK_PRIO_MAX (configMAX_PRIORITIES) +#define BT_TASK_PRIO_MIN (0) + +/* bt init */ +#define BT_INIT_TASK_PRIO (BT_TASK_PRIO_MAX-1) +#define BT_INIT_TASK_STACK_SIZE (2048) +/* controller */ +#define BT_CONTROLLER_TASK_PRIO (BT_TASK_PRIO_MAX-3) +#define BT_CONTROLLER_TASK_STACK_SIZE (4096) + +typedef void (* bt_app_startup_cb_t)(void *param); + +esp_err_t esp_bt_startup(bt_app_startup_cb_t cb, void *ctx); + +typedef struct vhci_host_callback { + void (*notify_host_send_available)(void); + int (*notify_host_recv)(uint8_t *data, uint16_t len); +} vhci_host_callback_t; + +extern bool API_vhci_host_check_send_available(void); +extern void API_vhci_host_send_packet(uint8_t *data, uint16_t len); +extern void API_vhci_host_register_callback(const vhci_host_callback_t *callback); + +#endif /* __BT_H__ */ diff --git a/components/bt/lib/libbtdm_app.a b/components/bt/lib/libbtdm_app.a new file mode 100644 index 0000000000000000000000000000000000000000..4c93a93b0fcdbb1548a7bf6b00c616a3a645a944 GIT binary patch literal 61822 zcmeHw4PabVnf9F|t7k!cer(;u*E z5-Ox?*DtN?611*KtrDH8e#XO|6b9{nfB z8QwHUS41k8RYq2vA8A-mP9I>n`>k7NL944`UWSa&e~Wk>1e8qRW40BS60TB z!Bw+-X;Y-8GG6JFRm_c4#cP&Emej^0D{5oS4UH6_t2tg-eM4kL438I3g8R!6Fr zfzi0Eu3<@}Zuzq6W=T^lQoFQ4v_|TeSE8Uy!TGQ*+PE@;tlF-+I>aLkh&In$2^Ma& zIuc#l)Ks&42+zTT#4DR`7&HK?tU5ZtCl-mKB28KN5H%R7j7BwCQKleT-83MOCJugs zB>?OpQxL5gJjl{WeRac7Ud!VRsi|HPZLC6-qmbD&V{sJt09IquKu%3Vb7fVOb!3U5 zy~Z13WUj1ZvubSCBs7`6kaWjtmozlTYh%t5HreLt`Wm#hrA_swqP1`s<22*iv$D0 zin?een(WeAc6T339gCx;c3Hfk?#6^~ZLG4H1>t*Zd-h$Xp|4>5G}kVxaSV#pR=IanRiJb5Wqy` zQ^5JClXN-G78m?<%sIxpz&XV^$(dH>gwoFF_XFTs(c&y#08K-S75|a@N1(wcWWlbXu?L+%+bv{Uc+pE%jQT_f|g(#@t}*AHDn2fTjmq z4|xxz1N8(S&*=C<_NJ~t*Bx&6GagtQ>YdhSyuP55`#Uc$&&kUR^rboA7mT_#=2=M_ zkhXayeV)fOB5jp__P&u(Kf2;OZrjzoICm5- zox#=LskkFMG&_8U3+Eld_0M>&dl+!X7-#By3I|_tqN~J;B1l!zk>I&r|-6U@IzcE>KUf;|o3q zB?Pz05)|jT6Um+!q++xq=*oRlY5@4$K#n=*q8T%0NIew2=C!A{ zk3->?rkB3dm+llH&QnX%L&1sZMK6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i;Jct z?w75%_ft<$^OIk`wEuMQo!&$vT`UNtcfO~adLKR76etG~uHgbGKCX+{=;y#qwbRl6Q*di%qx-XPYsaGdcDUJzIH1w}E!gZBv&8*9*xHck|2W)i zs7x2#Jd3G~jBZC(Ugphlb5qY($YZtDD{z*$#`s3!jrEc0%If-B-&x<-9FJ62`Hs4n z`pG@Jbu8HEY)+`5QVA4oTp4MstFv8vvE2la6T=3-)$8m0SdJ0$(^FrIm**K-q;f@N zL)09D9w=fwoA8c3j#3Zw(J$>Fm(geyB>YaP`vM#Q6m!5(>{^(EobnH%eia|EaG!-s zEnH&ZLJLnOmM+0bL-8uqq3VxYm~Bb$~-KXHYZ-{XI`HW%rZDE zm}PS^%8D|pfv*zG@>?L7<+@lf?K;7fX%I}A<$`J7B$zThi%I>ISu2?KI>D^NFA8Se z@*b4(tn(iUo&o!L!E6_Y1+%@pA^0HdlhCdhmhJ0w!L-j2%r;mmI3IS6U`~+Dg4t%j zESPQiM}k{mKP8xxkSk?a1ABsnCkn2B9fAp*hzp4KKQ!Y7Ydta*P`_+0$GVc{U$OegtQ3a)`2hS4-!Cw%gVH4T(w*j2D+!>D|t z@W~@qdCF0q?Xet2g_Ixd^+$!gMnY zT##KanDaK>M%(ks@g=@eW(#k%usORc`gdFWM=acD;X@XF#ljhElcI;~GR5O9%=MY_ODr6= z@H`8%@2EV-bH!ZODK={oiI?j;<=q5@D2;_vhZFDb3Ra=2Q7Tq!raSK8NTPD znBUq|oNwVm3(v4{xrG;4c(H}i+(tyaxkvSIWoxKJY_+6YCN>v_lA{h1Z!(FI6ho={ zRE~X{GA#W#HgWAneM~253KCl8Lvy7c%|~JEz1K#_ar{%F45z>% literal 0 HcmV?d00001 diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index 85f4ace51..45a4bcec3 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -48,6 +48,9 @@ static void IRAM_ATTR call_user_start_cpu1(); static void IRAM_ATTR user_start_cpu1(void); extern void ets_setup_syscalls(void); extern esp_err_t app_main(void *ctx); +#if CONFIG_BT_ENABLED +extern void bt_app_main(void *param); +#endif extern int _bss_start; extern int _bss_end; @@ -161,7 +164,10 @@ void user_start_cpu0(void) #if CONFIG_WIFI_ENABLED && CONFIG_WIFI_AUTO_STARTUP #include "esp_wifi.h" - esp_wifi_startup(app_main, NULL); + esp_wifi_startup(app_main, NULL); +#elif CONFIG_BT_ENABLED +#include "bt.h" + esp_bt_startup(bt_app_main, NULL); #else app_main(NULL); #endif diff --git a/components/esp32/include/soc/soc.h b/components/esp32/include/soc/soc.h index 0b8cdfecb..4ffdfb069 100755 --- a/components/esp32/include/soc/soc.h +++ b/components/esp32/include/soc/soc.h @@ -260,14 +260,14 @@ /************************************************************************************************************* * Intr num Level Type PRO CPU usage APP CPU uasge * 0 1 extern level WMAC Reserved - * 1 1 extern level BT/BLE Host Reserved + * 1 1 extern level BT/BLE Host VHCI Reserved * 2 1 extern level FROM_CPU FROM_CPU * 3 1 extern level TG0_WDT Reserved * 4 1 extern level WBB - * 5 1 extern level Reserved + * 5 1 extern level BT Controller * 6 1 timer FreeRTOS Tick(L1) FreeRTOS Tick(L1) * 7 1 software Reserved Reserved - * 8 1 extern level Reserved + * 8 1 extern level BLE Controller * 9 1 extern level * 10 1 extern edge Internal Timer * 11 3 profiling diff --git a/components/esp32/lib b/components/esp32/lib index 9f26b9a19..ab3c510e5 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 9f26b9a190e6a6ca42656685df9287253badfa46 +Subproject commit ab3c510e51f312d919df6830efbc04c6de9cfd2a From db407074f12923e70297ffca52a523e080b824b4 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 22 Sep 2016 17:52:07 +0800 Subject: [PATCH 2/8] components/bt: remove binary library --- components/bt/lib/libbtdm_app.a | Bin 61822 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 components/bt/lib/libbtdm_app.a diff --git a/components/bt/lib/libbtdm_app.a b/components/bt/lib/libbtdm_app.a deleted file mode 100644 index 4c93a93b0fcdbb1548a7bf6b00c616a3a645a944..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61822 zcmeHw4PabVnf9F|t7k!cer(;u*E z5-Ox?*DtN?611*KtrDH8e#XO|6b9{nfB z8QwHUS41k8RYq2vA8A-mP9I>n`>k7NL944`UWSa&e~Wk>1e8qRW40BS60TB z!Bw+-X;Y-8GG6JFRm_c4#cP&Emej^0D{5oS4UH6_t2tg-eM4kL438I3g8R!6Fr zfzi0Eu3<@}Zuzq6W=T^lQoFQ4v_|TeSE8Uy!TGQ*+PE@;tlF-+I>aLkh&In$2^Ma& zIuc#l)Ks&42+zTT#4DR`7&HK?tU5ZtCl-mKB28KN5H%R7j7BwCQKleT-83MOCJugs zB>?OpQxL5gJjl{WeRac7Ud!VRsi|HPZLC6-qmbD&V{sJt09IquKu%3Vb7fVOb!3U5 zy~Z13WUj1ZvubSCBs7`6kaWjtmozlTYh%t5HreLt`Wm#hrA_swqP1`s<22*iv$D0 zin?een(WeAc6T339gCx;c3Hfk?#6^~ZLG4H1>t*Zd-h$Xp|4>5G}kVxaSV#pR=IanRiJb5Wqy` zQ^5JClXN-G78m?<%sIxpz&XV^$(dH>gwoFF_XFTs(c&y#08K-S75|a@N1(wcWWlbXu?L+%+bv{Uc+pE%jQT_f|g(#@t}*AHDn2fTjmq z4|xxz1N8(S&*=C<_NJ~t*Bx&6GagtQ>YdhSyuP55`#Uc$&&kUR^rboA7mT_#=2=M_ zkhXayeV)fOB5jp__P&u(Kf2;OZrjzoICm5- zox#=LskkFMG&_8U3+Eld_0M>&dl+!X7-#By3I|_tqN~J;B1l!zk>I&r|-6U@IzcE>KUf;|o3q zB?Pz05)|jT6Um+!q++xq=*oRlY5@4$K#n=*q8T%0NIew2=C!A{ zk3->?rkB3dm+llH&QnX%L&1sZMK6076c?_&xuqq(=U~xG-UWH?+MD;3x4yu-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`UNtcfO~adLKR76etG~uHgbGKCX+{=;y#qwbRl6Q*di%qx-XPYsaGdcDUJzIH1w}E!gZBv&8*9*xHck|2W)i zs7x2#Jd3G~jBZC(Ugphlb5qY($YZtDD{z*$#`s3!jrEc0%If-B-&x<-9FJ62`Hs4n z`pG@Jbu8HEY)+`5QVA4oTp4MstFv8vvE2la6T=3-)$8m0SdJ0$(^FrIm**K-q;f@N zL)09D9w=fwoA8c3j#3Zw(J$>Fm(geyB>YaP`vM#Q6m!5(>{^(EobnH%eia|EaG!-s zEnH&ZLJLnOmM+0bL-8uqq3VxYm~Bb$~-KXHYZ-{XI`HW%rZDE zm}PS^%8D|pfv*zG@>?L7<+@lf?K;7fX%I}A<$`J7B$zThi%I>ISu2?KI>D^NFA8Se z@*b4(tn(iUo&o!L!E6_Y1+%@pA^0HdlhCdhmhJ0w!L-j2%r;mmI3IS6U`~+Dg4t%j zESPQiM}k{mKP8xxkSk?a1ABsnCkn2B9fAp*hzp4KKQ!Y7Ydta*P`_+0$GVc{U$OegtQ3a)`2hS4-!Cw%gVH4T(w*j2D+!>D|t z@W~@qdCF0q?Xet2g_Ixd^+$!gMnY zT##KanDaK>M%(ks@g=@eW(#k%usORc`gdFWM=acD;X@XF#ljhElcI;~GR5O9%=MY_ODr6= z@H`8%@2EV-bH!ZODK={oiI?j;<=q5@D2;_vhZFDb3Ra=2Q7Tq!raSK8NTPD znBUq|oNwVm3(v4{xrG;4c(H}i+(tyaxkvSIWoxKJY_+6YCN>v_lA{h1Z!(FI6ho={ zRE~X{GA#W#HgWAneM~253KCl8Lvy7c%|~JEz1K#_ar{%F45z>% From bc256cc36d2d5cf9f3a2a5968063db2d8160a30b Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 22 Sep 2016 17:54:19 +0800 Subject: [PATCH 3/8] components/bt: add library as submodule --- .gitmodules | 3 +++ components/bt/lib | 1 + 2 files changed, 4 insertions(+) create mode 160000 components/bt/lib diff --git a/.gitmodules b/.gitmodules index 1a0e6b94f..df4084826 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "components/esptool_py/esptool"] path = components/esptool_py/esptool url = https://github.com/themadinventor/esptool.git +[submodule "components/bt/lib"] + path = components/bt/lib + url = https://github.com/espressif/esp32-bt-lib.git diff --git a/components/bt/lib b/components/bt/lib new file mode 160000 index 000000000..3bee5393a --- /dev/null +++ b/components/bt/lib @@ -0,0 +1 @@ +Subproject commit 3bee5393a9dd84f53b7b28d5cb2479649f2cf838 From c6e1d0b30a0ded74459b211cf14772cbab9904a5 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 22 Sep 2016 18:36:23 +0800 Subject: [PATCH 4/8] Kconfig: make WiFi and BT mutually exclusive Also move memory map options from top-level Kconfig to esp32/Kconfig. --- Kconfig | 32 ---------------------- components/bt/Kconfig | 26 +++++++++--------- components/esp32/Kconfig | 58 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 68 insertions(+), 48 deletions(-) diff --git a/Kconfig b/Kconfig index 58ce77b2b..73770a79a 100644 --- a/Kconfig +++ b/Kconfig @@ -19,38 +19,6 @@ config PYTHON help The executable name/path that is used to run python. On some systems Python 2.x may need to be invoked as python2. - -config MEMMAP_BT - bool "Reserve space for Bluetooth stack" - default "n" - help - The Bluetooth stack uses memory that cannot be used as generic memory anymore. This - reserves the space for that within the memory map of the compiled binary. - -config MEMMAP_SMP - bool "Reserve memory for two cores" - default "y" - help - The ESP32 contains two cores. If you plan to only use one, you can disable this item - to save some memory. (ToDo: Make this automatically depend on unicore support) - -config MEMMAP_TRACEMEM - bool "Use TRAX tracing feature" - default "n" - help - The ESP32 contains a feature which allows you to trace the execution path the processor - has taken through the program. This is stored in a chunk of 32K (16K for single-processor) - of memory that can't be used for general purposes anymore. Disable this if you do not know - what this is. - -config MEMMAP_SPISRAM - bool "Use external SPI SRAM chip as main memory" - default "n" - help - The ESP32 can control an external SPI SRAM chip, adding the memory it contains to the - main memory map. Enable this if you have this hardware and want to use it in the same - way as on-chip RAM. - endmenu source "$COMPONENT_KCONFIGS_PROJBUILD" diff --git a/components/bt/Kconfig b/components/bt/Kconfig index 90ef1f3eb..ab163efc6 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -3,21 +3,21 @@ visible if MEMMAP_BT config BT_ENABLED - bool "Enable low-level BT stack" - depends on MEMMAP_BT + bool + depends on ESP32_ENABLE_STACK_BT help This compiles in the low-level BT stack. -config BT_BTLE - bool "Enable BTLE" - depends on BT_ENABLED - help - This compiles BTLE support - -config BT_BT - bool "Enable classic BT" - depends on BT_ENABLED - help - This enables classic BT support +#config BT_BTLE +# bool "Enable BTLE" +# depends on BT_ENABLED +# help +# This compiles BTLE support +# +#config BT_BT +# bool "Enable classic BT" +# depends on BT_ENABLED +# help +# This enables classic BT support endmenu diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index 0ad32756e..c649a0e31 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -20,13 +20,65 @@ config ESP32_DEFAULT_CPU_FREQ_MHZ default 160 if ESP32_DEFAULT_CPU_FREQ_160 default 240 if ESP32_DEFAULT_CPU_FREQ_240 -config WIFI_ENABLED - bool "Enable low-level WiFi stack" +choice ESP32_WIFI_OR_BT + prompt "Select stack to enable (WiFi or BT)" + default ESP32_ENABLE_WIFI + help + Temporarily, WiFi and BT stacks can not be used at the same time. + Select which stack to enable. + +config ESP32_ENABLE_STACK_WIFI + bool "WiFi" + select WIFI_ENABLED if ESP32_ENABLE_STACK_WIFI +config ESP32_ENABLE_STACK_BT + bool "BT" + select MEMMAP_BT if ESP32_ENABLE_STACK_BT + select BT_ENABLED if ESP32_ENABLE_STACK_BT +config ESP32_ENABLE_STACK_NONE + bool "None" +endchoice + +config MEMMAP_BT + bool + depends on ESP32_ENABLE_STACK_BT + help + The Bluetooth stack uses memory that cannot be used as generic memory anymore. This + reserves the space for that within the memory map of the compiled binary. + This option is required to enable BT stack. + Temporarily, this option is not compatible with WiFi stack. + +config MEMMAP_SMP + bool "Reserve memory for two cores" default "y" + help + The ESP32 contains two cores. If you plan to only use one, you can disable this item + to save some memory. (ToDo: Make this automatically depend on unicore support) + +config MEMMAP_TRACEMEM + bool "Use TRAX tracing feature" + default "n" + help + The ESP32 contains a feature which allows you to trace the execution path the processor + has taken through the program. This is stored in a chunk of 32K (16K for single-processor) + of memory that can't be used for general purposes anymore. Disable this if you do not know + what this is. + +config MEMMAP_SPISRAM + bool "Use external SPI SRAM chip as main memory" + default "n" + help + The ESP32 can control an external SPI SRAM chip, adding the memory it contains to the + main memory map. Enable this if you have this hardware and want to use it in the same + way as on-chip RAM. + +config WIFI_ENABLED + bool + default "y" + depends on ESP32_ENABLE_STACK_WIFI help This compiles in the low-level WiFi stack. - Temporarily, this option requires that FreeRTOS runs in single core mode. + Temporarily, this option is not compatible with BT stack. config WIFI_AUTO_STARTUP bool "Start WiFi with system startup" From 5383af1e2edc4ae955d84e25c4da81d3904fbf88 Mon Sep 17 00:00:00 2001 From: wangmengyang Date: Thu, 22 Sep 2016 21:15:54 +0800 Subject: [PATCH 5/8] BLE ADV Demo --- examples/04_ble_adv/LICENSE | 202 +++++++++++++++++++++++++ examples/04_ble_adv/Makefile | 9 ++ examples/04_ble_adv/README.rst | 6 + examples/04_ble_adv/main/app_bt.c | 203 ++++++++++++++++++++++++++ examples/04_ble_adv/main/component.mk | 10 ++ 5 files changed, 430 insertions(+) create mode 100644 examples/04_ble_adv/LICENSE create mode 100644 examples/04_ble_adv/Makefile create mode 100644 examples/04_ble_adv/README.rst create mode 100755 examples/04_ble_adv/main/app_bt.c create mode 100644 examples/04_ble_adv/main/component.mk diff --git a/examples/04_ble_adv/LICENSE b/examples/04_ble_adv/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/examples/04_ble_adv/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/examples/04_ble_adv/Makefile b/examples/04_ble_adv/Makefile new file mode 100644 index 000000000..cea72c6f0 --- /dev/null +++ b/examples/04_ble_adv/Makefile @@ -0,0 +1,9 @@ +# +# This is a project Makefile. It is assumed the directory this Makefile resides in is a +# project subdirectory. +# + +PROJECT_NAME := ble_adv + +include $(IDF_PATH)/make/project.mk + diff --git a/examples/04_ble_adv/README.rst b/examples/04_ble_adv/README.rst new file mode 100644 index 000000000..5e9ff15c5 --- /dev/null +++ b/examples/04_ble_adv/README.rst @@ -0,0 +1,6 @@ +ESP-IDF ble_advertising app +==================== + +This is a BLE advertising demo with virtual HCI interface. Send Reset/ADV_PARAM/ADV_DATA/ADV_ENABLE HCI command for BLE advertising. + + diff --git a/examples/04_ble_adv/main/app_bt.c b/examples/04_ble_adv/main/app_bt.c new file mode 100755 index 000000000..8449accd6 --- /dev/null +++ b/examples/04_ble_adv/main/app_bt.c @@ -0,0 +1,203 @@ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "bt.h" +#include + +#define HCI_H4_CMD_PREAMBLE_SIZE (4) + +/* HCI Command opcode group field(OGF) */ +#define HCI_GRP_HOST_CONT_BASEBAND_CMDS (0x03 << 10) /* 0x0C00 */ +#define HCI_GRP_BLE_CMDS (0x08 << 10) + +#define HCI_RESET (0x0003 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) +#define HCI_BLE_WRITE_ADV_ENABLE (0x000A | HCI_GRP_BLE_CMDS) +#define HCI_BLE_WRITE_ADV_PARAMS (0x0006 | HCI_GRP_BLE_CMDS) +#define HCI_BLE_WRITE_ADV_DATA (0x0008 | HCI_GRP_BLE_CMDS) + +#define HCIC_PARAM_SIZE_WRITE_ADV_ENABLE (1) +#define HCIC_PARAM_SIZE_BLE_WRITE_ADV_PARAMS (15) +#define HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA (31) + +#define BD_ADDR_LEN (6) /* Device address length */ +typedef uint8_t bd_addr_t[BD_ADDR_LEN]; /* Device address */ + +#define UINT16_TO_STREAM(p, u16) {*(p)++ = (uint8_t)(u16); *(p)++ = (uint8_t)((u16) >> 8);} +#define UINT8_TO_STREAM(p, u8) {*(p)++ = (uint8_t)(u8);} +#define BDADDR_TO_STREAM(p, a) {int ijk; for (ijk = 0; ijk < BD_ADDR_LEN; ijk++) *(p)++ = (uint8_t) a[BD_ADDR_LEN - 1 - ijk];} +#define ARRAY_TO_STREAM(p, a, len) {int ijk; for (ijk = 0; ijk < len; ijk++) *(p)++ = (uint8_t) a[ijk];} + +enum { + H4_TYPE_COMMAND = 1, + H4_TYPE_ACL = 2, + H4_TYPE_SCO = 3, + H4_TYPE_EVENT = 4 +}; + +static uint8_t hci_cmd_buf[128]; + +/* + * @brief: BT controller callback function, used to notify the upper layer that + * controller is ready to receive command + */ +static void controller_rcv_pkt_ready(void) +{ + printf("controller rcv pkt ready\n"); +} + +/* + * @brief: BT controller callback function, to transfer data packet to upper + * controller is ready to receive command + */ +static int host_rcv_pkt(uint8_t *data, uint16_t len) +{ + printf("host rcv pkt: "); + for (uint16_t i=0; i 0) { + if (data_len > HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA) + data_len = HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA; + + UINT8_TO_STREAM (buf, data_len); + + ARRAY_TO_STREAM (buf, p_data, data_len); + } + return HCI_H4_CMD_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA + 1; +} + +static void hci_cmd_send_reset(void) +{ + uint16_t sz = make_cmd_reset (hci_cmd_buf); + API_vhci_host_send_packet(hci_cmd_buf, sz); +} + +static void hci_cmd_send_ble_adv_start(void) +{ + uint16_t sz = make_cmd_ble_set_adv_enable (hci_cmd_buf, 1); + API_vhci_host_send_packet(hci_cmd_buf, sz); +} + +static void hci_cmd_send_ble_set_adv_param(void) +{ + uint16_t adv_intv_min = 256; // 160ms + uint16_t adv_intv_max = 256; // 160ms + uint8_t adv_type = 0; // connectable undirected advertising (ADV_IND) + uint8_t own_addr_type = 0; // Public Device Address + uint8_t peer_addr_type = 0; // Public Device Address + uint8_t peer_addr[6] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85}; + uint8_t adv_chn_map = 0x07; // 37, 38, 39 + uint8_t adv_filter_policy = 0; // Process All Conn and Scan + + uint16_t sz = make_cmd_ble_set_adv_param(hci_cmd_buf, + adv_intv_min, + adv_intv_max, + adv_type, + own_addr_type, + peer_addr_type, + peer_addr, + adv_chn_map, + adv_filter_policy); + API_vhci_host_send_packet(hci_cmd_buf, sz); +} + +static void hci_cmd_send_ble_set_adv_data(void) +{ + char *adv_name = "ESP-BLE-HELLO"; + uint8_t name_len = (uint8_t)strlen(adv_name); + uint8_t adv_data[31] = {0x02, 0x01, 0x06, 0x0, 0x09}; + uint8_t adv_data_len; + + adv_data[3] = name_len + 1; + for (int i=0; i Date: Fri, 23 Sep 2016 10:48:55 +0800 Subject: [PATCH 6/8] 1. clean up the macro. 2. change component/bt/lib url to use new lib --- components/bt/bt.c | 28 ++-- components/bt/include/bt.h | 39 ++++-- components/bt/lib | 2 +- components/esp32/include/esp_task.h | 8 +- examples/04_ble_adv/LICENSE | 202 ---------------------------- examples/04_ble_adv/main/app_bt.c | 3 +- 6 files changed, 52 insertions(+), 230 deletions(-) delete mode 100644 examples/04_ble_adv/LICENSE diff --git a/components/bt/bt.c b/components/bt/bt.c index 4b623ca20..efb6d34ee 100644 --- a/components/bt/bt.c +++ b/components/bt/bt.c @@ -24,12 +24,18 @@ #include "freertos/portmacro.h" #include "esp_types.h" #include "esp_system.h" +#include "esp_task.h" #include "esp_intr.h" #include "esp_attr.h" #include "bt.h" #if CONFIG_BT_ENABLED +/* not for user call, so don't put to include file */ +extern void btdm_osi_funcs_register(void *osi_funcs); +extern void btdm_controller_init(void); + + static bt_app_startup_cb_t app_startup_cb; static void *app_startup_ctx; @@ -43,9 +49,6 @@ do{\ }\ } while(0) -extern void btdm_controller_init(void); -extern void API_osi_funcs_register(void *osi_funcs); - struct osi_funcs_t { xt_handler (*_set_isr)(int n, xt_handler f, void *arg); void (*_ints_on)(unsigned int mask); @@ -60,17 +63,17 @@ struct osi_funcs_t { static portMUX_TYPE global_int_mux = portMUX_INITIALIZER_UNLOCKED; -static inline void IRAM_ATTR interrupt_disable(void) +static void IRAM_ATTR interrupt_disable(void) { portENTER_CRITICAL(&global_int_mux); } -static inline void IRAM_ATTR interrupt_restore(void) +static void IRAM_ATTR interrupt_restore(void) { portEXIT_CRITICAL(&global_int_mux); } -static inline void *IRAM_ATTR semphr_take_wrapped(void *semphr, uint32_t block_time) +static void * IRAM_ATTR semphr_take_wrapper(void *semphr, uint32_t block_time) { return (void *)xSemaphoreTake(semphr, block_time); } @@ -83,23 +86,24 @@ static struct osi_funcs_t osi_funcs = { ._task_yield = vPortYield, ._semphr_create = xQueueCreateCountingSemaphore, ._semphr_give_from_isr = (void *)xQueueGiveFromISR, - ._semphr_take = semphr_take_wrapped, + ._semphr_take = semphr_take_wrapper, ._read_efuse_mac = system_efuse_read_mac, }; static void bt_controller_task(void *pvParam) { - API_osi_funcs_register(&osi_funcs); + btdm_osi_funcs_register(&osi_funcs); btdm_controller_init(); } static void bt_init_task(void *pvParameters) { - xTaskCreatePinnedToCore(bt_controller_task, "btControllerTask", BT_CONTROLLER_TASK_STACK_SIZE, NULL, BT_CONTROLLER_TASK_PRIO, NULL, 0); + xTaskCreatePinnedToCore(bt_controller_task, "btControllerTask", ESP_TASK_BT_CONTROLLER_STACK, NULL, ESP_TASK_BT_CONTROLLER_PRIO, NULL, 0); - if (app_startup_cb) - app_startup_cb(app_startup_ctx); + if (app_startup_cb) { + app_startup_cb(app_startup_ctx); + } vTaskDelete(NULL); } @@ -110,7 +114,7 @@ esp_err_t esp_bt_startup(bt_app_startup_cb_t cb, void *ctx) app_startup_cb = cb; app_startup_ctx = ctx; - xTaskCreatePinnedToCore(bt_init_task, "btInitTask", BT_INIT_TASK_STACK_SIZE, NULL, BT_INIT_TASK_PRIO, NULL, 0); + xTaskCreatePinnedToCore(bt_init_task, "btInitTask", ESP_TASK_BT_INIT_STACK, NULL, ESP_TASK_BT_INIT_PRIO, NULL, 0); return ESP_OK; } diff --git a/components/bt/include/bt.h b/components/bt/include/bt.h index 04bb466c4..991b9a13f 100644 --- a/components/bt/include/bt.h +++ b/components/bt/include/bt.h @@ -4,27 +4,40 @@ #include "freertos/FreeRTOS.h" #include "esp_err.h" -#define BT_TASK_PRIO_MAX (configMAX_PRIORITIES) -#define BT_TASK_PRIO_MIN (0) - -/* bt init */ -#define BT_INIT_TASK_PRIO (BT_TASK_PRIO_MAX-1) -#define BT_INIT_TASK_STACK_SIZE (2048) -/* controller */ -#define BT_CONTROLLER_TASK_PRIO (BT_TASK_PRIO_MAX-3) -#define BT_CONTROLLER_TASK_STACK_SIZE (4096) - typedef void (* bt_app_startup_cb_t)(void *param); esp_err_t esp_bt_startup(bt_app_startup_cb_t cb, void *ctx); +/* @breif: vhci_host_callback + * used for vhci call host function to notify what host need to do + * + * notify_host_send_available: notify host can send packet to controller + * notify_host_recv: notify host that controller has packet send to host + */ typedef struct vhci_host_callback { + void (*notify_host_send_available)(void); int (*notify_host_recv)(uint8_t *data, uint16_t len); } vhci_host_callback_t; -extern bool API_vhci_host_check_send_available(void); -extern void API_vhci_host_send_packet(uint8_t *data, uint16_t len); -extern void API_vhci_host_register_callback(const vhci_host_callback_t *callback); +/* @breif: API_vhci_host_check_send_available + * used for check actively if the host can send packet to controller or not. + * return true for ready to send, false means cannot send packet + */ +bool API_vhci_host_check_send_available(void); + +/* @breif: API_vhci_host_send_packet + * host send packet to controller + * param data is the packet point, the param len is the packet length + * return void + */ +void API_vhci_host_send_packet(uint8_t *data, uint16_t len); + +/* @breif: API_vhci_host_register_callback + * register the vhci referece callback, the call back + * struct defined by vhci_host_callback structure. + * param is the vhci_host_callback type variable + */ +void API_vhci_host_register_callback(const vhci_host_callback_t *callback); #endif /* __BT_H__ */ diff --git a/components/bt/lib b/components/bt/lib index 3bee5393a..6c9a6de65 160000 --- a/components/bt/lib +++ b/components/bt/lib @@ -1 +1 @@ -Subproject commit 3bee5393a9dd84f53b7b28d5cb2479649f2cf838 +Subproject commit 6c9a6de656262113a0aab63907d6871a64e00fae diff --git a/components/esp32/include/esp_task.h b/components/esp32/include/esp_task.h index 6d98bf198..58458106f 100644 --- a/components/esp32/include/esp_task.h +++ b/components/esp32/include/esp_task.h @@ -43,6 +43,11 @@ #define ESP_TASK_WPS_PRIO (ESP_TASK_PRIO_MIN + 2) #define ESP_TASK_WPS_STACK 2048 +/* Bt contoller Task */ +/* controller */ +#define ESP_TASK_BT_CONTROLLER_PRIO (ESP_TASK_PRIO_MAX - 1) +#define ESP_TASK_BT_CONTROLLER_STACK 4096 + /* idf task */ #define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5) #define ESP_TASKD_EVENT_STACK CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE @@ -50,5 +55,6 @@ #define ESP_TASK_WIFI_STARTUP_STACK 4096 #define ESP_TASK_TCPIP_PRIO (ESP_TASK_PRIO_MAX - 7) #define ESP_TASK_TCPIP_STACK 2048 - +#define ESP_TASK_BT_INIT_PRIO (ESP_TASK_PRIO_MAX - 7) +#define ESP_TASK_BT_INIT_STACK 2048 #endif diff --git a/examples/04_ble_adv/LICENSE b/examples/04_ble_adv/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/examples/04_ble_adv/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/examples/04_ble_adv/main/app_bt.c b/examples/04_ble_adv/main/app_bt.c index 8449accd6..011cf0c71 100755 --- a/examples/04_ble_adv/main/app_bt.c +++ b/examples/04_ble_adv/main/app_bt.c @@ -110,8 +110,9 @@ static uint16_t make_cmd_ble_set_adv_data(uint8_t *buf, uint8_t data_len, uint8_ memset(buf, 0, HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA); if (p_data != NULL && data_len > 0) { - if (data_len > HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA) + if (data_len > HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA) { data_len = HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA; + } UINT8_TO_STREAM (buf, data_len); From 7b79e4c9ae3ee550868c578e63aa1b1cb0e8e005 Mon Sep 17 00:00:00 2001 From: snake Date: Fri, 23 Sep 2016 11:02:46 +0800 Subject: [PATCH 7/8] add .h license header --- components/bt/include/bt.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/bt/include/bt.h b/components/bt/include/bt.h index 991b9a13f..f8b7a8a0f 100644 --- a/components/bt/include/bt.h +++ b/components/bt/include/bt.h @@ -1,3 +1,17 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #ifndef __BT_H__ #define __BT_H__ From 6bb5a93221c4a4a74d0e4fea719ce35493630749 Mon Sep 17 00:00:00 2001 From: snake Date: Fri, 23 Sep 2016 14:54:30 +0800 Subject: [PATCH 8/8] add 'extern C' in header files --- components/bt/include/bt.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/bt/include/bt.h b/components/bt/include/bt.h index f8b7a8a0f..8511aabdf 100644 --- a/components/bt/include/bt.h +++ b/components/bt/include/bt.h @@ -18,6 +18,11 @@ #include "freertos/FreeRTOS.h" #include "esp_err.h" +#ifdef __cplusplus +extern "C" { +#endif + + typedef void (* bt_app_startup_cb_t)(void *param); esp_err_t esp_bt_startup(bt_app_startup_cb_t cb, void *ctx); @@ -54,4 +59,8 @@ void API_vhci_host_send_packet(uint8_t *data, uint16_t len); */ void API_vhci_host_register_callback(const vhci_host_callback_t *callback); +#ifdef __cplusplus +} +#endif + #endif /* __BT_H__ */