forked from pschatzmann/ESP32-A2DP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6d5462
commit a730f60
Showing
11 changed files
with
119 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# | ||
# "main" pseudo-component makefile. | ||
# | ||
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
#ifndef ARDUINO_ARCH_ESP32 | ||
|
||
#include "BluetoothA2DPCommon.h" | ||
|
||
/** | ||
* @brief Startup logic as implemented by Arduino - This is not available if we use this library outside of Arduino | ||
* | ||
* @return true | ||
* @return false | ||
*/ | ||
bool btStart(){ | ||
esp_bt_controller_config_t cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); | ||
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){ | ||
return true; | ||
} | ||
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){ | ||
esp_bt_controller_init(&cfg); | ||
while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){} | ||
} | ||
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){ | ||
if (esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT)) { | ||
ESP_LOGE(APP, "BT Enable failed"); | ||
return false; | ||
} | ||
} | ||
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){ | ||
return true; | ||
} | ||
ESP_LOGE(APP, "BT Start failed"); | ||
return false; | ||
} | ||
|
||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.