前言: 之前介绍过很多蓝牙beacon.搜索.连接.通讯的文章.不过最近我发现:之前写的蓝牙广播包搜索的工程,搜索频率太慢,而且不能一直保持搜索状态.因此,这里探讨下高频蓝牙广播包扫描 -- 蓝牙BLE扫描. 注:本文将从对比之前慢的和现在快的两个工程进行展开 1.初始化-onCreate 新的: // Get the local Bluetooth adapter // Initializes Bluetooth adapter. final BluetoothManager blueto
http://blog.csdn.net/hailangnet/article/details/47723181 http://www.aiuxian.com/article/p-3012084.html http://blog.csdn.net/linuxheik/article/details/51924232 service bluetooth start 修改蓝牙配置文件 蓝牙采用/etc/bluetooth/ hcid.conf rfcomm.conf
算法: /** * 功能:根据rssi计算距离 * Created by liuhuichao on 2017/1/17. */ public class RssiUtil { //A和n的值,需要根据实际环境进行检测得出 private static final double A_Value=50;/**A - 发射端和接收端相隔1米时的信号强度*/ private static final double n_Value=2.5;/** n - 环境衰减因子*/ /** * 根据Rssi获得返