Beispiel #1
0
 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);
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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;
		}