-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Bluetooth: userchan: Support TCP fragmentation of HCI packets #70322
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
Bluetooth: userchan: Support TCP fragmentation of HCI packets #70322
Conversation
|
Hello @patstew, and thank you very much for your first pull request to the Zephyr project! |
jhedberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does Linux HCI user channel sockets have to do with TCP? The Linux kernel should ensure that you always get entire packet frames when reading from a userchan socket. The userchan HCI driver in Zephyr takes advantage of this, and there are also BlueZ tools which assume the same. Could you describe your setup a little more in detail, assuming that you're actually seeing the need for this change in practice?
|
That code is also used in native_sim for TCP HCI emulation. e.g. See https://docs.zephyrproject.org/latest/boards/native/native_sim/doc/index.html#peripherals I'm using that to connect to a controller, the controller in question doesn't write packets in their entireity at once, so Zephyr fails to read the responses from it. But assuming that one write == one read in TCP is completely wrong anyway. |
|
@patstew thanks for the clarification. I had completely forgotten that our userchan driver had been extended with TCP support (curiously, even though I was the assignee in the original feature PR, it got merged without my approval). Btw, I think we might want to consider renaming the driver since its name still implies that it's only about user channel sockets. |
|
CC @vChavezB |
6495603 to
ddff897
Compare
|
Just added two comments on the changes. They are minor details but hope they help. Thanks for the contribution 👍 I am happy to know that other users are taking advantage of connecting Zephyr BT applications to other external controllers. |
ae1ef3b to
4f03938
Compare
Keep reading from the HCI socket when a packet is incomplete. The other end may not write entire packets, or TCP could fragment in the middle of a packet. Also fix a potential infinite loop by advancing to the next packet before any continue statements. Signed-off-by: Patrick Stewart <[email protected]>
4f03938 to
1eaebf0
Compare
|
Looks good to me, I think you just need to await feedback from the code owners or collaborators of the project. |
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
I'd like the stale label removed (and for someone else to review it) |
|
Hi @patstew! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
Keep reading from the HCI socket when a packet is incomplete. The other end may not write entire packets, or TCP could fragment in the middle of a packet.
Also fix a potential infinite loop by advancing to the next packet before any continue statements.