我正在尝试通过蓝牙从android设备向hololens发送简单的字符串。
我已经准备好完成,但是android设备在调用startAdvertising()之后连续将字符串发送到服务器。
BluetoothAdapter mBluetoothAdapter;
BluetoothLeAdvertiser mBLEAdvertiser;
private void startAdvertising(int manufactureId, byte[] manufactureData) throws InterruptedException {
if (mBLEAdvertiser == null) return;
AdvertiseSettings settings = new AdvertiseSettings.Builder()
.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_BALANCED)
.setConnectable(false)
.setTimeout(0)
.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_MEDIUM)
.build();
AdvertiseData data = new AdvertiseData.Builder()
.addManufacturerData(manufactureId, manufactureData)
.build();
mBLEAdvertiser.startAdvertising(settings, data, mAdvertiseCallback);
我正在尝试通过蓝牙将简单的字符串从android设备发送到hololens。我已经准备好完成此操作,但是android设备在调用...
[当AdvertiseSettings.Builder#setTimeout()将广告时间的值设置为0时,该时间限制将被禁用,除非调用BluetoothLeAdvertiser#stopAdvertising(),否则广告将一直有效。