-
Notifications
You must be signed in to change notification settings - Fork 380
fix(bluetooth): Correct HCI packet type from SCO to ISO in USB host. #394
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
Conversation
📝 WalkthroughWalkthroughA case label in the USB Bluetooth HCI receive function was modified from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Actionable comments posted: 1
Fix all issues with AI Agents 🤖
In @third_party/zephyr_bluetooth-2.7.5/ble_hci_usbh.c:
- Around line 220-222: The USB_BLUETOOTH_HCI_ISO packets are not routed to the
ISO receive path; update the switch handling for USB_BLUETOOTH_HCI_ISO to call
usbh_bt_iso_recv(data, remaining) so incoming ISO packets follow the same ISO
path as outgoing BT_BUF_ISO_OUT (align receive/send behavior). Locate the switch
that handles USB packet types (case USB_BLUETOOTH_HCI_ISO) and replace the old
SCO or incorrect handler with a call to usbh_bt_iso_recv, ensuring the break
remains after the call.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
common/usb_def.hdocs/source/demo/usbd_winusb.rstthird_party/zephyr_bluetooth-2.7.5/ble_hci_usbh.c
🔇 Additional comments (5)
docs/source/demo/usbd_winusb.rst (4)
4-5: LGTM! Clear explanation of WinUSB and version requirements.The updated description clarifies that WinUSB is essentially CDC ACM without baud rate commands, and importantly notes that V2 requires USB 2.1 in the device descriptor. This is critical information for developers implementing WinUSB support.
7-7: LGTM! Important troubleshooting guidance.This note provides valuable troubleshooting information about registry cleanup when descriptor changes cause enumeration issues. The specific registry path (
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags) is helpful for developers debugging Windows enumeration problems.
13-41: LGTM! Improved documentation structure with explicit examples.The new structure clearly distinguishes V1 and V2 descriptor registration approaches with:
- Complete struct initialization examples showing all required callbacks
- Alternative registration using individual API calls
This makes it much easier for developers to understand the differences between V1 and V2 implementations.
55-55: LGTM! Concise and appropriate simplification.The simplified note appropriately references CDC ACM for read/write operations rather than repeating the same information, improving documentation maintainability.
common/usb_def.h (1)
739-750: The MSOS 1.0 string descriptor signature is correct.The signature "MSFT100" matches the official Microsoft OS 1.0 String Descriptor specification. The macro correctly encodes this as UTF-16LE characters ('M', 0, 'S', 0, 'F', 0, 'T', 0, '1', 0, '0', 0, '0', 0), and the total descriptor length of 0x12 (18 bytes) is correct.
45348ee to
0e51e3c
Compare
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.
Actionable comments posted: 0
♻️ Duplicate comments (1)
third_party/zephyr_bluetooth-2.7.5/ble_hci_usbh.c (1)
220-222: LGTM! ISO packet routing is now correctly aligned.The case label change from
USB_BLUETOOTH_HCI_SCOtoUSB_BLUETOOTH_HCI_ISOproperly routes ISO packets to the appropriate handler, ensuring receive and send paths are consistent (matching line 267 in the send path).
🧹 Nitpick comments (1)
third_party/zephyr_bluetooth-2.7.5/ble_hci_usbh.c (1)
183-187: Clarify the commented-out payload length validation.The ISO receive function has payload length validation commented out, unlike the ACL receive function (line 141) which actively validates payload length. Consider documenting why this validation is disabled for ISO packets or re-enabling it if appropriate.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.