From 4f7dab6fe82f92760ae81c804807e50e91df9028 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 17 Jun 2022 01:48:20 +0200 Subject: Only allow ignore_slave_latency when ble-peripheral is enabled. --- .vscode/settings.json | 6 +++--- nrf-softdevice/src/ble/connection.rs | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 56c37a2..94e2ea4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,10 +4,7 @@ "rust-analyzer.checkOnSave.allFeatures": false, "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", "rust-analyzer.checkOnSave.allTargets": false, - "rust-analyzer.cargo.runBuildScripts": true, - "rust-analyzer.experimental.procAttrMacros": false, "rust-analyzer.procMacro.enable": true, - "rust-analyzer.assist.importGranularity": "module", "rust-analyzer.linkedProjects": [ "examples/Cargo.toml" ], @@ -16,4 +13,7 @@ "**/.git/subtree-cache/**": true, "**/target/**": true, }, + "rust-analyzer.imports.granularity.group": "module", + "rust-analyzer.cargo.buildScripts.enable": true, + "rust-analyzer.procMacro.attributes.enable": false, } \ No newline at end of file diff --git a/nrf-softdevice/src/ble/connection.rs b/nrf-softdevice/src/ble/connection.rs index 961f883..4b8baa5 100644 --- a/nrf-softdevice/src/ble/connection.rs +++ b/nrf-softdevice/src/ble/connection.rs @@ -39,17 +39,20 @@ impl From for SetConnParamsError { #[derive(Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[cfg(feature = "ble-peripheral")] pub enum IgnoreSlaveLatencyError { Disconnected, Raw(RawError), } +#[cfg(feature = "ble-peripheral")] impl From for IgnoreSlaveLatencyError { fn from(_err: DisconnectedError) -> Self { Self::Disconnected } } +#[cfg(feature = "ble-peripheral")] impl From for IgnoreSlaveLatencyError { fn from(err: RawError) -> Self { Self::Raw(err) @@ -331,6 +334,7 @@ impl Connection { /// at every single conn interval, to lower the latency. /// /// This only works on peripheral connections. + #[cfg(feature = "ble-peripheral")] pub fn ignore_slave_latency(&mut self, ignore: bool) -> Result<(), IgnoreSlaveLatencyError> { let conn_handle = self.with_state(|state| state.check_connected())?; -- cgit v1.2.3