/** * 每个扫描周期结束,根据20秒内各beacon的RSSI平均值计算它的距离,该回调获取这些beacon的距离值 Called once per second (实际上是每扫描周期) * to give an estimate of the mDistance to visible beacons */ @Override public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) { LogManager.d(TAG, "didRangeBeaconsInRegion(),beacons=" + beacons.size()); for (Beacon beacon : beacons) { LogManager.d(TAG, beacon.getId2() + ":" + beacon.getId3() + "," + beacon.getDistance()); } Beacon beacon = mNearestBeacon.getNearestBeacon(mGetBeaconType, beacons); mOnNearestBeaconListener.getNearestBeacon(mGetBeaconType, beacon); }
/** * 设定用于展品定位的最小停留时间(ms) * * @param Min_stay_milliseconds the mMin_stay_milliseconds to set */ public void setMin_stay_milliseconds(long Min_stay_milliseconds) { mNearestBeacon.setmMin_stay_milliseconds(Min_stay_milliseconds); }
/** * 获得当前设定用于展品定位的最小停留时间(ms) * * @return the mMin_stay_milliseconds */ public long getMin_stay_milliseconds() { return mNearestBeacon.getmMin_stay_milliseconds(); }
/** * 设定用于展品定位的最小距离(m) * * @param Exhibit_distance the mExhibit_distance to set */ public void setExhibit_distance(double Exhibit_distance) { mNearestBeacon.setmNeaestBeacon_distance(Exhibit_distance); }
/** * 获得当前设定用于展品定位的最小距离(m) * * @return the mExhibit_distance */ public double getExhizibit_distance() { return mNearestBeacon.getmNeaestBeacon_distance(); }