Skip to content

Commit

Permalink
applications: nrf5340_audio: Only change conn param for one direction
Browse files Browse the repository at this point in the history
- We shouldn't try to update conn params for both sink and source.
- Check direction that triggered callback and what dirs are enabled.
- OCT-3035

Signed-off-by: Alexander Svensen <[email protected]>
  • Loading branch information
alexsven authored and anangl committed Jun 11, 2024
1 parent 4af710a commit 44120b0
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions applications/nrf5340_audio/unicast_client/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,23 @@ static void le_audio_msg_sub_thread(void)
break;

case LE_AUDIO_EVT_CONFIG_RECEIVED:
struct bt_le_conn_param param;

/* Set the ACL interval up to allow more time for ISO packets */
param.interval_min = CONFIG_BLE_ACL_CONN_INTERVAL_SLOW;
param.interval_max = CONFIG_BLE_ACL_CONN_INTERVAL_SLOW;
param.latency = CONFIG_BLE_ACL_SLAVE_LATENCY;
param.timeout = CONFIG_BLE_ACL_SUP_TIMEOUT;
/* Only update conn param once */
if ((IS_ENABLED(CONFIG_AUDIO_TX) && msg.dir == BT_AUDIO_DIR_SINK) ||
(!IS_ENABLED(CONFIG_AUDIO_TX) && msg.dir == BT_AUDIO_DIR_SOURCE)) {
struct bt_le_conn_param param;

ret = bt_conn_le_param_update(msg.conn, &param);
if (ret) {
LOG_WRN("Failed to update conn parameters: %d", ret);
}
/* Set the ACL interval up to allow more time for ISO packets */
param.interval_min = CONFIG_BLE_ACL_CONN_INTERVAL_SLOW;
param.interval_max = CONFIG_BLE_ACL_CONN_INTERVAL_SLOW;
param.latency = CONFIG_BLE_ACL_SLAVE_LATENCY;
param.timeout = CONFIG_BLE_ACL_SUP_TIMEOUT;

ret = bt_conn_le_param_update(msg.conn, &param);
if (ret) {
LOG_WRN("Failed to update conn parameters: %d", ret);
}
}
LOG_DBG("LE audio config received");

ret = unicast_client_config_get(msg.conn, msg.dir, &bitrate_bps,
Expand Down

0 comments on commit 44120b0

Please sign in to comment.