-
- All Implemented Interfaces:
-
org.altbeacon.beacon.distance.DistanceCalculator
public class ModelSpecificDistanceCalculator implements DistanceCalculator
Obtains a
DistanceCalculator
appropriate for a specific Android model. Each model may have a different Bluetooth chipset, radio and antenna and sees a different signal level at the same distance, therefore requiring a different equation coefficients for each model. This class uses a configuration table to look for a matching Android device model for which coefficients are known. If an exact match cannot be found, this class will attempt to find the closest match possible based on the assumption that an unknown model made by Samsung, for example might have a different signal response as a known device model also made by Samsung. If no match can be found at all, the device model marked as the default will be used for the calculation. The configuration table is stored in model-distance-calculations.json For information on how to get new Android device models added to this table, please see Created by dyoung on 8/28/14.
-
-
Constructor Summary
Constructors Constructor Description ModelSpecificDistanceCalculator(Context context, String remoteUpdateUrlString)
Obtains the best possible DistanceCalculator
for the Android device calling the constructorModelSpecificDistanceCalculator(Context context, String remoteUpdateUrlString, AndroidModel model)
Obtains the best possible DistanceCalculator
for the Android device passed as an argument
-
Method Summary
Modifier and Type Method Description AndroidModel
getModel()
AndroidModel
getRequestedModel()
double
calculateDistance(int txPower, double rssi)
-
-
Constructor Detail
-
ModelSpecificDistanceCalculator
ModelSpecificDistanceCalculator(Context context, String remoteUpdateUrlString)
Obtains the best possibleDistanceCalculator
for the Android device calling the constructor
-
ModelSpecificDistanceCalculator
ModelSpecificDistanceCalculator(Context context, String remoteUpdateUrlString, AndroidModel model)
Obtains the best possibleDistanceCalculator
for the Android device passed as an argument
-
-
Method Detail
-
getModel
AndroidModel getModel()
-
getRequestedModel
AndroidModel getRequestedModel()
-
calculateDistance
double calculateDistance(int txPower, double rssi)
-
-
-
-