I am utilizing Xamarin.iOS to wrote a BLE scanner.
I am interrested in getting the GUID of the machine the two phrase related to it and eventually the sign power to compute the space between the cellphone and the BLE beacon.
The beacons are utilizing the iBeacon protocol.
Right here is the pseudocode I’ve up to now:
if (scanner == null)
{
scanner = new CBCentralManager();
}
if (scanner != null)
{
// FIXME Ought to I go null to the primary parameter of ScanForPeripherals?
scanner.DiscoveredPeripheral += Scanner_DiscoveredPeripheral;
scanner.ScanForPeripherals(null, new PeripheralScanningOptions { AllowDuplicatesKey = true });
}
personal void Scanner_DiscoveredPeripheral(object sender, CBDiscoveredPeripheralEventArgs e)
{
lock (this.visibleBeacons)
{
// FIXME : How do I get the two phrase values and the sign power?
BeaconInfo discoveredPeripheral = new BeaconInfo(e.Peripheral.Identifier.ToString(), word1, word2, signalStrength);
...
}
}
We by no means open a session with a beacon to obtain knowledge. We solely depend on the promoting traits (ship each 250ms) for our enterprise wants. The two 16-bit fields are used to advised what we have to do when strolling close to a beacon.
The beacon is programmed with the producer software program.