Skip to content

Conversation

@lulf
Copy link
Member

@lulf lulf commented Aug 8, 2025

No description provided.

@lulf lulf requested a review from Copilot August 8, 2025 20:17
Copy link

Copilot AI left a 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 {
Copy link

Copilot AI Aug 8, 2025

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Comment on lines +270 to +275
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>,
Copy link

Copilot AI Aug 8, 2025

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
@lulf lulf merged commit b5aa6b1 into main Aug 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants