当前位置:   article > 正文

蓝牙之十七-bluedroid scan流程

bluedroid scan

蓝牙扫描过程是指扫描蓝牙设备

app层

这里有两张截图

第一张图显示的是安卓设置setting菜单栏中有Bluetooth这一项,点进去以后,点击右上角显示如下的截图。

其中Refresh就是刷新设备列表,也就会扫描设备信息。

上图显示的三个菜单在BluetoothSettings.java文件。

  1. public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  2. if (mLocalAdapter == null) return;
  3. // If the user is not allowed to configure bluetooth, do not show the menu.
  4. if (isUiRestricted()) return;
  5. boolean bluetoothIsEnabled = mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_ON;
  6. boolean isDiscovering = mLocalAdapter.isDiscovering();
  7. int textId = isDiscovering ? R.string.bluetooth_searching_for_devices :
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/820305
推荐阅读
相关标签
  

闽ICP备14008679号