Skip to content

Commit b0f1eb3

Browse files
Thalleyjhedberg
authored andcommitted
Bluetooth: AICS: Remove bad check in handle_set_gain_op
AICS gain mode does not prevent local nor remote operations from changing the gain setting value. The gain setting value shall simply be ignored if in the BT_AICS_MODE_AUTO_ONLY or BT_AICS_MODE_AUTO modes, but the local application and remote devices can still modify the gain setting value. Signed-off-by: Emil Gydesen <[email protected]>
1 parent fa165da commit b0f1eb3

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

subsys/bluetooth/audio/aics.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ static uint8_t handle_set_gain_op(struct bt_aics *inst, const struct bt_aics_gai
293293
return BT_AICS_ERR_OUT_OF_RANGE;
294294
}
295295

296-
if (BT_AICS_INPUT_MODE_SETTABLE(inst->srv.state.gain_mode) &&
297-
inst->srv.state.gain != cp->gain_setting) {
296+
if (inst->srv.state.gain != cp->gain_setting) {
298297
inst->srv.state.gain = cp->gain_setting;
299298
*state_change = true;
300299
}

subsys/bluetooth/audio/aics_internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
#define BT_AICS_INPUT_MODE_IMMUTABLE(gain_mode) \
4242
((gain_mode) == BT_AICS_MODE_MANUAL_ONLY || (gain_mode) == BT_AICS_MODE_AUTO_ONLY)
4343

44-
#define BT_AICS_INPUT_MODE_SETTABLE(gain_mode) \
45-
((gain_mode) == BT_AICS_MODE_AUTO || (gain_mode) == BT_AICS_MODE_MANUAL)
46-
4744
struct bt_aics_control {
4845
uint8_t opcode;
4946
uint8_t counter;

0 commit comments

Comments
 (0)