public Beacon(EstimoteSdk.Beacon beacon) { this.beacon = beacon; var prox = Utils.ComputeProximity(beacon); if (prox == Utils.Proximity.Far) this.Proximity = Proximity.Far; else if (prox == Utils.Proximity.Immediate) this.Proximity = Proximity.Immediate; else if (prox == Utils.Proximity.Near) this.Proximity = Proximity.Near; else this.Proximity = Proximity.Unknown; }
private Proximity GetProximity(EstimoteSdk.Beacon beacon) { var nativeProx = Utils.ComputeProximity(beacon); Proximity prox; if (nativeProx == Utils.Proximity.Immediate) { prox = Proximity.Immediate; } else if (nativeProx == Utils.Proximity.Near) { prox = Proximity.Near; } else if (nativeProx == Utils.Proximity.Far) { prox = Proximity.Far; } else { prox = Proximity.Unknown; } return prox; }
private double GetDistance(EstimoteSdk.Beacon beacon) { double distance = -1; distance = Utils.ComputeAccuracy(beacon); return Math.Round(distance, 2, MidpointRounding.AwayFromZero); }