int GetIndexOfBeacon(Beacon beacon) { for (var i = 0; i < this.beaconsInRange.Count; i++) { var b = this.beaconsInRange[i]; if (b.Uuid.Equals(beacon.Uuid, StringComparison.InvariantCultureIgnoreCase) && b.Major == beacon.Major && b.Minor == beacon.Minor) { return(i); } } return(-1); }
public static Proximity CalculateProximity(this Beacon beacon) { //beacon.Rssi /* * RSSI = TxPower - 10 * n * lg(d) * n = 2 (in free space) * * d = 10 ^ ((TxPower - RSSI) / (10 * n)) */ //return Math.pow(10d, ((double) txPower - rssi) / (10 * 2)); return(Proximity.Unknown); }
public BeaconImpl(Beacon beacon) : base(null, Proximity.Unknown, 0, 0) { this.beacon = beacon; }
int GetIndexOfBeacon(Beacon beacon) { for (var i = 0; i < this.beaconsInRange.Count; i++) { var b = this.beaconsInRange[i]; if (b.Uuid.Equals(beacon.Uuid, StringComparison.InvariantCultureIgnoreCase) && b.Major == beacon.Major && b.Minor == beacon.Minor) return i; } return -1; }