Skip to content

Commit 63edf82

Browse files
committed
host/mesh: make bt_le_adv_start match Zephyr API
During sync `duration` argument was introduced, which is not intended to be in `bt_le_adv_start` - duration of advertising is managed by events in bt_mesh_adv_queue.
1 parent 35a5603 commit 63edf82

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

nimble/host/mesh/include/mesh/glue.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ int bt_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13], const uint8_t *enc_
418418
uint8_t *plaintext, size_t mic_size);
419419
void bt_mesh_register_gatt(void);
420420
int bt_le_adv_start(const struct ble_gap_adv_params *param,
421-
int64_t duration,
422421
const struct bt_data *ad, size_t ad_len,
423422
const struct bt_data *sd, size_t sd_len);
424423

nimble/host/mesh/src/adv_legacy.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ static inline void adv_send(struct os_mbuf *buf)
107107

108108
int64_t time = k_uptime_get();
109109

110-
err = bt_le_adv_start(&param, duration, &ad, 1, NULL, 0);
111-
110+
err = bt_le_adv_start(&param, &ad, 1, NULL, 0);
112111

113112
bt_mesh_adv_send_start(duration, err, BT_MESH_ADV(buf));
114113
if (err) {
@@ -240,6 +239,6 @@ int bt_mesh_adv_start(const struct ble_gap_adv_params *param, int32_t duration,
240239
const struct bt_data *sd, size_t sd_len)
241240
{
242241
adv_timeout = duration;
243-
return bt_le_adv_start(param, duration, ad, ad_len, sd, sd_len);
242+
return bt_le_adv_start(param, ad, ad_len, sd, sd_len);
244243
}
245244
#endif

nimble/host/mesh/src/glue.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,6 @@ ble_adv_conf_adv_instance(const struct ble_gap_adv_params *param, int *instance)
712712

713713
int
714714
bt_le_adv_start(const struct ble_gap_adv_params *param,
715-
int64_t duration,
716715
const struct bt_data *ad, size_t ad_len,
717716
const struct bt_data *sd, size_t sd_len)
718717
{
@@ -778,7 +777,7 @@ bt_le_adv_start(const struct ble_gap_adv_params *param,
778777
}
779778

780779
/*TODO: We could use duration and max events in the future */
781-
err = ble_gap_ext_adv_start(instance, duration, 0);
780+
err = ble_gap_ext_adv_start(instance, 0, 0);
782781
return err;
783782

784783
error:
@@ -792,7 +791,6 @@ bt_le_adv_start(const struct ble_gap_adv_params *param,
792791

793792
int
794793
bt_le_adv_start(const struct ble_gap_adv_params *param,
795-
int64_t duration,
796794
const struct bt_data *ad, size_t ad_len,
797795
const struct bt_data *sd, size_t sd_len)
798796
{

0 commit comments

Comments
 (0)