From 0c954e0c3a41aec5792b98801231a591c3ff2415 Mon Sep 17 00:00:00 2001 From: Szymon Czapracki Date: Thu, 31 Oct 2024 14:32:12 +0100 Subject: [PATCH] nimble/audio/bass: Move check_bis_sync function Move location of check_bis_sync function so calling it would not result in build error --- .../services/bass/src/ble_audio_svc_bass.c | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/nimble/host/audio/services/bass/src/ble_audio_svc_bass.c b/nimble/host/audio/services/bass/src/ble_audio_svc_bass.c index e3cecb060e..5d5fa87230 100644 --- a/nimble/host/audio/services/bass/src/ble_audio_svc_bass.c +++ b/nimble/host/audio/services/bass/src/ble_audio_svc_bass.c @@ -282,6 +282,28 @@ ble_svc_audio_bass_remote_scan_started(uint8_t *data, uint16_t data_len, uint16_ return 0; } +static int +check_bis_sync(uint16_t num_subgroups, struct ble_svc_audio_bass_subgroup *subgroups) +{ + uint32_t bis_sync_mask = 0; + int i; + int j; + + for (i = 0; i < num_subgroups; i++) { + if (subgroups[i].bis_sync_state != 0xFFFFFFFF) { + for (j = 0; j < num_subgroups; j++) { + if (subgroups[i].bis_sync_state & bis_sync_mask) { + return BLE_HS_EINVAL; + } + + bis_sync_mask |= subgroups[i].bis_sync_state; + } + } + } + + return 0; +} + static int ble_svc_audio_bass_add_source(uint8_t *data, uint16_t data_len, uint16_t conn_handle) { @@ -444,27 +466,6 @@ ble_svc_audio_bass_add_source(uint8_t *data, uint16_t data_len, uint16_t conn_ha } static int -check_bis_sync(uint16_t num_subgroups, struct ble_svc_audio_bass_subgroup *subgroups) -{ - uint32_t bis_sync_mask = 0; - int i; - int j; - - for (i = 0; i < num_subgroups; i++) { - if (subgroups[i].bis_sync != 0xFFFFFFFF) { - for (j = 0; j < num_subgroups; j++) { - if (subgroups[i].bis_sync & bis_sync_mask) { - return BLE_HS_EINVAL; - } - - bis_sync_mask |= subgroups[i].bis_sync; - } - } - } - - return 0; -} - ble_svc_audio_bass_modify_source(uint8_t *data, uint16_t data_len, uint16_t conn_handle) { struct ble_svc_audio_bass_operation operation;