summaryrefslogtreecommitdiff
path: root/nrf-softdevice
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2022-06-17 01:48:20 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2022-06-17 01:48:20 +0200
commit4f7dab6fe82f92760ae81c804807e50e91df9028 (patch)
tree852689e68baf7343e31798bd63ad7c35832416d0 /nrf-softdevice
parent8f6231ab39d6f76944b4d91d2bac82eddaf4c69f (diff)
downloadnrf-softdevice-4f7dab6fe82f92760ae81c804807e50e91df9028.zip
Only allow ignore_slave_latency when ble-peripheral is enabled.
Diffstat (limited to 'nrf-softdevice')
-rw-r--r--nrf-softdevice/src/ble/connection.rs4
1 files changed, 4 insertions, 0 deletions
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<RawError> 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<DisconnectedError> for IgnoreSlaveLatencyError {
fn from(_err: DisconnectedError) -> Self {
Self::Disconnected
}
}
+#[cfg(feature = "ble-peripheral")]
impl From<RawError> 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())?;