Allow users to set the broadcast code on BAP sinks #863
vlad-pruteanu
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On the source side the Broadcast Code is controlled via the PipeWire config file. A future update will also add support for controlling the "encryption" flag, from the same config file.
On the sink side we need to add mechanism that allows the user to enter the Broadcast Code. After the sink device has finished the PA sync procedure, it will begin receiving BIG Info reports, which contain the encryption flag. My proposal is to implement a mechanism like the one used for handling the PIN code. We can skip the mgmt interactions with the kernel since the broadcast code can be set in BlueZ at BAP level.
Functions marked with * are new and will be created.
Split iso_do_big_sync into 2 parts: iso_setup_big_sync (makes necessary initializations) and iso_do_big_sync (calls bt_io_bcast_accept).
In iso_setup_big_sync, check the encryption flag. If it isn’t set, proceed with iso_do_big_sync, otherwise call device_request_bcode. This function is similar to device_request_pincode, with the main difference being that pa_req and set_bcode will also be passed as parameters.
agent_request_bcode is based on agent_request_pincode, and it registers set_bcode as the callback for this agent request.
After this, the flow is similar to the one for PIN code handling, until bcode_reply is called. Here the callback set_bcode is called which sets the bcode and calls iso_do_big_sync.
Note: pincode_response function can be reused as it already does what bcode_response would need to. If reusing this function makes the code harder to understand I can create a separate bcode_response function.
Beta Was this translation helpful? Give feedback.
All reactions