Yeah, no worries, what you wanted with the
Bluetooth.Advertisement namespace is pretty straight forward but these namespaces are always intertwined with others so I had to include all of them in order to resolve all dependencies. I have uploaded new versions of the
TypeLibs which include these new namespaces:
Code:
Windows.Devices.Bluetooth
Windows.Devices.Bluetooth.Advertisement
Windows.Devices.Bluetooth.Background
Windows.Devices.Bluetooth.GenericAttributeProfile
Windows.Devices.Bluetooth.Rfcomm
Windows.Devices.Radio
While at it, I am also
taking requests for any other
Windows.Devices.* or other namespaces that anyone might want added and that are not already included in the
TypeLibs!
The
WinRT Samples Collection linked in the first post above also contains the new
BluetoothLE project now. This is a
BLE Scanner that scans continuously and displays found devices in a
ListBox. Clicking on a device displays its properties in the adjacent
TextBox.
I don't have any
iBeacon devices to test so I had to make due with my phone and whatever devices the neighbors have. For example this guy never bothered to personalize the name of his iPhone!
Many of these devices (especially phones) do not include a name in their
LEAdvertisements so I went a step further and looked into the GATT (Generic Attribute Profile) namespace that is able to glean a lot more information (provided the devices are actually
Connectable). This is significantly more complicated than simply parsing the
LEAdvertisement but it's not needed for your project, it's just something that piqued my curiosity.
Since you're only interested in the
ManufacturerData, that's easily retrieved along with the
CompanyId as you can see in the above screenshot. It is also included in the
DataSections displayed below it (DataType: 0xFF) along with any other data sections the device might expose.
There's room for improvement in this project. For example it doesn't remove stale devices from the list right now. Some devices (like phones) have dynamic addresses that change every few minutes and as such the list needs to be refreshed and checked for stale devices but this shouldn't be the case for your
iBeacon. If you have any other questions about the project or WinRT syntax, feel free to ask.