Skip to content

aioble: fix ScanResult.services decoding of UUIDs, and add/improve multitests#863

Merged
dpgeorge merged 4 commits intomicropython:masterfrom
dpgeorge:aioble-advertising-services
May 27, 2024
Merged

aioble: fix ScanResult.services decoding of UUIDs, and add/improve multitests#863
dpgeorge merged 4 commits intomicropython:masterfrom
dpgeorge:aioble-advertising-services

Conversation

@dpgeorge
Copy link
Copy Markdown
Member

Following on from #787 , this makes a similar fix on the central side:

  • There may be more than one UUID per advertising field.
  • The UUID advertising field may be empty (no UUIDs).
  • Constructing 32-bit bluetooth.UUID() entities, which must be done by passing in a 4-byte bytes object, not an integer.

A multitest is added for these cases.

Also, other minor fixups for the multitests.

Fixes are needed to support the cases of:
- There may be more than one UUID per advertising field.
- The UUID advertising field may be empty (no UUIDs).
- Constructing 32-bit `bluetooth.UUID()` entities, which must be done by
  passing in a 4-byte bytes object, not an integer.

Signed-off-by: Damien George <damien@micropython.org>
dpgeorge added 3 commits May 25, 2024 20:51
This tests both encoding and decoding multiple 16-bit and 32-bit services
within the one advertising field.

Signed-off-by: Damien George <damien@micropython.org>
Testing shows that the first two writes always go through and the rest are
dropped, so update the .exp file to match that.

Signed-off-by: Damien George <damien@micropython.org>
The perf multitests now "pass" when run.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the aioble-advertising-services branch from f4efda7 to 2c30a4e Compare May 25, 2024 10:52
@dpgeorge dpgeorge merged commit 2c30a4e into micropython:master May 27, 2024
@dpgeorge dpgeorge deleted the aioble-advertising-services branch May 27, 2024 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant