BLE does not read whole buffer data
-
@jmarcelino
I see that MI BAND 2 is BLE4.2 device.
and it follow spec
http://microchipdeveloper.com/wireless:ble-link-layer-packet-types -
@livius
It's not possible to send such a long advertising packet even in Bluetooth 4.2, you'd need Bluetooth 5 (with LE Advertising Extensions) for that.If you look up that Microchip reference the Advertising Channel PDUs have a 0-37 bytes Payload and you need the device address on top (6 bytes) on that so the maximum actual data is 31 bytes.
If you are seeing longer packets it's probably because your BLE scanner combines the result of the advertising packet with the scan response.
-
@jmarcelino
Thank you Jose i am new in BLE protocol and must dig more.
But this will be strange if BLE4.2 device will advertise in mixed protocol
I suppose that your last sentence is much more possible. -
@livius
It really combine SCAN_RSP packet.
And now i have question, how can i make active scan with wipy2.
Because i understand that 'start_scan' do passive scan only? -
@livius
The current scan is active: https://github.com/pycom/pycom-micropython-sigfox/blob/eca3b714a11c4b84e740a36b4096a20aac3c9be2/esp32/mods/modbt.c#L271but we don't combine the scan response, only show advertising data.
-
@jmarcelino
Is there possibility to got scan response data somehow then? -
@livius
That's not available yet, sorry -
@jmarcelino
thank you for that info.
I will dig into sources if something can be done self here. -
@jmarcelino +1 to have the scan reponse available :) thank you
-
@jmarcelino
I see that in public firmware it is now also avaiable :)(mac=b'\xd2lBk\xad\xc2', addr_type=1, adv_type=0, rssi=-83, data=b'\x02\x01\x06\x1b\xffW\x01\x00\xef\xbf\xc9\xac\xe7\xd5\xd0.\xe5\xf0\x8cr[\x8b[w\x03\xd2lBk\xad\xc2\n\tMI Band 2\x03\x02\xe0\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') {'NameShort': None, 'Flag': 6, 'Mac': b'd26c426badc2', 'NameComplete': b'4d492042616e642032', 'MfrData': b'570100efbfc9ace7d5d02ee5f08c725b8b5b7703d26c426badc2', 'Data': b'0201061bff570100efbfc9ace7d5d02ee5f08c725b8b5b7703d26c426badc20a094d492042616e6420320302e0fe00000000000000000000000000000000', 'Rssi': -83, 'Appearance': None}'NameComplete': b'4d492042616e642032'import binascii a=b'4d492042616e642032' c=binascii.unhexlify(a) print(c)give me proper result :)
'MI Band 2'
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login