Skip to content

Commit 5949a5b

Browse files
authored
Merge pull request #296 from tmpfs/disc-chars-max
Support larger discovery characterisrics maximum buffer size
2 parents 97b064c + 36e7016 commit 5949a5b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

nrf-softdevice/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ ble-l2cap-credit-workaround = []
5050
evt-max-size-256 = []
5151
evt-max-size-512 = []
5252

53+
# Support more discovery characteristics in GATT clients,
54+
# may be needed with higher ATT_MTU and peripherals with
55+
# many service characteristics
56+
discovery-chars-12 = []
57+
5358
[dependencies]
5459
defmt = { version = "0.3", optional = true }
5560
log = { version = "0.4.11", optional = true }

nrf-softdevice/src/ble/gatt_client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ impl From<RawError> for DiscoverError {
106106
}
107107
}
108108

109+
#[cfg(not(feature = "discovery-chars-12"))]
109110
const DISC_CHARS_MAX: usize = 6;
111+
#[cfg(feature = "discovery-chars-12")]
112+
const DISC_CHARS_MAX: usize = 12;
113+
110114
const DISC_DESCS_MAX: usize = 6;
111115

112116
pub(crate) async fn discover_service(conn: &Connection, uuid: Uuid) -> Result<raw::ble_gattc_service_t, DiscoverError> {

0 commit comments

Comments
 (0)