admin管理员组文章数量:1291187
I am using Bleak Library in Python in Windows OS to read data from a BLE device continuously which is advertising 18bytes of data every 5seconds. But I am missing some advertisement packets. Below is the code I am using. Can someone suggest why some packets are missed
ble_address = "DEVICE MAC ADDRESS"
async def run():
found = False
while(1):
devices = await BleakScanner.discover(1,return_adv=True)
for d in devices:
if(d == ble_address):
print(f"{datetime.datetime.now()}: {devices[d][1]}")
data = devices[d][1].manufacturer_data
print([hex(x) for x in list(data[1318])])
found = True
break
asyncio.run(run())
output:
2025-01-24 20:37:10.801869: AdvertisementData(manufacturer_data={1318: b'wxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x00'}, rssi=-22)
['0x77', '0x78', '0x79', '0x7a', '0x7b', '0x7c', '0x7d', '0x7e', '0x7f', '0x80', '0x81', '0x82', '0x83', '0x84', '0x85', '0x86', '0x87', '0x88', '0x0']
I expected all the advertisement frames to be captured, but many frames are missing from the data
本文标签:
版权声明:本文标题:bluetooth lowenergy - Loosing BLE advertisement packet while reading using Bleak library in Python in Windows 11 enterprise - St 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741527466a2383555.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论