Skip to content

Commit

Permalink
Use proper D-Bus type for advertisting_data.
Browse files Browse the repository at this point in the history
Fixes #49
  • Loading branch information
potto216 committed Oct 21, 2022
1 parent 2eea76f commit e940fe9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bluer/src/adv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ pub struct Advertisement {
/// will override adapter Discoverable property.
///
/// Note: This property shall not be set when Type is set
/// to broadcast.
/// to broadcast. Additionally, Types that are official
/// Bluetooth assigned numbers cannot be used. So for
/// example the Type value of 0x0a cannot be used because
/// it is assigned as the TX Power Level Type. But,
/// currently the Type 0x0c is unassigned and can be used.
pub discoverable: Option<bool>,
/// The discoverable timeout in seconds.
///
Expand Down Expand Up @@ -250,7 +254,7 @@ impl Advertisement {
Some(la.service_data.iter().map(|(k, v)| (k.to_string(), Variant(v.clone()))).collect::<HashMap<_, _>>())
});
cr_property!(ib, "Data", la => {
Some(la.advertisting_data.clone().into_iter().collect::<HashMap<_, _>>())
Some(la.advertisting_data.iter().map(|(k, v)| (*k, Variant(v.clone()))).collect::<HashMap<_, _>>())
});
cr_property!(ib, "Discoverable", la => {
la.discoverable
Expand Down

0 comments on commit e940fe9

Please sign in to comment.