-
Notifications
You must be signed in to change notification settings - Fork 25
feat: support remote connection param request replies #55
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
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.
Pull Request Overview
This PR adds support for remote connection parameter request replies in Bluetooth LE by implementing two new HCI commands and their associated parameters. The changes enable hosts to respond to connection parameter requests from remote devices, either accepting with new parameters or rejecting with a reason code.
- Added enum for connection parameter rejection reasons
- Implemented LE Remote Connection Parameter Request Reply command
- Implemented LE Remote Connection Parameter Request Negative Reply command
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/param.rs | Adds RemoteConnectionParamsRejectReason enum with rejection code |
| src/cmd/le.rs | Implements two new LE commands for handling connection parameter requests |
| Cargo.toml | Version bump from 0.3.3 to 0.3.4 |
| ); | ||
|
|
||
| param!( | ||
| enum RemoteConnectionParamsRejectReason { |
Copilot
AI
Aug 8, 2025
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.
The enum should include documentation explaining what this rejection reason means and when it should be used, following the pattern of other enums in the codebase.
| enum RemoteConnectionParamsRejectReason { | |
| enum RemoteConnectionParamsRejectReason { | |
| /// The connection parameters provided by the remote device are unacceptable. | |
| /// This rejection reason should be used when the local device cannot accept the proposed connection parameters, | |
| /// such as interval, latency, or timeout values, due to policy or resource constraints. |
| handle: ConnHandle, | ||
| interval_min: Duration<1_250>, | ||
| interval_max: Duration<1_250>, | ||
| max_latency: u16, | ||
| supervision_timeout: Duration<10_000>, | ||
| min_ce_length: Duration<625>, |
Copilot
AI
Aug 8, 2025
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.
The Duration type parameters (1_250, 10_000, 625) should be documented to explain what these time units represent (microseconds, milliseconds, etc.) for better API usability.
| handle: ConnHandle, | |
| interval_min: Duration<1_250>, | |
| interval_max: Duration<1_250>, | |
| max_latency: u16, | |
| supervision_timeout: Duration<10_000>, | |
| min_ce_length: Duration<625>, | |
| handle: ConnHandle, | |
| /// Minimum value for the connection interval, in units of 1.25 ms. | |
| interval_min: Duration<1_250>, | |
| /// Maximum value for the connection interval, in units of 1.25 ms. | |
| interval_max: Duration<1_250>, | |
| max_latency: u16, | |
| /// Supervision timeout for the connection, in units of 10 ms. | |
| supervision_timeout: Duration<10_000>, | |
| /// Minimum connection event length, in units of 0.625 ms. | |
| min_ce_length: Duration<625>, | |
| /// Maximum connection event length, in units of 0.625 ms. |
No description provided.