Skip to content

RangingBeaconsInRegion #14

Open
Open
@acaliaro

Description

@acaliaro

Hi @chrisriesgo . I have downloaded your Forms Demo and I see that

    async void RangingBeaconsInRegion(object sender, RangeEventArgs e)

is called 2 times, one after the other.
I have only inserted this row

        Debug.WriteLine ("Entered " + e.Beacons.Count);

there

    async void RangingBeaconsInRegion(object sender, RangeEventArgs e)
    {
        await ClearData();

        **Debug.WriteLine ("Entered " + e.Beacons.Count);**

        var allBeacons = new List<Beacon>();
        if(e.Beacons.Count > 0)

And in Application Output I see

Thread started: #13
Entered 1
Entered 1
Entered 2
Entered 2
Thread finished: #13
[BluetoothAdapter] startLeScan(): null
[BluetoothAdapter] onClientRegistered() - status=0 clientIf=5
[BluetoothAdapter] onScanResult() - Device=DD:01:E3:CA:53:A5 RSSI=-82
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-45
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-42
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-57
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-48
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-50
[BluetoothAdapter] onScanResult() - Device=DD:01:E3:CA:53:A5 RSSI=-85
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-47
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-52
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-49
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-53
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-48
[BluetoothAdapter] onScanResult() - Device=DD:01:E3:CA:53:A5 RSSI=-84
[BluetoothAdapter] stopLeScan()
Thread started: #14
Entered 1
Entered 1
Entered 2
Entered 2
Thread finished: #14
[BluetoothAdapter] startLeScan(): null
[BluetoothAdapter] onClientRegistered() - status=0 clientIf=5
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-39
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-39
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-49
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-41
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-48
[BluetoothAdapter] onScanResult() - Device=DD:01:E3:CA:53:A5 RSSI=-88
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-46
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-42
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-46
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-42
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-51
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-39
[BluetoothAdapter] stopLeScan()
Thread started: #15
Entered 1
Entered 1
Entered 2
Entered 2
Thread finished: #15

The first time is often "1" and the second time is often "2" (I have 2 beacons here, one is a Estimote, the other one... I don't know...)

Do you know the reason RangingBeaconsInRegion is called twice?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions