From 0ae67ff35b5754ada8b01d3dcb731d4b2a93472c Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sat, 21 May 2022 02:41:45 +0200 Subject: [PATCH] Removed set/get volume as we are not going to use it for now --- main/include/avrcp.h | 3 --- main/src/avrcp.cpp | 14 +------------- main/src/main.cpp | 4 ---- source.sh | 1 - 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/main/include/avrcp.h b/main/include/avrcp.h index 7d9117c..0b10d72 100644 --- a/main/include/avrcp.h +++ b/main/include/avrcp.h @@ -2,7 +2,4 @@ namespace avrcp { void init(); - - uint8_t get_volume(); - void set_volume(uint8_t volume); } diff --git a/main/src/avrcp.cpp b/main/src/avrcp.cpp index febd4c1..65e4d04 100644 --- a/main/src/avrcp.cpp +++ b/main/src/avrcp.cpp @@ -6,7 +6,6 @@ #define AVRCP_TAG "APP_AVRCP" -static uint8_t volume = 127; static void rc_tg_callback(esp_avrc_tg_cb_event_t event, esp_avrc_tg_cb_param_t* param) { ESP_LOGD(AVRCP_TAG, "%s evt %d", __func__, event); @@ -27,7 +26,7 @@ static void rc_tg_callback(esp_avrc_tg_cb_event_t event, esp_avrc_tg_cb_param_t* // In the future however it might be nice to sync the value on the phone, the esp and the car // This will require some sort of CAN bus access esp_avrc_rn_param_t rn_param; - rn_param.volume = volume; + rn_param.volume = 127; esp_avrc_tg_send_rn_rsp(ESP_AVRC_RN_VOLUME_CHANGE, ESP_AVRC_RN_RSP_INTERIM, &rn_param); } else { ESP_LOGW(AVRCP_TAG, "AVRC Volume Changes NOT Supported"); @@ -55,14 +54,3 @@ void avrcp::init() { ESP_LOGE(AVRCP_TAG, "esp_avrc_tg_init failed"); } } - -uint8_t avrcp::get_volume() { - return volume; -} - -void avrcp::set_volume(uint8_t v) { - volume = v; - esp_avrc_rn_param_t rn_param; - rn_param.volume = volume; - esp_avrc_tg_send_rn_rsp(ESP_AVRC_RN_VOLUME_CHANGE, ESP_AVRC_RN_RSP_CHANGED, &rn_param); -} diff --git a/main/src/main.cpp b/main/src/main.cpp index 2b2bbbc..917d0b9 100644 --- a/main/src/main.cpp +++ b/main/src/main.cpp @@ -25,9 +25,5 @@ extern "C" void app_main() { a2dp::init(); a2dp::connect_to_last(); - - vTaskDelay(10000 / portTICK_PERIOD_MS); - ESP_LOGI(APP_TAG, "Changing volume"); - avrcp::set_volume(127/2); } diff --git a/source.sh b/source.sh index 5e9223b..3f27604 100644 --- a/source.sh +++ b/source.sh @@ -1,2 +1 @@ export IDF_TOOLS_PATH=$(dirname $(readlink -f $0))/tools -