We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.

HMS Core ReferencesNearby Servicenearby.messageBeaconIdOverview

message.BeaconId

CLASS info
public class BeaconId extends Object
Represents the beacon ID, which can either be an iBeacon ID or an Eddystone UID. The ID is broadcast by BLE beacons.

Nested Class Summary

TypeNameDesc
ClassBeaconId.BuilderRepresents the builder class for BeaconId.

Constant Summary

TypeNameDesc
intBEACON_TYPE_IBEACONiBeacon ID type.
intBEACON_TYPE_EDDYSTONE_UIDEddystone UID type.
intIBEACON_ID_LENGTHLength of an iBeacon ID, in bytes.
intEDDYSTONE_UID_LENGTHLength of an Eddystone UID, in bytes.
intEDDYSTONE_NAMESPACE_LENGTHLength of an Eddystone UID namespace, in bytes.
intEDDYSTONE_INSTANCE_LENGTHLength of an Eddystone UID instance, in bytes.

Public Method Summary

ReturnMethod
intgetLength()
Obtains the length of a beacon ID.
intgetType()
Obtains the beacon ID type.
booleanequals(Object other)
Checks whether any other object is the same as this object.
BeaconIdparse(Message message)
Converts a message to a beacon ID.
inthashCode()
Obtains the hash value.
StringtoString()
Converts an object into a readable character string.
StringgetHex()
Returns a 16-byte beacon ID.
StringgetInstance()
Returns the instance (last 6 bytes) of an Eddystone UID.
StringgetNamespace()
Returns the namespace (first 10 bytes) of an Eddystone UID.
shortgetMajor()
Returns the major value of an iBeacon ID.
short
getMinor
()
Returns the minor value of an iBeacon ID.
UUIDgetIBeaconUuid()
Returns the UUID of an iBeacon ID.

Constants

Constant
public static final int BEACON_TYPE_IBEACON
IBEACON UUID type.
Constant value: 1
Constant
public static final int BEACON_TYPE_EDDYSTONE_UID
Eddystone UID type.
Constant value: 2
Constant
public static final int IBEACON_ID_LENGTH
Length of an iBeacon ID, in bytes. An iBeacon ID contains a 16-byte UUID, followed by a 2-byte major value and then a 2-byte minor value.
Constant value: 20
Constant
public static final int EDDYSTONE_UID_LENGTH
Length of an Eddystone UID, in bytes. An Eddystone UID contains a 10-byte namespace, followed by a 6-byte instance.
Constant value: 16
Constant
public static final int EDDYSTONE_NAMESPACE_LENGTH
Length of an Eddystone UID namespace, in bytes.
Constant value: 10
Constant
public static final int EDDYSTONE_INSTANCE_LENGTH
Length of an Eddystone UID namespace, in bytes.
Constant value: 6

Public Methods

Method
public int getLength()
Obtains the length of a beacon ID. IBEACON_ID_LENGTH is returned for an iBeacon ID and EDDYSTONE_UID_LENGTH is returned for an Eddystone UID.
Method
public int getType()
Obtains the beacon ID type.
For an iBeacon ID, BEACON_TYPE_IBEACON is returned.
For an Eddystone UID, BEACON_TYPE_EDDYSTONE_UID is returned.
Method
public boolean equals(Object other)
Checks whether any other object is the same as this object.

Parameters

Parameter nameParameter desc
otherOther object.
Method
public static BeaconId parse(Message message)
Converts a message to a beacon ID.

Parameters

Parameter nameParameter desc
messageMessage object.
Method
public int hashCode()
Obtains the hash value.
Method
public String toString()
Converts an object into a readable character string.
Method
public String getHex()
Returns a 16-byte beacon ID.
Method
public String getInstance()
Returns the instance (last 6 bytes) of an Eddystone UID.
Method
public String getNamespace()
Returns the namespace (first 10 bytes) of an Eddystone UID.
Method
public short getMajor()
Returns the major value of an iBeacon ID.
Method
public short getMinor()
Returns the minor value of an iBeacon ID.
Method
public UUID getIBeaconUuid()
Returns the UUID of an iBeacon ID.
This page may contain third-party content. For details, click here.