- 
                    
                    - All Implemented Interfaces:
- 
                            
                            android.os.Parcelable,java.io.Serializable
 
 public class Beacon implements Parcelable, Serializable The Beaconclass represents a single hardware Beacon detected by an Android device.A Beacon is identified by a unique multi-part identifier, with the first of the ordered identifiers being more significant for the purposes of grouping beacons. A Beacon sends a Bluetooth Low Energy (BLE) advertisement that contains these three identifiers, along with the calibrated tx power (in RSSI) of the Beacon's Bluetooth transmitter. This class may only be instantiated from a BLE packet, and an RSSI measurement for the packet. The class parses out the identifier, along with the calibrated tx power. It then uses the measured RSSI and calibrated tx power to do a rough distance measurement (the mDistance field)
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public classBeacon.BuilderBuilder class for Beacon objects. Provides a convenient way to set the various fields of a Beacon Example: Beacon beacon = new Beacon.Builder() .setId1("2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6") .setId2("1") .setId3("2") .build();
 - 
                                
                            
                                Field SummaryFields Modifier and Type Field Description public final static Parcelable.Creator<Beacon>CREATOR
 - 
                                
                            
                                Method SummaryModifier and Type Method Description static voidsetDistanceCalculator(DistanceCalculator dc)Sets the DistanceCalculator to use with this beacon static DistanceCalculatorgetDistanceCalculator()Gets the DistanceCalculator to use with this beacon static voidsetHardwareEqualityEnforced(boolean e)Configures whether a the bluetoothAddress (mac address) must be the same for two Beacons to be configured equal. static booleangetHardwareEqualityEnforced()voidsetRssiMeasurementCount(int rssiMeasurementCount)Sets the measurement count that went into the rssi sample intgetPacketCount()Returns the number of packet detections in the last ranging cycle voidsetPacketCount(int packetCount)Sets the packet detections in the last ranging cycle longgetFirstCycleDetectionTimestamp()Returns the timestamp of the first packet detected voidsetFirstCycleDetectionTimestamp(long firstCycleDetectionTimestamp)Sets the timestamp of the first packet detected longgetLastCycleDetectionTimestamp()Returns the timestamp of the last packet detected voidsetLastCycleDetectionTimestamp(long lastCycleDetectionTimestamp)Sets the timestamp of the last packet detected intgetMeasurementCount()Returns the number of packet detections that went in to the runningAverageRssi, if known. voidsetRunningAverageRssi(double rssi)Sets the running average rssi for use in distance calculations doublegetRunningAverageRssi(double rssi)doublegetRunningAverageRssi()Returns the running average rssi voidsetRssi(int rssi)Sets the most recently measured rssi for use in distance calculations if a running average is not available intgetManufacturer()intgetServiceUuid()Array<byte>getServiceUuid128Bit()IdentifiergetIdentifier(int i)Returns the specified identifier - 0 indexed Note: to read id1, call getIdentifier(0); IdentifiergetId1()Convenience method to get the first identifier IdentifiergetId2()Convenience method to get the second identifier IdentifiergetId3()Convenience method to get the third identifier List<Long>getDataFields()Returns the list of data fields transmitted with the advertisement List<Long>getExtraDataFields()Returns the list of data fields transmitted with the advertisement voidsetExtraDataFields(List<Long> fields)Sets extra data fields List<Identifier>getIdentifiers()Returns the list of identifiers transmitted with the advertisement doublegetDistance()Provides a calculated estimate of the distance to the beacon based on a running average of the RSSI and the transmitted power calibration value included in the beacon advertisement. intgetRssi()intgetTxPower()intgetBeaconTypeCode()StringgetBluetoothAddress()StringgetBluetoothName()StringgetParserIdentifier()booleanisMultiFrameBeacon()inthashCode()Calculate a hashCode for this beacon booleanequals(Object that)Two detected beacons are considered equal if they share the same three identifiers, regardless of their mDistance or RSSI. voidrequestData(BeaconDataNotifier notifier)Requests server-side data for this beacon. StringtoString()Formats a beacon as a string showing only its unique identifiers intdescribeContents()Required for making object Parcelable voidwriteToParcel(Parcel out, int flags)Required for making object Parcelable. booleanisExtraBeaconData()Indicates whether this beacon is an "Extra data beacon," meaning one that has no identifiers but has data fields. - 
                    
                    
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        setDistanceCalculatorstatic void setDistanceCalculator(DistanceCalculator dc) Sets the DistanceCalculator to use with this beacon 
 - 
                                        getDistanceCalculatorstatic DistanceCalculator getDistanceCalculator() Gets the DistanceCalculator to use with this beacon 
 - 
                                        setHardwareEqualityEnforcedstatic void setHardwareEqualityEnforced(boolean e) Configures whether a the bluetoothAddress (mac address) must be the same for two Beacons to be configured equal. This setting applies to all beacon instances in the same process. Defaults to false for backward compatibility. 
 - 
                                        getHardwareEqualityEnforcedstatic boolean getHardwareEqualityEnforced() 
 - 
                                        setRssiMeasurementCountvoid setRssiMeasurementCount(int rssiMeasurementCount) Sets the measurement count that went into the rssi sample 
 - 
                                        getPacketCountint getPacketCount() Returns the number of packet detections in the last ranging cycle 
 - 
                                        setPacketCountvoid setPacketCount(int packetCount) Sets the packet detections in the last ranging cycle 
 - 
                                        getFirstCycleDetectionTimestamplong getFirstCycleDetectionTimestamp() Returns the timestamp of the first packet detected 
 - 
                                        setFirstCycleDetectionTimestampvoid setFirstCycleDetectionTimestamp(long firstCycleDetectionTimestamp) Sets the timestamp of the first packet detected 
 - 
                                        getLastCycleDetectionTimestamplong getLastCycleDetectionTimestamp() Returns the timestamp of the last packet detected 
 - 
                                        setLastCycleDetectionTimestampvoid setLastCycleDetectionTimestamp(long lastCycleDetectionTimestamp) Sets the timestamp of the last packet detected 
 - 
                                        getMeasurementCountint getMeasurementCount() Returns the number of packet detections that went in to the runningAverageRssi, if known. If not known or inapplicable for the rssi filter used, this is zero. 
 - 
                                        setRunningAverageRssivoid setRunningAverageRssi(double rssi) Sets the running average rssi for use in distance calculations - Parameters:
- rssi- the running average rssi
 
 - 
                                        getRunningAverageRssi@Deprecated() double getRunningAverageRssi(double rssi) 
 - 
                                        getRunningAverageRssidouble getRunningAverageRssi() Returns the running average rssi 
 - 
                                        setRssivoid setRssi(int rssi) Sets the most recently measured rssi for use in distance calculations if a running average is not available 
 - 
                                        getManufacturerint getManufacturer() 
 - 
                                        getServiceUuidint getServiceUuid() 
 - 
                                        getServiceUuid128BitArray<byte> getServiceUuid128Bit() 
 - 
                                        getIdentifierIdentifier getIdentifier(int i) Returns the specified identifier - 0 indexed Note: to read id1, call getIdentifier(0); - Parameters:
- i- - index identfier
 
 - 
                                        getId1Identifier getId1() Convenience method to get the first identifier 
 - 
                                        getId2Identifier getId2() Convenience method to get the second identifier 
 - 
                                        getId3Identifier getId3() Convenience method to get the third identifier 
 - 
                                        getDataFieldsList<Long> getDataFields() Returns the list of data fields transmitted with the advertisement 
 - 
                                        getExtraDataFieldsList<Long> getExtraDataFields() Returns the list of data fields transmitted with the advertisement 
 - 
                                        setExtraDataFieldsvoid setExtraDataFields(List<Long> fields) Sets extra data fields 
 - 
                                        getIdentifiersList<Identifier> getIdentifiers() Returns the list of identifiers transmitted with the advertisement 
 - 
                                        getDistancedouble getDistance() Provides a calculated estimate of the distance to the beacon based on a running average of the RSSI and the transmitted power calibration value included in the beacon advertisement. This value is specific to the type of Android device receiving the transmission. 
 - 
                                        getRssiint getRssi() 
 - 
                                        getTxPowerint getTxPower() 
 - 
                                        getBeaconTypeCodeint getBeaconTypeCode() 
 - 
                                        getBluetoothAddressString getBluetoothAddress() 
 - 
                                        getBluetoothNameString getBluetoothName() 
 - 
                                        getParserIdentifierString getParserIdentifier() 
 - 
                                        isMultiFrameBeaconboolean isMultiFrameBeacon() 
 - 
                                        hashCodeint hashCode() Calculate a hashCode for this beacon 
 - 
                                        equalsboolean equals(Object that) Two detected beacons are considered equal if they share the same three identifiers, regardless of their mDistance or RSSI. 
 - 
                                        requestDatavoid requestData(BeaconDataNotifier notifier) Requests server-side data for this beacon. Requires that a BeaconDataFactory be set up with a backend service. - Parameters:
- notifier- interface providing a callback when data are available
 
 - 
                                        describeContents@Deprecated() int describeContents() Required for making object Parcelable 
 - 
                                        writeToParcel@Deprecated() void writeToParcel(Parcel out, int flags) Required for making object Parcelable. If you override this class, you must override this method if you add any additional fields. 
 - 
                                        isExtraBeaconDataboolean isExtraBeaconData() Indicates whether this beacon is an "Extra data beacon," meaning one that has no identifiers but has data fields. 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
                    
                    
 
-