我怎样才能在scaning时读取Android的蓝牙广告数据 [英] How can I read the Bluetooth advertisement data in android at the time of scaning
问题描述
我怎样才能读取Android的蓝牙广告数据。像每一个蓝牙设备发送一些包以及包中包含的一些信息,所以我需要读取其中包含了长度整个数据包,配置文件等。
How can I read the Bluetooth advertisement data in android. like every Bluetooth device transmitting some packets and that packet contains some information so i need to read the whole packet which contains the length, profile etc
推荐答案
BluetoothAdapter.LeScanCallback ,如下的回调方法有一个名为 scanRecord 参数,它应该将广告数据由BLE装置发送。
in BluetoothAdapter.LeScanCallback, the call back method as follow has a parameter named scanRecord, which should be the advertisement data send by BLE device.
公共抽象无效onLeScan(BluetoothDevice类设备,诠释RSSI,字节[] scanRecord)
scanRecord:远程设备提供的广告记录的内容
scanRecord: The content of the advertisement record offered by the remote device.
这篇关于我怎样才能在scaning时读取Android的蓝牙广告数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!