You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "jxqnzzj (via GitHub)" <gi...@apache.org> on 2024/10/15 14:54:26 UTC
[PR] bluetooth: fix can not receive hci data [nuttx]
jxqnzzj opened a new pull request, #14333:
URL: https://github.com/apache/nuttx/pull/14333
in btuart_rxwork, read data in blocking mode and btuart_read do three times, maybe remote send some packets one time,so it wont read the sencond packets.
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
## Summary
*Update this section with information on why change is necessary,
what it exactly does and how, if new feature shows up, provide
references (dependencies, similar problems and solutions), etc.*
## Impact
*Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.*
## Testing
*Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bluetooth: fix can not receive hci data [nuttx]
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #14333:
URL: https://github.com/apache/nuttx/pull/14333#discussion_r1801706588
##########
drivers/wireless/bluetooth/bt_bridge.c:
##########
@@ -411,6 +415,45 @@ static int bt_bridge_open(FAR struct bt_driver_s *drv)
return OK;
}
+static int bt_bridge_send_reset_response(FAR struct bt_driver_s *driver)
+{
+ uint8_t reset_response[6];
+
+ reset_response[0] = BT_HCI_EVT_CMD_COMPLETE;
+ reset_response[1] = 0x04;
+ reset_response[2] = 0x01;
+ reset_response[3] = BT_HCI_OP_RESET & 0xff;
+ reset_response[4] = (BT_HCI_OP_RESET >> 8) & 0xff;
+ reset_response[5] = BT_HCI_SUCCESS;
+
+ return bt_netdev_receive(driver, BT_EVT, reset_response,
+ sizeof(reset_response));
+}
+
+static inline bool bt_bridge_filter_command(FAR struct bt_bridge_s *bridge,
Review Comment:
Do we really need `inline` here?
##########
drivers/wireless/bluetooth/bt_bridge.c:
##########
@@ -411,6 +415,45 @@ static int bt_bridge_open(FAR struct bt_driver_s *drv)
return OK;
}
+static int bt_bridge_send_reset_response(FAR struct bt_driver_s *driver)
+{
+ uint8_t reset_response[6];
+
+ reset_response[0] = BT_HCI_EVT_CMD_COMPLETE;
+ reset_response[1] = 0x04;
+ reset_response[2] = 0x01;
+ reset_response[3] = BT_HCI_OP_RESET & 0xff;
+ reset_response[4] = (BT_HCI_OP_RESET >> 8) & 0xff;
+ reset_response[5] = BT_HCI_SUCCESS;
+
+ return bt_netdev_receive(driver, BT_EVT, reset_response,
+ sizeof(reset_response));
+}
+
+static inline bool bt_bridge_filter_command(FAR struct bt_bridge_s *bridge,
+ FAR struct bt_driver_s *driver,
+ uint8_t *data)
Review Comment:
```suggestion
FAR uint8_t *data)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bluetooth: fix can not receive hci data [nuttx]
Posted by "GUIDINGLI (via GitHub)" <gi...@apache.org>.
GUIDINGLI commented on PR #14333:
URL: https://github.com/apache/nuttx/pull/14333#issuecomment-2415844696
close, use PR: https://github.com/apache/nuttx/pull/14224
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bluetooth: fix can not receive hci data [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #14333:
URL: https://github.com/apache/nuttx/pull/14333#discussion_r1802414489
##########
drivers/wireless/bluetooth/Kconfig:
##########
@@ -85,4 +85,25 @@ config BLUETOOTH_RPMSG
depends on EXPERIMENTAL && RPTUN
default n
+config BLUETOOTH_SLIP
Review Comment:
wherethe driver code
##########
drivers/wireless/bluetooth/bt_bridge.c:
##########
@@ -430,9 +430,9 @@ static int bt_bridge_send_reset_response(FAR struct bt_driver_s *driver)
sizeof(reset_response));
}
-static inline bool bt_bridge_filter_command(FAR struct bt_bridge_s *bridge,
+static bool bt_bridge_filter_command(FAR struct bt_bridge_s *bridge,
Review Comment:
merge to previous patch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bluetooth: fix can not receive hci data [nuttx]
Posted by "GUIDINGLI (via GitHub)" <gi...@apache.org>.
GUIDINGLI closed pull request #14333: bluetooth: fix can not receive hci data
URL: https://github.com/apache/nuttx/pull/14333
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bluetooth: fix can not receive hci data [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #14333:
URL: https://github.com/apache/nuttx/pull/14333#discussion_r1802413421
##########
drivers/wireless/bluetooth/bt_bridge.c:
##########
@@ -430,9 +430,9 @@ static int bt_bridge_send_reset_response(FAR struct bt_driver_s *driver)
sizeof(reset_response));
}
-static inline bool bt_bridge_filter_command(FAR struct bt_bridge_s *bridge,
+static bool bt_bridge_filter_command(FAR struct bt_bridge_s *bridge,
FAR struct bt_driver_s *driver,
- uint8_t *data)
+ FAR uint8_t *data)
Review Comment:
align
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bluetooth: fix can not receive hci data [nuttx]
Posted by "nuttxpr (via GitHub)" <gi...@apache.org>.
nuttxpr commented on PR #14333:
URL: https://github.com/apache/nuttx/pull/14333#issuecomment-2414253660
[**\[Experimental Bot, please feedback here\]**](https://github.com/search?q=repo%3Aapache%2Fnuttx+13552&type=issues)
The provided PR description does not meet the NuttX requirements. Here's why and how to improve it:
**Missing Information:**
* **Insufficient Summary:**
* **Why is the change necessary?** The description vaguely mentions a "hci driver bug" and a problem with `btuart_rxwork` and `btuart_read`, but doesn't clearly explain the bug's symptoms or root cause.
* **What functional part of the code is changed?** Be specific about the files and functions modified.
* **How does the change work?** Provide a technical explanation of the solution implemented.
* **Issue References:** Link any related NuttX or NuttX Apps issues.
* **Incomplete Impact Assessment:**
* **Impact on User:** Will users experience any functional changes? How will this fix manifest for them?
* **Impact on Build/Hardware/Documentation/Security/Compatibility:** While you marked some as "NO," it's crucial to review *all* categories and explain why there's no impact or provide details if there is.
* **Insufficient Testing Details:**
* **Build Host(s):** Specify the operating system, CPU architecture, and compiler used for testing.
* **Target(s):** List the target architectures (e.g., simulator, ARM) and boards used for verification.
* **Testing Logs:** Instead of "Testing by self-test passed", include relevant snippets from the logs demonstrating the issue before the fix and the successful behavior after.
**How to Improve the PR Description:**
1. **Elaborate on the Summary:**
- **Problem:** Clearly describe the Bluetooth HCI driver bug. What goes wrong, and what are the consequences?
- **Solution:** Explain how your changes fix the issue. For example, do you modify how data is read in blocking mode? Do you adjust the number of times `btuart_read` is called?
- **Code Changes:** Specify the files and functions you modified.
2. **Complete the Impact Assessment:**
- Carefully consider each category. Even if there's no impact, briefly explain why. For example: "Impact on Build: NO - This change only affects the Bluetooth HCI driver implementation and does not modify the build process."
3. **Provide Detailed Testing Information:**
- List all build hosts and target environments.
- Include relevant log excerpts that showcase:
- The error or unexpected behavior before your changes.
- The correct, expected behavior after applying your fix.
**Example of an Improved Summary:**
"**Fix: Bluetooth HCI Driver Data Loss in Blocking Mode**
This PR addresses a bug in the Bluetooth HCI driver where data could be lost when reading in blocking mode. The issue arises because `btuart_read` was being called three times consecutively, potentially missing subsequent packets received during the first read.
The fix modifies `btuart_rxwork` to read data in blocking mode until a complete packet is received. This ensures that no data is lost due to premature calls to `btuart_read`.
**Changes:**
- `drivers/bluetooth/hci/btuart.c`: Modified `btuart_rxwork` to read data in blocking mode until a full packet is available."
**Remember:** A well-written PR description saves reviewers time and helps ensure your changes are understood, reviewed effectively, and merged smoothly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org