Skip to content

Commit

Permalink
[nrf fromtree] Bluetooth: Host: Fix wrong length of antenna identifie…
Browse files Browse the repository at this point in the history
…rs for CTE RX

There were used an uninitialized variable to set antenna identifiers
length. The value should be set with use of params argument, not
by cp pointer that is not yet initialized.

Signed-off-by: Piotr Pryga <[email protected]>
(cherry picked from commit c889e34)
  • Loading branch information
ppryga-nordic authored and mbolivar-nordic committed Feb 11, 2022
1 parent 76b7916 commit d391784
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/bluetooth/host/direction.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ prepare_cl_cte_rx_enable_cmd_params(struct net_buf **buf, struct bt_le_per_adv_s
uint8_t switch_pattern_len;

if (params->cte_types & BT_DF_CTE_TYPE_AOA) {
switch_pattern_len = cp->switch_pattern_len;
switch_pattern_len = params->num_ant_ids;
} else {
switch_pattern_len = ARRAY_SIZE(df_dummy_switch_pattern);
}
Expand Down Expand Up @@ -522,7 +522,7 @@ static int prepare_conn_cte_rx_enable_cmd_params(struct net_buf **buf, struct bt
uint8_t switch_pattern_len;

if (params->cte_types & BT_DF_CTE_TYPE_AOA) {
switch_pattern_len = cp->switch_pattern_len;
switch_pattern_len = params->num_ant_ids;
} else {
switch_pattern_len = ARRAY_SIZE(df_dummy_switch_pattern);
}
Expand Down

0 comments on commit d391784

Please sign in to comment.