mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-24 06:29:10 +00:00
nimble/audio/bass: Add data length check in BASS remote scan
This commit adds data length checks to remote scan operations. Now any data coming with remote scan start/stop will result in instant ATT error.
This commit is contained in:
committed by
Szymon Janc
parent
dff71a2888
commit
6f5b33ca0c
@@ -251,6 +251,10 @@ ble_svc_audio_bass_receive_state_free(struct ble_svc_audio_bass_rcv_state_entry
|
||||
static int
|
||||
ble_svc_audio_bass_remote_scan_stopped(uint8_t *data, uint16_t data_len, uint16_t conn_handle)
|
||||
{
|
||||
if (data_len > 1) {
|
||||
return BLE_ATT_ERR_WRITE_REQ_REJECTED;
|
||||
}
|
||||
|
||||
struct ble_audio_event ev = {
|
||||
.type = BLE_AUDIO_EVENT_BASS_REMOTE_SCAN_STOPPED
|
||||
};
|
||||
@@ -264,6 +268,10 @@ ble_svc_audio_bass_remote_scan_stopped(uint8_t *data, uint16_t data_len, uint16_
|
||||
static int
|
||||
ble_svc_audio_bass_remote_scan_started(uint8_t *data, uint16_t data_len, uint16_t conn_handle)
|
||||
{
|
||||
if (data_len > 1) {
|
||||
return BLE_ATT_ERR_WRITE_REQ_REJECTED;
|
||||
}
|
||||
|
||||
struct ble_audio_event ev = {
|
||||
.type = BLE_AUDIO_EVENT_BASS_REMOTE_SCAN_STARTED
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user