Hi David,

On Tue, Jan 24, 2017 at 9:26 PM, David G. Simmons <[email protected]> wrote:

> These fields are also still using unit16_t, etc. instead of the new
> bleu_uinit16_t for UUIDs in various places:
>
> struct ble_hs_adv_fields {
>     /*** 0x01 - Flags. */
>     uint8_t flags;
>     unsigned flags_is_present:1;
>
>     /*** 0x02,0x03 - 16-bit service class UUIDs. */
>     uint16_t *uuids16;
>     uint8_t num_uuids16;
>     unsigned uuids16_is_complete:1;
>
>     /*** 0x04,0x05 - 32-bit service class UUIDs. */
>     uint32_t *uuids32;
>     uint8_t num_uuids32;
>     unsigned uuids32_is_complete:1;
>
>     /*** 0x06,0x07 - 128-bit service class UUIDs. */
>     void *uuids128;
>     uint8_t num_uuids128;
>     unsigned uuids128_is_complete:1;
>
>
This was actually left on purpose.

The problem is that incoming adv reports are unpacked to this struct by the
host and there are internal buffers to store UUIDs which can then be
pointed here. Converting these fields to UUIDs would also require changing
these buffers and they would consume extra memory. With this adv API rework
we can also fix this properly - I guess adv data will just be passed to
application also as a raw buffer so there would be no need to unpack in the
host internally.

BR,
Andrzej

Reply via email to