Skip to content

Commit

Permalink
nimble/audio/bass: Move check_bis_sync function
Browse files Browse the repository at this point in the history
Move location of check_bis_sync function
so calling it would not result in build error
  • Loading branch information
szymon-czapracki committed Oct 31, 2024
1 parent 8f6b9df commit 0c954e0
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions nimble/host/audio/services/bass/src/ble_audio_svc_bass.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0c954e0

Please sign in to comment.