Thanks for the contribution. What you've done here looks correct, according to the BT Core Supplement.
A few points:
- Prior to this change, if the user specifies a list of
servicesthen the order in which they specify them is the order they appear in the advertising data. With this change, 16-bit services appear first, then 32-bit, then 128-bit. That probably doesn't matter but worth discussing. - The aioble central logic will need to change to be compatible with the fix in this PR. The central code currently assumes that a service field contains exactly one service, and that will have to be extended to support 0 or more services per field (the spec apparently allows a zero length payload in the service field, to indicate no services of this size are available on this peripheral).
Thanks, this is a bug, we do not current handle the decoding case where multiple service UUIDs are encoded into the same field (as an optimisation we should also handle this on the encode side too).
I don't get service data work wither, for example sending temperature values to central. Manufacturer information seems to work though.