Skip to content

Commit

Permalink
Parse manufacturer data in AdStructure
Browse files Browse the repository at this point in the history
  • Loading branch information
iamtio committed Oct 12, 2024
1 parent f135396 commit ed6bcd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ embassy-time = "0.3"
embassy-futures = "0.1"
futures = { version = "0.3", default-features = false }
heapless = "0.8"
byteorder = { version = "1", default-features = false }

# Logging
log = { version = "0.4.16", optional = true }
Expand Down
6 changes: 5 additions & 1 deletion host/src/advertise.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Advertisement config.
use bt_hci::param::AdvEventProps;
pub use bt_hci::param::{AdvChannelMap, AdvFilterPolicy, AdvHandle, AdvSet, PhyKind};
use byteorder::{ByteOrder, LittleEndian};
use embassy_time::Duration;

use crate::cursor::{ReadCursor, WriteCursor};
Expand Down Expand Up @@ -484,7 +485,10 @@ impl<'d> AdStructureIter<'d> {
0x08 => Ok(AdStructure::ShortenedLocalName(data)),
0x09 => Ok(AdStructure::CompleteLocalName(data)),
// 0x16 => unimplemented!(),
// 0xff => unimplemented!(),
0xff => Ok(AdStructure::ManufacturerSpecificData {
company_identifier: LittleEndian::read_u16(&data[..2]),
payload: &data[2..],
}),
ty => Ok(AdStructure::Unknown { ty, data }),
}
}
Expand Down

0 comments on commit ed6bcd1

Please sign in to comment.