Skip to content

Commit a95457a

Browse files
ppryga-nordiccarlescufi
authored andcommitted
Bluetooth: controller: df: Fixes truncated transmission of CTE
There was an issue with wrong length of CTE send in connectionless mode, with periodic advertising PDUs. Radio peripheral was not configured to send CTE with correct length while PDU had CTEInfo field informing receiver that CTE is attached to the PDU. Source of the problem was in ll_df_set_cl_cte_tx_enable function. Order of parameters in ull_adv_sync_pdu_alloc was wrong. ULL_ADV_PDU_HDR_FIELD_CTE_INFO was speficed as hdr_rem_fields. Because of that extra_data, memory used to provide CTE configuration to LLL, was not allocated. PDU content is prepared in ULL, so CTEInfo field included correct information, while Radio was never configured by LLL to send CTE. ull_adv_sync_extra_data_set_clear received a pointer to hdr_data, instead of a direct pointer to df_cfg structure. When extra_data was allocated correclty, wrong CTE configuration was provided copied there and LLL received invalid CTE length. It was different than the length in PDUs CTEInfo field. Signed-off-by: Piotr Pryga <[email protected]>
1 parent 78c222e commit a95457a

File tree

1 file changed

+5
-8
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+5
-8
lines changed

subsys/bluetooth/controller/ll_sw/ull_df.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -345,20 +345,17 @@ uint8_t ll_df_set_cl_cte_tx_enable(uint8_t adv_handle, uint8_t cte_enable)
345345
hdr_data.field_data = (uint8_t *)&cte_info;
346346
hdr_data.extra_data = df_cfg;
347347

348-
err = ull_adv_sync_pdu_alloc(adv, 0,
349-
ULL_ADV_PDU_HDR_FIELD_CTE_INFO,
350-
NULL, &pdu_prev, &pdu,
351-
&extra_data_prev, &extra_data,
348+
err = ull_adv_sync_pdu_alloc(adv, ULL_ADV_PDU_HDR_FIELD_CTE_INFO, 0, NULL,
349+
&pdu_prev, &pdu, &extra_data_prev, &extra_data,
352350
&ter_idx);
353351
if (err) {
354352
return err;
355353
}
356354

357355
if (extra_data) {
358-
ull_adv_sync_extra_data_set_clear(extra_data_prev,
359-
extra_data,
360-
ULL_ADV_PDU_HDR_FIELD_CTE_INFO,
361-
0, &hdr_data);
356+
ull_adv_sync_extra_data_set_clear(extra_data_prev, extra_data,
357+
ULL_ADV_PDU_HDR_FIELD_CTE_INFO, 0,
358+
&df_cfg);
362359
}
363360

364361
err = ull_adv_sync_pdu_set_clear(lll_sync, pdu_prev, pdu,

0 commit comments

Comments
 (0)