mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-21 04:07:55 +00:00
host/audio/pacs: verify if set available contexts are supported
We shouldn't allow to set available contexts that are not set to be supported.
This commit is contained in:
committed by
Krzysztof Kopyściński
parent
25bf03e1fa
commit
1cf220fd12
@@ -421,6 +421,11 @@ ble_svc_audio_pacs_avail_contexts_set(uint16_t conn_handle,
|
||||
return BLE_HS_ENOENT;
|
||||
}
|
||||
|
||||
if ((sink_contexts & ble_svc_audio_pacs_sup_sink_contexts) != sink_contexts ||
|
||||
(source_contexts & ble_svc_audio_pacs_sup_source_contexts) != source_contexts) {
|
||||
return BLE_HS_ENOTSUP;
|
||||
}
|
||||
|
||||
avail_ctx->ble_svc_audio_pacs_avail_sink_contexts = sink_contexts;
|
||||
avail_ctx->ble_svc_audio_pacs_avail_source_contexts = source_contexts;
|
||||
avail_ctx->val_changed = true;
|
||||
|
||||
Reference in New Issue
Block a user