Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata + more #6

Closed
Mael19 opened this issue Oct 14, 2020 · 5 comments
Closed

Metadata + more #6

Mael19 opened this issue Oct 14, 2020 · 5 comments

Comments

@Mael19
Copy link

Mael19 commented Oct 14, 2020

Hello, first of all thank you so much for your library which is so simple and nice !

I'd like to know if it is possible to retrieve the metadata (ie. title and artist) from the bluetooth ?

Also, at least on my iPhone I usually get a "headphones" symbol in the status bar when I connect a bluetooth speaker. Here I got nothing, would it be possible to have it ? I guess I would have to tell the phone what type of bluetooth device is connected.

Finally, but maybe that's too much to ask, with some bluetooth devices, my iPhone is capable of showing the battery level. Since my project is battery powered and I already know the level, would it be possible to send that as well ?

Best regards,
Mael

@JohnyMielony
Copy link
Contributor

JohnyMielony commented Dec 8, 2020

Simple answer is yes. And it's already implemented in this library.
Here

esp_avrc_ct_send_metadata_cmd(0, ESP_AVRC_MD_ATTR_TITLE | ESP_AVRC_MD_ATTR_ARTIST | ESP_AVRC_MD_ATTR_ALBUM | ESP_AVRC_MD_ATTR_GENRE);
you're telling what you want to get.
And here
case ESP_AVRC_CT_METADATA_RSP_EVT: {
you're getting that.
More information about that can be read in ESP32 documentation (https://docs.espressif.com/projects/esp-idf/en/v3.3/api-reference/bluetooth/esp_avrc.html).

@Mael19
Copy link
Author

Mael19 commented Dec 9, 2020

Thank you so much for your answer! I went trough the code and it seems that everything I asked is indeed possible. Now I have to find the time and courage to go deeper in the code to understand how it works, it'a maybe a bit over my skills!
Cheers.

@pschatzmann
Copy link
Owner

I think it would be cool to have some callbacks to make it easy to use.

@DrNeuroSurg
Copy link

I think it would be cool to have some callbacks to make it easy to use.

Yes, it should. But I would also like a callback for connection state changes, so I could notify the user about this, e.g. let a LED blink or so ..

@pschatzmann
Copy link
Owner

Support for a metadata callback has been added with the latest commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants