Class Info |
|---|
public class MessageHandler extends Object Callback processing class of the target message. It is triggered when the target message is discovered, lost, or the Bluetooth signal or distance of the device associated with the target message changes. |
Constructor Name |
|---|
public MessageHandler() Creates an instance of MessageHandler. |
Qualifier and Type | Method Name and Description |
|---|---|
void | onBleSignalChanged(Message message, BleSignal bleSignal) Called when a beacon is scanned for the first time or when the RSSI of a scanned beacon changes (the RSSI change exceeds 10 dBm). |
void | onDistanceChanged(Message message, Distance distance) Called when a beacon is scanned for the first time or when the distance of the beacon changes (exceeds the specified precision, for example, 1 meter). |
void | Called when a message is detected for the first time or a lost message (onLost) is detected again. |
void | Called when a message is no longer discoverable. |
Method |
|---|
public void onBleSignalChanged(Message message, BleSignal bleSignal) Called when a beacon is scanned for the first time or when the RSSI of a scanned beacon changes (the RSSI change exceeds 10 dBm). This callback currently supports only BLE beacon messages. It does not support PendingIntent during subscription. |
Parameters
Name | Description |
|---|---|
message | Object of a published message. |
bleSignal | BLE signals, including RSSI and TxPower. |
Method |
|---|
public void onDistanceChanged(Message message, Distance distance) Called when a beacon is scanned for the first time or when the distance of the beacon changes (exceeds the specified precision, for example, 1 meter). This callback currently supports only BLE beacon messages. It does not support PendingIntent during subscription. |
Parameters
Name | Description |
|---|---|
message | Object of a published message. |
distance | Updated estimated distance. |
Method |
|---|
public void onFound(Message message) Called when a message is detected for the first time or a lost message is detected again. |
Parameters
Name | Description |
|---|---|
message | Object of a published message. |
Method |
|---|
public void onLost(Message message) Called when a message is no longer discoverable. This callback currently suits BLE beacon messages the best. For other messages, it may not respond in a timely manner. The method is called back only once unless a message is no longer detectable. |
Parameters
Name | Description |
|---|---|
message | Message. |