Removed set/get volume as we are not going to use it for now

This commit is contained in:
Dreaded_X 2022-05-21 02:41:45 +02:00
parent 49c06fceb5
commit 0ae67ff35b
Signed by: Dreaded_X
GPG Key ID: 76BDEC4E165D8AD9
4 changed files with 1 additions and 21 deletions

View File

@ -2,7 +2,4 @@
namespace avrcp { namespace avrcp {
void init(); void init();
uint8_t get_volume();
void set_volume(uint8_t volume);
} }

View File

@ -6,7 +6,6 @@
#define AVRCP_TAG "APP_AVRCP" #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) { 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); 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 // 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 // This will require some sort of CAN bus access
esp_avrc_rn_param_t rn_param; 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); esp_avrc_tg_send_rn_rsp(ESP_AVRC_RN_VOLUME_CHANGE, ESP_AVRC_RN_RSP_INTERIM, &rn_param);
} else { } else {
ESP_LOGW(AVRCP_TAG, "AVRC Volume Changes NOT Supported"); 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"); 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);
}

View File

@ -25,9 +25,5 @@ extern "C" void app_main() {
a2dp::init(); a2dp::init();
a2dp::connect_to_last(); a2dp::connect_to_last();
vTaskDelay(10000 / portTICK_PERIOD_MS);
ESP_LOGI(APP_TAG, "Changing volume");
avrcp::set_volume(127/2);
} }

View File

@ -1,2 +1 @@
export IDF_TOOLS_PATH=$(dirname $(readlink -f $0))/tools export IDF_TOOLS_PATH=$(dirname $(readlink -f $0))/tools