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

Get CompanyID and Manufacturer Data on discovery callback #23

Closed
mamigot-salto opened this issue Feb 19, 2024 · 3 comments
Closed

Get CompanyID and Manufacturer Data on discovery callback #23

mamigot-salto opened this issue Feb 19, 2024 · 3 comments

Comments

@mamigot-salto
Copy link

mamigot-salto commented Feb 19, 2024

Hello! First of all I'd like to thank you for the awesome work you've done with this bluez_inc library. Thank you so much!

Ok, here is the issue I'm struggling with and hopefully you can help me with: I'd like to parse as a byte array the manufacturer data that is included within the advertisement packet from a peripheral device, but the binc_device_get_manufacturer_data method returns a pointer to a GHashTable which honestly I don't know how to process. What is the key that I should look for in that hash table so I can check the Company ID that is advertised? How can I parse the actual manufacture data that is included, is it a key or a value in the hash table? How is the data inserted in that hash table: as string or as byte array?

Thank you in advance

@weliem
Copy link
Owner

weliem commented Feb 20, 2024

https://docs.gtk.org/glib/struct.HashTable.html

Use one of the GHastable functions to get the keys

@weliem
Copy link
Owner

weliem commented Feb 20, 2024

The key is a *int and the value is a GByteArray

@mamigot-salto
Copy link
Author

Thanks a lot for your rapid response! This confirms what I found yesterday at the last minute before going home from the office. Sorry for the inconveniences. And again, congratulations and thanks for the great job with this library!

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

2 participants