summaryrefslogtreecommitdiffstats
path: root/btif
diff options
context:
space:
mode:
Diffstat (limited to 'btif')
-rwxr-xr-xbtif/src/btif_core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index 62339a9..19ebae1 100755
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
@@ -130,7 +130,7 @@ extern void bte_load_did_conf(const char *p_path);
/** TODO: Move these to _common.h */
void bte_main_boot_entry(void);
-void bte_main_enable(uint8_t *local_addr);
+bt_status_t bte_main_enable(uint8_t *local_addr);
void bte_main_disable(void);
void bte_main_shutdown(void);
#if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE)
@@ -502,6 +502,8 @@ static bt_status_t btif_associate_evt(void)
bt_status_t btif_enable_bluetooth(void)
{
+ bt_status_t status;
+
BTIF_TRACE_DEBUG0("BTIF ENABLE BLUETOOTH");
if (btif_core_state != BTIF_CORE_STATE_DISABLED)
@@ -513,9 +515,11 @@ bt_status_t btif_enable_bluetooth(void)
btif_core_state = BTIF_CORE_STATE_ENABLING;
/* Create the GKI tasks and run them */
- bte_main_enable(btif_local_bd_addr.address);
+ status = bte_main_enable(btif_local_bd_addr.address);
+ if (status != BT_STATUS_SUCCESS)
+ btif_core_state = BTIF_CORE_STATE_DISABLED;
- return BT_STATUS_SUCCESS;
+ return status;
}