Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bluez/bluer
Browse files Browse the repository at this point in the history
  • Loading branch information
surban committed Sep 13, 2023
2 parents 290e82f + 1bad12c commit bf4ed3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bluer-tools/src/gattcat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ impl DiscoverOpts {
};
println!(" Characteristic {char_id}");

print_if_some(6, "MTU", char.mtu().await.ok(), "bytes");

let flags = char.flags().await?;
print_if_some(6, "Flags", Some(char_flags_to_vec(&flags).join(", ")), "");
if flags.read {
Expand Down
11 changes: 11 additions & 0 deletions bluer/src/gatt/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,17 @@ define_properties!(
dbus: (CHARACTERISTIC_INTERFACE, "Value", Vec<u8>, MANDATORY),
get: (cached_value, v => {v.to_owned()}),
);

/// The maximum transmission unit for the characteristic.
///
/// This is the maximum amount of data that can be sent or received
/// in a single packet for this characteristic. Longer data may be
/// able to be sent or received using long procedures when available.
property(
Mtu, usize,
dbus: (CHARACTERISTIC_INTERFACE, "MTU", u16, MANDATORY),
get: (mtu, v => { (*v).into() }),
);
}
);

Expand Down

0 comments on commit bf4ed3b

Please sign in to comment.