Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions examples/apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ bt-hci = { version = "0.6" }
embassy-futures = "0.1.1"
embassy-sync = { version = "0.7" }
embassy-time = "0.5"
#embedded-hal = "1.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such comments were intended to be removed, before merging, in an earlier PR. Now's a good time.

embedded-hal-async = "1.0"
static_cell = "2"
#embedded-io = "0.6"
heapless = "0.9"
rand_core = { version = "0.6", default-features = false }

Expand All @@ -30,8 +28,6 @@ defmt = [
"dep:defmt",
"trouble-host/defmt",
"bt-hci/defmt",
#"embedded-io/defmt-03",
#"embedded-hal/defmt-03"
]
log = [
"dep:log",
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/src/ble_beacon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// A beacon is a device that advertises packets that are constantly being
// updated to reflect the current state of the device, but usually does not
// accept any conections. This allows broadcasting device information.
// accept any connections. This allows broadcasting device information.
//

use bt_hci::cmd::le::*;
Expand Down
4 changes: 0 additions & 4 deletions examples/nrf52/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@ debug = 2

[patch.crates-io]
#embassy-executor = {path = "../../../embassy/embassy-executor"}
#embassy-time-queue-utils = {path = "../../../embassy/embassy-time-queue-utils"}
#embassy-sync = {path = "../../../embassy/embassy-sync"}
#embassy-futures = {path = "../../../embassy/embassy-futures"}
#embassy-time = {path = "../../../embassy/embassy-time"}
#embassy-time-driver = {path = "../../../embassy/embassy-time-driver"}
#embassy-embedded-hal = {path = "../../../embassy/embassy-embedded-hal"}
#embassy-hal-internal = {path = "../../../embassy/embassy-hal-internal"}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, and below, I decided to prune the Cargo.toml's a bit, without fully understanding what's going on.

If there's a comment, refering to a crate that's not in the [dependencies], such a comment may be stale, and can be let go. Note: there may be some reason that, say, embassy-time-driver should remain here. I don't know. Only familiar with the ESP32 targets.

nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "11d5c3c"}
nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "11d5c3c"}
#bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "83a9e179ff019ed60abb73705f54383f89fc60fc" }
Expand Down
7 changes: 0 additions & 7 deletions examples/rp-pico-2-w/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,9 @@ debug = 2

[patch.crates-io]
#embassy-executor = {path = "../../../embassy/embassy-executor"}
#embassy-nrf = {path = "../../../embassy/embassy-nrf"}
#embassy-sync = {path = "../../../embassy/embassy-sync"}
#embassy-futures = {path = "../../../embassy/embassy-futures"}
#embassy-time = {path = "../../../embassy/embassy-time"}
#embassy-time-driver = {path = "../../../embassy/embassy-time-driver"}
#embassy-embedded-hal = {path = "../../../embassy/embassy-embedded-hal"}
#embassy-hal-internal = {path = "../../../embassy/embassy-hal-internal"}
#nrf-sdc = { path = "../../../nrf-sdc/nrf-sdc" }
#nrf-mpsl = { path = "../../../nrf-sdc/nrf-mpsl" }
#bt-hci = { path = "../../../bt-hci" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. bt-hci was not mentioned, otherwise, and nrf-* within a rp-pico-... file feel like a copy/paste.

cyw43 = { git = "https://github.com/embassy-rs/embassy.git", rev = "faacad613ea26a28de216cf32ac4cc64f7862d4c" }
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "faacad613ea26a28de216cf32ac4cc64f7862d4c" }
embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "faacad613ea26a28de216cf32ac4cc64f7862d4c" }
Expand Down
7 changes: 0 additions & 7 deletions examples/rp-pico-w/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ debug = 2
#embassy-sync = {path = "../../../embassy/embassy-sync"}
#embassy-futures = {path = "../../../embassy/embassy-futures"}
#embassy-time = {path = "../../../embassy/embassy-time"}
#embassy-time-driver = {path = "../../../embassy/embassy-time-driver"}
#embassy-embedded-hal = {path = "../../../embassy/embassy-embedded-hal"}
#embassy-hal-internal = {path = "../../../embassy/embassy-hal-internal"}
#cyw43 = {path = "../../../embassy/cyw43"}
#cyw43-pio = {path = "../../../embassy/cyw43-pio"}
cyw43 = { git = "https://github.com/embassy-rs/embassy.git", rev = "faacad613ea26a28de216cf32ac4cc64f7862d4c" }
Expand All @@ -54,7 +51,3 @@ embassy-rp = { git = "https://github.com/embassy-rs/embassy.git", rev = "faacad6
cyw43-pio = { git = "https://github.com/embassy-rs/embassy.git", rev = "faacad613ea26a28de216cf32ac4cc64f7862d4c" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "faacad613ea26a28de216cf32ac4cc64f7862d4c" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "faacad613ea26a28de216cf32ac4cc64f7862d4c" }
#nrf-sdc = { path = "../../../nrf-sdc/nrf-sdc" }
#nrf-mpsl = { path = "../../../nrf-sdc/nrf-mpsl" }
#bt-hci = { path = "../../../bt-hci" }
#bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "83a9e179ff019ed60abb73705f54383f89fc60fc" }
2 changes: 1 addition & 1 deletion host-macros/src/ctxt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Ctxt {
}
}

/// Add an error to the context object with a tokenenizable object.
/// Add an error to the context object with a tokenizable object.
///
/// The object is used for spanning in error messages.
pub fn error_spanned_by<A: ToTokens, T: Display>(&self, obj: A, msg: T) {
Expand Down
2 changes: 1 addition & 1 deletion host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ embassy-sync = "0.7"
embassy-time = "0.5"
embassy-futures = "0.1"
futures = { version = "0.3", default-features = false }
heapless = "0.9"
heapless = "0.9" # "gatt", "security"
trouble-host-macros = { path = "../host-macros", version = "0.3.0", optional = true }
p256 = { version = "0.13.2", default-features = false, features = ["ecdh","arithmetic"], optional = true }
rand_core = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion host/src/advertise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub enum TxPower {
Plus20dBm = 20,
}

/// Configuriation for a single advertisement set.
/// Configuration for a single advertisement set.
#[derive(Debug, Clone)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct AdvertisementSet<'d> {
Expand Down
4 changes: 2 additions & 2 deletions host/src/att.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl AttErrorCode {
pub const WRITE_REQUEST_REJECTED: Self = Self { value: 0xFC };
/// The client characteristic configuration descriptor (CCCD) is not configured according to the requirements of the profile or service
pub const CCCD_IMPROPERLY_CONFIGURED: Self = Self { value: 0xFD };
/// The profile or service request could not be serviced because an operation that has been previousl triggered is still in progress
/// The profile or service request could not be serviced because an operation that has been previously triggered is still in progress
pub const PROCEDURE_ALREADY_IN_PROGRESS: Self = Self { value: 0xFE };
/// The attribute value is out of range as defined by a profile or service specification
pub const OUT_OF_RANGE: Self = Self { value: 0xFF };
Expand Down Expand Up @@ -131,7 +131,7 @@ impl Display for AttErrorCode {

&Self::WRITE_REQUEST_REJECTED => f.write_str("write request rejected: the write request could not be fulfilled for reasons other than permissions"),
&Self::CCCD_IMPROPERLY_CONFIGURED => f.write_str("CCCD improperly configured: the client characteristic configuration descriptor (CCCD) is not configured according to the requirements of the profile or service"),
&Self::PROCEDURE_ALREADY_IN_PROGRESS => f.write_str("procedure already in progress: the profile or service request could not be serviced because an operation that has been previousl triggered is still in progress"),
&Self::PROCEDURE_ALREADY_IN_PROGRESS => f.write_str("procedure already in progress: the profile or service request could not be serviced because an operation that has been previously triggered is still in progress"),
&Self::OUT_OF_RANGE => f.write_str("out of range: the attribute value is out of range as defined by a profile or service specification"),

other => write!(f, "unknown error code {other}: check the most recent bluetooth spec"),
Expand Down
6 changes: 3 additions & 3 deletions host/src/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ impl<'d, M: RawMutex, const MAX: usize> AttributeTable<'d, M, MAX> {
/// The provided data must exactly match the size of the storage for the characteristic,
/// otherwise this function will panic.
///
/// If the characteristic for the handle cannot be found, or the shape of the data does not match the type of the characterstic,
/// If the characteristic for the handle cannot be found, or the shape of the data does not match the type of the characteristic,
/// an error is returned
pub fn set<T: AttributeHandle>(&self, attribute_handle: &T, input: &T::Value) -> Result<(), Error> {
let gatt_value = input.as_gatt();
Expand Down Expand Up @@ -563,7 +563,7 @@ impl<'d, M: RawMutex, const MAX: usize> ServiceBuilder<'_, 'd, M, MAX> {
}
}

/// Add a characteristic to this service with a refererence to a mutable storage buffer.
/// Add a characteristic to this service with a reference to a mutable storage buffer.
pub fn add_characteristic<T: AsGatt, U: Into<Uuid>>(
&mut self,
uuid: U,
Expand All @@ -588,7 +588,7 @@ impl<'d, M: RawMutex, const MAX: usize> ServiceBuilder<'_, 'd, M, MAX> {
)
}

/// Add a characteristic to this service with a refererence to an immutable storage buffer.
/// Add a characteristic to this service with a reference to an immutable storage buffer.
pub fn add_characteristic_ro<T: AsGatt, U: Into<Uuid>>(
&mut self,
uuid: U,
Expand Down
8 changes: 5 additions & 3 deletions host/src/attribute_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ pub struct AttributeServer<
> {
att_table: AttributeTable<'values, M, ATT_MAX>,
cccd_tables: CccdTables<M, CCCD_MAX, CONN_MAX>,
_p: PhantomData<P>,
_p: PhantomData<P>, // please comment on the purpose
}

pub(crate) mod sealed {
Expand Down Expand Up @@ -939,8 +939,9 @@ mod tests {
while let Some(att) = it.next() {
let handle = att.handle;
let uuid = &att.uuid;
// bad format: "last_handle_in_group for 0x{:0>4x?}, 0x{:0>2x?} 0x{:0>2x?}", // "Unknown display hint: '0>4x?'
trace!(
"last_handle_in_group for 0x{:0>4x?}, 0x{:0>2x?} 0x{:0>2x?}",
"last_handle_in_group for 0x{:04x}, 0x{:02x} 0x{:02x}", // not sure which is the intended format, here!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My IDE (Rust Rover) showed:

Unknown display hint: '0>4x?'

It seems that's indeed an invalid combination (asked Copilot). What is the intended output - what should be here?

Also, shouldn't CI or something pick this up? I'm confused, please help. O:)

handle,
uuid,
att.last_handle_in_group
Expand Down Expand Up @@ -981,7 +982,8 @@ mod tests {
)
.unwrap();
let response = &buffer[0..length];
trace!(" 0x{:0>2x?}", response);
// bad format: " 0x{:0>2x?}" <-- "unknown display hint"
trace!(" 0x{:02x}", response);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..here, too

// It should be a successful response, because the service should be found, this will assert if
// we failed to retrieve the third service.
assert_eq!(response[0], att::ATT_READ_BY_GROUP_TYPE_RSP);
Expand Down
4 changes: 2 additions & 2 deletions host/src/channel_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,14 @@ impl<'d, P: PacketPool> ChannelManager<'d, P> {
let req = ConnParamUpdateReq::from_hci_bytes_complete(data)?;
debug!("[l2cap][conn = {:?}] connection param update request: {:?}", conn, req);
let interval_min: bt_hci::param::Duration<1_250> = bt_hci::param::Duration::from_u16(req.interval_min);
let interva_max: bt_hci::param::Duration<1_250> = bt_hci::param::Duration::from_u16(req.interval_max);
let interval_max: bt_hci::param::Duration<1_250> = bt_hci::param::Duration::from_u16(req.interval_max);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's interesting. It's a typo in a variable name. Now..

  • the variable is not used, so it never mattered
  • should the variable be used, see next diff

Kindly, it would also be great if unused variables were reported. Have I missed something - didn't get anything on the IDE or the CI output. What's really going on?

let timeout: bt_hci::param::Duration<10_000> = bt_hci::param::Duration::from_u16(req.timeout);
use embassy_time::Duration;
let _ = manager.post_handle_event(
conn,
ConnectionEvent::RequestConnectionParams {
min_connection_interval: Duration::from_micros(interval_min.as_micros()),
max_connection_interval: Duration::from_micros(interval_min.as_micros()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interval_min used for both min and max - is that the intention, too?

max_connection_interval: Duration::from_micros(interval_min.as_micros()), // Q: why didn't anything catch 'interva_max' unused? Isn't that worth fixing? 🤨
max_latency: req.latency,
supervision_timeout: Duration::from_micros(timeout.as_micros()),
},
Expand Down
2 changes: 1 addition & 1 deletion host/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ impl<'stack, P: PacketPool> Connection<'stack, P> {
return Err(crate::Error::Disconnected.into());
}
Err(BleHostError::BleHost(crate::Error::Hci(bt_hci::param::Error::UNSUPPORTED_REMOTE_FEATURE))) => {
// We tried to send the request as a periperhal but the remote central does not support procedure.
// We tried to send the request as a peripheral but the remote central does not support procedure.
// Use the L2CAP signaling method below instead.
// This code path should never be reached when acting as a central. If a bugged controller implementation
// returns this error code we transmit an invalid L2CAP signal which then is rejected by the remote.
Expand Down
2 changes: 1 addition & 1 deletion host/src/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ impl<'d, P: PacketPool> ConnectionManager<'d, P> {
if r == role {
if !peers.is_empty() {
for peer in peers.iter() {
// TODO: Accept advertsing peers which use IRK
// TODO: Accept advertising peers which use IRK
if storage.peer_addr_kind.unwrap() == peer.0
&& storage.peer_identity.unwrap().bd_addr == *peer.1
{
Expand Down
6 changes: 3 additions & 3 deletions host/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ impl<'d, C: Controller, P: PacketPool> Runner<'d, C, P> {
+ ControllerCmdSync<LeCreateConnCancel>
+ ControllerCmdSync<LeSetScanEnable>
+ ControllerCmdSync<LeSetExtScanEnable>
+ for<'t> ControllerCmdSync<LeSetAdvEnable>
+ ControllerCmdSync<LeSetAdvEnable>
Copy link
Contributor Author

@finalyards finalyards Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I belive, but am not 100% sure, that the for<'t> is a no-op when 't is not used on the same element.

+ for<'t> ControllerCmdSync<LeSetExtAdvEnable<'t>>
+ for<'t> ControllerCmdSync<HostNumberOfCompletedPackets<'t>>
+ ControllerCmdSync<LeReadBufferSize>
Expand All @@ -741,7 +741,7 @@ impl<'d, C: Controller, P: PacketPool> Runner<'d, C, P> {
+ ControllerCmdSync<HostBufferSize>
+ ControllerCmdAsync<LeConnUpdate>
+ ControllerCmdSync<SetControllerToHostFlowControl>
+ for<'t> ControllerCmdSync<LeSetAdvEnable>
+ ControllerCmdSync<LeSetAdvEnable>
+ for<'t> ControllerCmdSync<LeSetExtAdvEnable<'t>>
+ for<'t> ControllerCmdSync<HostNumberOfCompletedPackets<'t>>
+ ControllerCmdSync<LeSetScanEnable>
Expand Down Expand Up @@ -1039,7 +1039,7 @@ impl<'d, C: Controller, P: PacketPool> ControlRunner<'d, C, P> {
+ ControllerCmdSync<SetControllerToHostFlowControl>
+ ControllerCmdSync<Reset>
+ ControllerCmdSync<LeCreateConnCancel>
+ for<'t> ControllerCmdSync<LeSetAdvEnable>
+ ControllerCmdSync<LeSetAdvEnable>
+ for<'t> ControllerCmdSync<LeSetExtAdvEnable<'t>>
+ ControllerCmdSync<LeSetScanEnable>
+ ControllerCmdSync<LeSetExtScanEnable>
Expand Down
18 changes: 8 additions & 10 deletions host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ pub mod prelude {
pub use bt_hci::transport::SerialTransport;
pub use bt_hci::uuid::*;
#[cfg(feature = "derive")]
pub use heapless::String as HeaplessString;
#[cfg(feature = "derive")]
pub use trouble_host_macros::*;

pub use super::att::AttErrorCode;
Expand Down Expand Up @@ -436,14 +434,14 @@ pub trait Controller:
+ ControllerCmdAsync<LeCreateConn>
+ ControllerCmdSync<LeClearFilterAcceptList>
+ ControllerCmdSync<LeAddDeviceToFilterAcceptList>
+ for<'t> ControllerCmdSync<LeSetAdvEnable>
+ ControllerCmdSync<LeSetAdvEnable>
+ for<'t> ControllerCmdSync<LeSetExtAdvEnable<'t>>
+ for<'t> ControllerCmdSync<HostNumberOfCompletedPackets<'t>>
+ ControllerCmdSync<LeReadBufferSize>
+ for<'t> ControllerCmdSync<LeSetAdvData>
+ ControllerCmdSync<LeSetAdvData>
+ ControllerCmdSync<LeSetAdvParams>
+ for<'t> ControllerCmdSync<LeSetAdvEnable>
+ for<'t> ControllerCmdSync<LeSetScanResponseData>
+ ControllerCmdSync<LeSetAdvEnable>
+ ControllerCmdSync<LeSetScanResponseData>
+ ControllerCmdSync<LeLongTermKeyRequestReply>
+ ControllerCmdAsync<LeEnableEncryption>
+ ControllerCmdSync<ReadBdAddr>
Expand Down Expand Up @@ -471,14 +469,14 @@ impl<
+ ControllerCmdSync<LeSetExtScanEnable>
+ ControllerCmdSync<LeCreateConnCancel>
+ ControllerCmdAsync<LeCreateConn>
+ for<'t> ControllerCmdSync<LeSetAdvEnable>
+ ControllerCmdSync<LeSetAdvEnable>
+ for<'t> ControllerCmdSync<LeSetExtAdvEnable<'t>>
+ for<'t> ControllerCmdSync<HostNumberOfCompletedPackets<'t>>
+ ControllerCmdSync<LeReadBufferSize>
+ for<'t> ControllerCmdSync<LeSetAdvData>
+ ControllerCmdSync<LeSetAdvData>
+ ControllerCmdSync<LeSetAdvParams>
+ for<'t> ControllerCmdSync<LeSetAdvEnable>
+ for<'t> ControllerCmdSync<LeSetScanResponseData>
+ ControllerCmdSync<LeSetAdvEnable>
+ ControllerCmdSync<LeSetScanResponseData>
+ ControllerCmdSync<LeLongTermKeyRequestReply>
+ ControllerCmdAsync<LeEnableEncryption>
+ ControllerCmdSync<ReadBdAddr>,
Expand Down
2 changes: 1 addition & 1 deletion host/src/packet_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<const MTU: usize, const N: usize> State<MTU, N> {
}

/// A packet pool holds a pool of packet buffers that can be dynamically allocated
/// and free'd.
/// and freed.
pub struct StaticPacketPool<M: RawMutex, const MTU: usize, const N: usize> {
state: Mutex<M, RefCell<State<MTU, N>>>,
}
Expand Down
12 changes: 6 additions & 6 deletions host/src/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ impl<'d, C: Controller, P: PacketPool> Peripheral<'d, C, P> {
data: Advertisement<'k>,
) -> Result<Advertiser<'d, C, P>, BleHostError<C::Error>>
where
C: for<'t> ControllerCmdSync<LeSetAdvData>
C: ControllerCmdSync<LeSetAdvData>
+ ControllerCmdSync<LeSetAdvParams>
+ for<'t> ControllerCmdSync<LeSetAdvEnable>
+ for<'t> ControllerCmdSync<LeSetScanResponseData>,
+ ControllerCmdSync<LeSetAdvEnable>
+ ControllerCmdSync<LeSetScanResponseData>,
{
let host = &self.stack.host;

Expand Down Expand Up @@ -106,14 +106,14 @@ impl<'d, C: Controller, P: PacketPool> Peripheral<'d, C, P> {
})
}

/// Update the advertisment adv_data and/or scan_data. Does not change any
/// Update the advertisement adv_data and/or scan_data. Does not change any
/// other advertising parameters. If no advertising is active, this will not
/// produce any observable effect. This is typically useful when
/// implementing a BLE beacon that only broadcasts advertisement data and
/// does not accept any connections.
pub async fn update_adv_data<'k>(&mut self, data: Advertisement<'k>) -> Result<(), BleHostError<C::Error>>
where
C: for<'t> ControllerCmdSync<LeSetAdvData> + for<'t> ControllerCmdSync<LeSetScanResponseData>,
C: ControllerCmdSync<LeSetAdvData> + ControllerCmdSync<LeSetScanResponseData>,
{
let host = &self.stack.host;
let data: RawAdvertisement = data.into();
Expand Down Expand Up @@ -243,7 +243,7 @@ impl<'d, C: Controller, P: PacketPool> Peripheral<'d, C, P> {
})
}

/// Update the extended advertisment adv_data and/or scan_data for multiple
/// Update the extended advertisement adv_data and/or scan_data for multiple
/// advertising sets. Does not change any other advertising parameters. If
/// no advertising is active, this will not produce any observable effect.
/// This is typically useful when implementing a BLE beacon that only
Expand Down
3 changes: 0 additions & 3 deletions host/src/security_manager/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ use embassy_time::Duration;
/// 128-bit encryption key size
pub(crate) const ENCRYPTION_KEY_SIZE_128_BITS: u8 = 128 / 8;

/// Long duration, to disable the timer
pub(crate) const TIMEOUT_DISABLE: Duration = Duration::from_secs(3600 * 24 * 365 * 10); // ~10 years
// Workaround for Duration multiplication not being const
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just cleanup. The const was used only as Instant::now() + ... to get a time stamp far, far in the future. For this, we can use Instant::MAX just as well.

const TIMEOUT_SECS: u64 = 30;
/// Pairing time-out
pub(crate) const TIMEOUT: Duration = Duration::from_secs(TIMEOUT_SECS);
Loading
Loading