use of android.bluetooth.le.AdvertiseData in project physical-web by google.
the class FatBeaconBroadcastService method broadcastUrl.
/////////////////////////////////
// utilities
/////////////////////////////////
// Broadcast via bluetooth the stored URL
private void broadcastUrl() {
byte[] bytes = null;
try {
bytes = mDisplayInfo.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
Log.e(TAG, "Could not encode URL", e);
return;
}
AdvertiseData advertiseData = AdvertiseDataUtils.getFatBeaconAdvertisementData(bytes);
AdvertiseSettings advertiseSettings = AdvertiseDataUtils.getAdvertiseSettings(true);
mBluetoothLeAdvertiser.stopAdvertising(mAdvertiseCallback);
mBluetoothLeAdvertiser.startAdvertising(advertiseSettings, advertiseData, mAdvertiseCallback);
}
use of android.bluetooth.le.AdvertiseData in project physical-web by google.
the class PhysicalWebBroadcastService method broadcastUrl.
/////////////////////////////////
// utilities
/////////////////////////////////
// Broadcast via bluetooth the stored URL
private void broadcastUrl(byte[] url) {
final AdvertiseData advertisementData = AdvertiseDataUtils.getAdvertisementData(url);
final AdvertiseSettings advertiseSettings = AdvertiseDataUtils.getAdvertiseSettings(false);
mBluetoothLeAdvertiser.stopAdvertising(mAdvertiseCallback);
mBluetoothLeAdvertiser.startAdvertising(advertiseSettings, advertisementData, mAdvertiseCallback);
}
Aggregations