sendRssiAdvertisement method

void sendRssiAdvertisement(
  1. Point pointForAd
)

Determines a random value with noise that is sent for this advertisement cycle. Updates RSSI with rssiUpdate of the super class automatically. PointForAd is a assumed position of the devices that the end user is using. The ad is calculated with this position in mind.

Implementation

void sendRssiAdvertisement(Point pointForAd) {
  double calcRssi =
      _metersToRSSI(position.toVector().distanceTo(pointForAd.toVector()));
  int deviation = _rssiDeviation(calcRssi.toInt());
  int finalRssi = calcRssi.toInt() - deviation;
  super.rssiUpdate(finalRssi);
}