]> granicus.if.org Git - esp-idf/commitdiff
component/bt : modify some files adapt to new master
authorTian Hao <tianhao@espressif.com>
Fri, 7 Oct 2016 02:47:25 +0000 (10:47 +0800)
committerTian Hao <tianhao@espressif.com>
Fri, 7 Oct 2016 02:47:25 +0000 (10:47 +0800)
1. fix some header files include
2. modify demo

21 files changed:
components/bt/bluedroid/hci/hci_hal_h4.c
components/bt/bluedroid/hci/hci_layer.c
components/bt/bluedroid/include/bt_defs.h
components/bt/bluedroid/include/bt_trace.h
components/bt/include/bt.h
examples/05_bluedroid_demos/sdkconfig [deleted file]
examples/06_bluedroid_demos/Makefile [moved from examples/05_bluedroid_demos/Makefile with 100% similarity]
examples/06_bluedroid_demos/README.rst [moved from examples/05_bluedroid_demos/README.rst with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/app_client_profiles/battery_c/battery_c.c [moved from examples/05_bluedroid_demos/components/bluedroid_demos/app_client_profiles/battery_c/battery_c.c with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/app_core/bt_app.c [moved from examples/05_bluedroid_demos/components/bluedroid_demos/app_core/bt_app.c with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/app_core/bt_app_core.c [moved from examples/05_bluedroid_demos/components/bluedroid_demos/app_core/bt_app_core.c with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/app_profiles/app_sample_button/app_button.c [moved from examples/05_bluedroid_demos/components/bluedroid_demos/app_profiles/app_sample_button/app_button.c with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/app_project/SampleClientProject.c [moved from examples/05_bluedroid_demos/components/bluedroid_demos/app_project/SampleClientProject.c with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/app_project/SampleServerProject.c [moved from examples/05_bluedroid_demos/components/bluedroid_demos/app_project/SamleServerProject.c with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/component.mk [moved from examples/05_bluedroid_demos/components/bluedroid_demos/component.mk with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/include/app_button.h [moved from examples/05_bluedroid_demos/components/bluedroid_demos/include/app_button.h with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/include/bt_app_common.h [moved from examples/05_bluedroid_demos/components/bluedroid_demos/include/bt_app_common.h with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/include/bt_app_defs.h [moved from examples/05_bluedroid_demos/components/bluedroid_demos/include/bt_app_defs.h with 100% similarity]
examples/06_bluedroid_demos/components/bluedroid_demos/include/gattc_profile.h [moved from examples/05_bluedroid_demos/components/bluedroid_demos/include/gattc_profile.h with 100% similarity]
examples/06_bluedroid_demos/main/component.mk [moved from examples/05_bluedroid_demos/main/component.mk with 100% similarity]
examples/06_bluedroid_demos/main/demo_main.c [moved from examples/05_bluedroid_demos/main/demo_main.c with 80% similarity]

index 2a9ee3e3319c4089eebab270d3133333fd9b5f2c..19e5a4ba5b38a43e78bd84a12d9b2e271dd1fa40 100755 (executable)
@@ -24,8 +24,8 @@
 #include "hci_hal.h"
 #include "hci_internals.h"
 #include "hci_layer.h"
-
 #include "thread.h"
+#include "bt.h"
 
 #define HCI_HAL_SERIAL_BUFFER_SIZE 1026
 #define HCI_BLE_EVENT 0x3e
index 9f368f83252f92b99f2c864eda5bc629abced08f..4ee3df2445377d6e3e63174f7004b97c9d18e3f3 100755 (executable)
@@ -16,7 +16,7 @@
  *
  ******************************************************************************/
 #include <string.h>
-
+#include "bt.h"
 #include "bt_defs.h"
 #include "bt_trace.h"
 #include "hcidefs.h"
index 283270ba9e6354c2708e562d00af37fe6f633d48..556123632bd80c8fee2ab122ec9a2eaa644e1a31 100755 (executable)
@@ -69,7 +69,7 @@ inline uint32_t swap_byte_32(uint32_t x) {
           ((x & 0x00ff0000UL) >> 8) |
           ((x & 0xff000000UL) >> 24));
 }
-
+#ifndef ntohs
 inline uint16_t ntohs(uint16_t x) {
 #ifdef CPU_LITTLE_ENDIAN
   return swap_byte_16(x);
@@ -77,14 +77,6 @@ inline uint16_t ntohs(uint16_t x) {
   return x;
 #endif
 }
-
-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;
-
-bool API_vhci_host_check_send_available(void);
-void API_vhci_host_send_packet(uint8_t *data, uint16_t len);
-void API_vhci_host_register_callback(const vhci_host_callback_t *callback);
+#endif
 
 #endif /* _BT_DEFS_H_ */
index 17cfe519164477f853ff1361890c7a830de9bdaf..06b25e60a268c83edf1c43eff25e5844d3ccd28a 100755 (executable)
@@ -24,7 +24,9 @@
 #include "rom/ets_sys.h"
 //extern void ets_printf(const char *fmt, ...);
 
+#ifndef assert
 #define assert(x)      do { if (!(x)) ets_printf("bt host error %s %u\n", __FILE__, __LINE__); } while (0)
+#endif
 
 inline void trc_dump_buffer(uint8_t *prefix, uint8_t *data, uint16_t len)
 {
index 1e89f96aa1a328acf3f12107cea252c929a58dc8..62a3e60f7e73f538fcab672f03476a163342c8cb 100644 (file)
@@ -16,6 +16,7 @@
 #define __BT_H__
 
 #include <stdint.h>
+#include <stdbool.h>
 #include "esp_err.h"
 
 #ifdef __cplusplus
diff --git a/examples/05_bluedroid_demos/sdkconfig b/examples/05_bluedroid_demos/sdkconfig
deleted file mode 100644 (file)
index 3d1d31d..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#
-# Automatically generated file; DO NOT EDIT.
-# Espressif IoT Development Framework Configuration
-#
-
-#
-# SDK tool configuration
-#
-CONFIG_TOOLPREFIX="xtensa-esp32-elf-"
-CONFIG_PYTHON="python"
-
-#
-# Bootloader config
-#
-# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
-# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
-CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y
-# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set
-# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
-# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
-CONFIG_LOG_BOOTLOADER_LEVEL=2
-
-#
-# Serial flasher config
-#
-CONFIG_ESPTOOLPY_PORT="/dev/tty.usbserial-AK05BX2L"
-# CONFIG_ESPTOOLPY_BAUD_115200B is not set
-# CONFIG_ESPTOOLPY_BAUD_230400B is not set
-CONFIG_ESPTOOLPY_BAUD_921600B=y
-# CONFIG_ESPTOOLPY_BAUD_2MB is not set
-# CONFIG_ESPTOOLPY_BAUD_OTHER is not set
-CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200
-CONFIG_ESPTOOLPY_BAUD=921600
-CONFIG_ESPTOOLPY_COMPRESSED=y
-# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set
-# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set
-CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
-# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set
-CONFIG_ESPTOOLPY_FLASHMODE="dio"
-# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set
-CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
-# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
-# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
-CONFIG_ESPTOOLPY_FLASHFREQ="40m"
-
-#
-# Partition Table
-#
-CONFIG_PARTITION_TABLE_SINGLE_APP=y
-# CONFIG_PARTITION_TABLE_TWO_OTA is not set
-# CONFIG_PARTITION_TABLE_CUSTOM is not set
-CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET=0x10000
-CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
-CONFIG_APP_OFFSET=0x10000
-
-#
-# Component config
-#
-
-#
-# BT config
-#
-CONFIG_BT_ENABLED=y
-
-#
-# ESP32-specific config
-#
-CONFIG_ESP32_DEFAULT_CPU_FREQ_80=y
-# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set
-# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set
-CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=80
-# CONFIG_ESP32_ENABLE_STACK_WIFI is not set
-CONFIG_ESP32_ENABLE_STACK_BT=y
-# CONFIG_ESP32_ENABLE_STACK_NONE is not set
-CONFIG_MEMMAP_BT=y
-CONFIG_MEMMAP_SMP=y
-# CONFIG_MEMMAP_TRACEMEM is not set
-# CONFIG_MEMMAP_SPISRAM is not set
-CONFIG_NEWLIB_STDOUT_ADDCR=y
-
-#
-# FreeRTOS
-#
-# CONFIG_FREERTOS_UNICORE is not set
-CONFIG_FREERTOS_CORETIMER_0=y
-# CONFIG_FREERTOS_CORETIMER_1 is not set
-# CONFIG_FREERTOS_CORETIMER_2 is not set
-CONFIG_FREERTOS_HZ=100
-CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE=y
-# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set
-# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY is not set
-CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
-# CONFIG_FREERTOS_PANIC_PRINT_HALT is not set
-CONFIG_FREERTOS_PANIC_PRINT_REBOOT=y
-# CONFIG_FREERTOS_PANIC_SILENT_REBOOT is not set
-# CONFIG_FREERTOS_PANIC_GDBSTUB is not set
-CONFIG_FREERTOS_DEBUG_OCDAWARE=y
-CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y
-# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set
-# CONFIG_FREERTOS_ASSERT_DISABLE is not set
-CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START_JTAG=y
-# CONFIG_ENABLE_MEMORY_DEBUG is not set
-# CONFIG_FREERTOS_DEBUG_INTERNALS is not set
-
-#
-# Log output
-#
-# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
-# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
-# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
-CONFIG_LOG_DEFAULT_LEVEL_INFO=y
-# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
-# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
-CONFIG_LOG_DEFAULT_LEVEL=3
-CONFIG_LOG_COLORS=y
-
-#
-# LWIP
-#
-CONFIG_LWIP_MAX_SOCKETS=4
-CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX=0
-# CONFIG_LWIP_SO_REUSE is not set
similarity index 80%
rename from examples/05_bluedroid_demos/main/demo_main.c
rename to examples/06_bluedroid_demos/main/demo_main.c
index b8b6296296b82b1cfadf6004f24c755027813896..4c9e71a16a43f58988cecfc99d6483770a4cbc3b 100644 (file)
@@ -1,6 +1,10 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "bt.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
+#include "string.h"
 
 
 extern void bte_main_boot_entry(void *);
@@ -15,8 +19,9 @@ void pingTask(void *pvParameters)
     }
 }
 
-void bt_app_main()
+void app_main()
 {
+    bt_controller_init();
     xTaskCreatePinnedToCore(&pingTask, "pingTask", 2048, NULL, 5, NULL, 0);
     bt_app_task_start_up();
     bte_main_boot_entry(bt_app_core_start);