harald v0.1.1 Harald.HCI.Event.LEMeta.AdvertisingReport View Source
A struct representing a LE Advertising Report.
The LE Advertising Report event indicates that one or more Bluetooth devices have responded to an active scan or have broadcast advertisements that were received during a passive scan. The Controller may queue these advertising reports and send information from multiple devices in one LE Advertising Report event.
This event shall only be generated if scanning was enabled using the LE Set Scan Enable command. It only reports advertising events that used legacy advertising PDUs.
Reference: Version 5.0, Vol 2, Part E, 7.7.65.2
Link to this section Summary
Functions
Deserializes a LE Advertising Report Event into Harald.HCI.Event.LEMeta.AdvertisingReport
structs
Serializes a Harald.HCI.Event.LEMeta.AdvertisingReport
struct into a LE Advertising Report
Event
Link to this section Types
t()
View Source
t() :: %Harald.HCI.Event.LEMeta.AdvertisingReport{devices: term()}
t() :: %Harald.HCI.Event.LEMeta.AdvertisingReport{devices: term()}
Link to this section Functions
deserialize(bin) View Source
Deserializes a LE Advertising Report Event into Harald.HCI.Event.LEMeta.AdvertisingReport
structs.
iex> AdvertisingReport.deserialize(
...> <<2, 2, 0, 1, 1, 2, 2, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 7, 6, 32, 1, 0, 0, 0, 2, 4,
...> 7>>
...> )
{:ok, %AdvertisingReport{
devices: [
%AdvertisingReport.Device{
event_type: 0,
address_type: 1,
address: 2,
data: [],
rss: 4
},
%AdvertisingReport.Device{
event_type: 1,
address_type: 2,
address: 5,
data: [{"Service Data - 32-bit UUID", %{uuid: 1, data: <<2>>}}],
rss: 7
}
]
}
}
serialize(advertising_report) View Source
Serializes a Harald.HCI.Event.LEMeta.AdvertisingReport
struct into a LE Advertising Report
Event.
iex> AdvertisingReport.serialize(
...> %AdvertisingReport{
...> devices: [
...> %AdvertisingReport.Device{
...> event_type: 0,
...> address_type: 1,
...> address: 2,
...> data: [],
...> rss: 4
...> },
...> %AdvertisingReport.Device{
...> event_type: 1,
...> address_type: 2,
...> address: 5,
...> data: [{"Service Data - 32-bit UUID", %{uuid: 1, data: <<2>>}}],
...> rss: 7
...> }
...> ]
...> }
...> )
{:ok,
<<2, 2, 0, 1, 1, 2, 2, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 7, 6, 32, 1, 0, 0, 0, 2, 4, 7>>}