Skip to content

Commit

Permalink
Merge pull request #51 from taks/adv_interval
Browse files Browse the repository at this point in the history
Added BLEAdvertising::min_interval, BLEAdvertising::max_interval
  • Loading branch information
taks authored Nov 20, 2023
2 parents ad23768 + a9784d0 commit 8f957b0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/server/ble_advertising.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@ impl BLEAdvertising {
self
}

/// Set the minimum advertising interval.
///
/// * `interval`: advertising interval in 0.625ms units, 0 = use default.
pub fn min_interval(&mut self, interval: u16) -> &mut Self {
self.adv_params.itvl_min = interval;
self
}

/// Set the maximum advertising interval.
///
/// * `interval`: advertising interval in 0.625ms units, 0 = use default.
pub fn max_interval(&mut self, interval: u16) -> &mut Self {
self.adv_params.itvl_max = interval;
self
}

/// Set if scan response is available.
pub fn scan_response(&mut self, value: bool) -> &mut Self {
self.scan_response = value;
Expand Down

0 comments on commit 8f957b0

Please sign in to comment.