diff options
-rwxr-xr-x | include/bdroid_wingray.txt | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | main/bte_main.c | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/bdroid_wingray.txt b/include/bdroid_wingray.txt index 3d93877..997e609 100755 --- a/include/bdroid_wingray.txt +++ b/include/bdroid_wingray.txt @@ -173,3 +173,4 @@ BTIF_HSAG_SERVICE_NAME = ("Headset Gateway") BTIF_HFAG_SERVICE_NAME = ("Handsfree Gateway") BTIF_HF_SERVICES = (BTA_HSP_SERVICE_MASK) BTIF_HF_SERVICE_NAMES = { BTIF_HSAG_SERVICE_NAME } +BT_CLEAN_TURN_ON_DISABLED = TRUE diff --git a/main/bte_main.c b/main/bte_main.c index f724bae..4f63d42 100644..100755 --- a/main/bte_main.c +++ b/main/bte_main.c @@ -207,9 +207,24 @@ void bte_main_enable(uint8_t *local_addr) if (hci_logging_enabled == TRUE) bt_hc_if->logging(BT_HC_LOGGING_ON, hci_logfile); +#if (defined (BT_CLEAN_TURN_ON_DISABLED) && BT_CLEAN_TURN_ON_DISABLED == TRUE) + APPL_TRACE_DEBUG1("%s Not Turninig Off the BT before Turninig ON", __FUNCTION__); + + /* Do not power off the chip before powering on if BT_CLEAN_TURN_ON_DISABLED flag + is defined and set to TRUE to avoid below mentioned issue. + + Wingray kernel driver maintains a combined counter to keep track of + BT-Wifi state. Invoking set_power(BT_HC_CHIP_PWR_OFF) when the BT is already + in OFF state causes this counter to be incorrectly decremented and results in undesired + behavior of the chip. + + This is only a workaround and when the issue is fixed in the kernel this work around + should be removed. */ +#else /* toggle chip power to ensure we will reset chip in case a previous stack shutdown wasn't completed gracefully */ bt_hc_if->set_power(BT_HC_CHIP_PWR_OFF); +#endif bt_hc_if->set_power(BT_HC_CHIP_PWR_ON); bt_hc_if->preload(NULL); |