diff mbox series

[v2,3/4] advertising: Use bt_ad_set_max_len

Message ID 20230707224434.677627-3-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 153aaeda2b21012501b22b73c50412edf458ee87
Headers show
Series [v2,1/4] mgmt-tester: Fix tests that consider 31 bytes the max adv lenght | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Luiz Augusto von Dentz July 7, 2023, 10:44 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This uses bt_ad_set_max_len to properly set the maximum data length of
the bt_ad instances based on what the kernel returns.
---
 src/advertising.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/src/advertising.c b/src/advertising.c
index 0dceb14c3be4..6332ec8f9222 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1556,10 +1556,14 @@  static struct btd_adv_client *client_create(struct btd_adv_manager *manager,
 	if (!client->data)
 		goto fail;
 
+	bt_ad_set_max_len(client->data, manager->max_adv_len);
+
 	client->scan = bt_ad_new();
 	if (!client->scan)
 		goto fail;
 
+	bt_ad_set_max_len(client->scan, manager->max_scan_rsp_len);
+
 	client->manager = manager;
 	client->appearance = UINT16_MAX;
 	client->tx_power = ADV_TX_POWER_NO_PREFERENCE;