Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
从安卓设备做广告时(支持 BLE 外设模式)
有没有办法将广告数据元素添加到扫描响应中?
我认为当中心角色设备正在执行主动扫描时发送空扫描响应,因为我们在自己的硬件中接收到两个 RSSI 值
使用具有两个 AdvertiseData 类型参数的启动广告方法。一个是广告数据包,另一个是扫描响应。从 Android 开发者网站查看这个构造函数:
startAdvertising(AdvertiseSettings settings, AdvertiseData advertiseData, AdvertiseData scanResponse, AdvertiseCallback callback)