2020-04-09 10:31:30

by Szymon Janc

[permalink] [raw]
Subject: [PATCH] test/example-advertisement: Fix advertising when discoverable

If adapter is discoverable (or LE-only) advertising was failing due
to too big adv data being set. Make sure there is enough space left
for flags if needed.
---
test/example-advertisement | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/example-advertisement b/test/example-advertisement
index 88a27ab34..f116893b6 100755
--- a/test/example-advertisement
+++ b/test/example-advertisement
@@ -142,7 +142,7 @@ class TestAdvertisement(Advertisement):
Advertisement.__init__(self, bus, index, 'peripheral')
self.add_service_uuid('180D')
self.add_service_uuid('180F')
- self.add_manufacturer_data(0xffff, [0x00, 0x01, 0x02, 0x03, 0x04])
+ self.add_manufacturer_data(0xffff, [0x00, 0x01, 0x02, 0x03])
self.add_service_data('9999', [0x00, 0x01, 0x02, 0x03, 0x04])
self.add_local_name('TestAdvertisement')
self.include_tx_power = True
--
2.25.2


2020-04-09 18:32:06

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] test/example-advertisement: Fix advertising when discoverable

Hi Szymon,

On Thu, Apr 9, 2020 at 3:33 AM Szymon Janc <[email protected]> wrote:
>
> If adapter is discoverable (or LE-only) advertising was failing due
> to too big adv data being set. Make sure there is enough space left
> for flags if needed.
> ---
> test/example-advertisement | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/example-advertisement b/test/example-advertisement
> index 88a27ab34..f116893b6 100755
> --- a/test/example-advertisement
> +++ b/test/example-advertisement
> @@ -142,7 +142,7 @@ class TestAdvertisement(Advertisement):
> Advertisement.__init__(self, bus, index, 'peripheral')
> self.add_service_uuid('180D')
> self.add_service_uuid('180F')
> - self.add_manufacturer_data(0xffff, [0x00, 0x01, 0x02, 0x03, 0x04])
> + self.add_manufacturer_data(0xffff, [0x00, 0x01, 0x02, 0x03])
> self.add_service_data('9999', [0x00, 0x01, 0x02, 0x03, 0x04])
> self.add_local_name('TestAdvertisement')
> self.include_tx_power = True
> --
> 2.25.2

Applied, thanks.

--
Luiz Augusto von Dentz