/**
* Stop a BLE advertising.
*
* @param callbackId The callbackId corresponding to the {@link
* BluetoothLeAdvertiserSnippet#bleStartAdvertising} call that started the advertising.
* @throws BluetoothLeScannerSnippet.BluetoothLeScanSnippetException
*/
@RpcMinSdk(Build.VERSION_CODES.LOLLIPOP_MR1)
@Rpc(description = "Stop BLE advertising.")
public void bleStopAdvertising(String callbackId) throws BluetoothLeAdvertiserSnippetException {
AdvertiseCallback callback = mAdvertiseCallbacks.remove(callbackId);
if (callback == null) {
throw new BluetoothLeAdvertiserSnippetException(
"No advertising session found for ID " + callbackId);
}
mAdvertiser.stopAdvertising(callback);
}
BluetoothLeAdvertiserSnippet.java 文件源码
java
阅读 44
收藏 0
点赞 0
评论 0
项目:mobly-bundled-snippets
作者:
评论列表
文章目录