From 65445b21ddef3068aec8396ddc63542f712ad185 Mon Sep 17 00:00:00 2001 From: yulong Date: Thu, 13 Oct 2016 04:02:30 -0400 Subject: [PATCH] commponent bt:1.add bt_prf_act.c file for the state machine 2.add the bt_app_api.h file 3.modified the bt_prf_task.c==>added the free & start task function --- .../bt/bluedroid/profiles/core/bt_prf_task.c | 44 ++++++++++++++++++- .../bluedroid/profiles/core/bt_profile_act.c | 17 +++++++ .../profiles/core/include/bt_prf_task.h | 1 + .../bluedroid_demos/include/bt_app_api.h | 18 ++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 components/bt/bluedroid/profiles/core/bt_profile_act.c create mode 100644 examples/06_bluedroid_demos/components/bluedroid_demos/include/bt_app_api.h diff --git a/components/bt/bluedroid/profiles/core/bt_prf_task.c b/components/bt/bluedroid/profiles/core/bt_prf_task.c index def36b1371..7163f508a9 100644 --- a/components/bt/bluedroid/profiles/core/bt_prf_task.c +++ b/components/bt/bluedroid/profiles/core/bt_prf_task.c @@ -66,7 +66,49 @@ void bt_prf_task_start_up(void) fixed_queue_register_dequeue(bt_profile_msg_queue, bt_profile_msg_ready); } - +void btu_task_shut_down(void) +{ + fixed_queue_unregister_dequeue(bt_profile_msg_queue); + + bt_prf_free_core(); +} + + +void bt_prf_StartUp(void) +{ + bt_profile_msg_queue = fixed_queue_new(SIZE_MAX); + if (bt_profile_msg_queue == NULL) + goto error_exit; + + return; + +error_exit:; + LOG_ERROR("%s Unable to allocate resources for bt_workqueue\n", __func__); + bt_prf_ShutDown(); + +} + +void bt_prf_ShutDown(void) +{ + + btu_task_shut_down(); + + //thread_free(bt_workqueue_thread); + vTaskDelete(xProfileTaskHandle); + vQueueDelete(xProfileQueue); + + bt_profile_msg_queue = NULL; + + // bt_workqueue_thread = NULL; + xProfileTaskHandle = NULL; + xProfileQueue = 0; +} + + +void bt_prf_free_core(void) +{ + +} diff --git a/components/bt/bluedroid/profiles/core/bt_profile_act.c b/components/bt/bluedroid/profiles/core/bt_profile_act.c new file mode 100644 index 0000000000..df75d780fd --- /dev/null +++ b/components/bt/bluedroid/profiles/core/bt_profile_act.c @@ -0,0 +1,17 @@ +/** + **************************************************************************************** + * + * @file bt_profile_act.c + * + * @brief Application entry point + * + * Copyright (C) Espressif 2016 + * Created by Yulong at 2016/10/13 + * + * + **************************************************************************************** + */ + + + + diff --git a/components/bt/bluedroid/profiles/core/include/bt_prf_task.h b/components/bt/bluedroid/profiles/core/include/bt_prf_task.h index 6cb30905e8..3537522262 100644 --- a/components/bt/bluedroid/profiles/core/include/bt_prf_task.h +++ b/components/bt/bluedroid/profiles/core/include/bt_prf_task.h @@ -13,6 +13,7 @@ */ #include +#include "bt_defs.h" #include "fixed_queue.h" #ifndef BT_PRF_TASK_H__ diff --git a/examples/06_bluedroid_demos/components/bluedroid_demos/include/bt_app_api.h b/examples/06_bluedroid_demos/components/bluedroid_demos/include/bt_app_api.h new file mode 100644 index 0000000000..41c573da1c --- /dev/null +++ b/examples/06_bluedroid_demos/components/bluedroid_demos/include/bt_app_api.h @@ -0,0 +1,18 @@ +/** + **************************************************************************************** + * + * @file bt_app_api.h + * + * @brief Application entry point + * + * Copyright (C) Espressif 2016 + * Created by Yulong at 2016/10/13 + * + * + **************************************************************************************** + */ + + + + +