Skip to content

Commit

Permalink
Bluetooth: Fix using advertising instance duration as timeout
Browse files Browse the repository at this point in the history
When using LE Set Extended Advertising Enable command the duration
refers to the lifetime of instance not the length which is actually
controlled by the interval_min and interval_max when setting the
parameters.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Luiz Augusto von Dentz authored and Marcel Holtmann committed Oct 26, 2019
1 parent de76f73 commit 10bbffa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/hci_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ int __hci_req_enable_ext_advertising(struct hci_request *req, u8 instance)
* scheduling it.
*/
if (adv_instance && adv_instance->duration) {
u16 duration = adv_instance->duration * MSEC_PER_SEC;
u16 duration = adv_instance->timeout * MSEC_PER_SEC;

/* Time = N * 10 ms */
adv_set->duration = cpu_to_le16(duration / 10);
Expand Down

0 comments on commit 10bbffa

Please sign in to comment.