Skip to content

Commit 0520dfe

Browse files
mahori-ravinderhenrikbrixandersen
authored andcommitted
Bluetooth: Tester: Fixed read_multiple_var
read_multi_var was always sending 5 as count of handles. This was causing failure in GATT/CL/GAR/BI-36-C, GATT/CL/GAR/BI-40-C and other tests expecting IUT to send GATT_ReadMultipleVariableLengthRequest Fixed this was using the cp->handles_count coming by autoPTS. Signed-off-by: Ravinder Singh <[email protected]>
1 parent eb931d4 commit 0520dfe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/bluetooth/tester/src/btp_gatt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,6 @@ static uint8_t read_multiple_var(const void *cmd, uint16_t cmd_len,
16821682
const struct btp_gatt_read_multiple_var_cmd *cp = cmd;
16831683
uint16_t handles[5];
16841684
struct bt_conn *conn;
1685-
int i;
16861685

16871686
if ((cmd_len < sizeof(*cp)) ||
16881687
(cmd_len != sizeof(*cp) + (cp->handles_count * sizeof(cp->handles[0])))) {
@@ -1693,7 +1692,7 @@ static uint8_t read_multiple_var(const void *cmd, uint16_t cmd_len,
16931692
return BTP_STATUS_FAILED;
16941693
}
16951694

1696-
for (i = 0; i < ARRAY_SIZE(handles); i++) {
1695+
for (int i = 0; i < cp->handles_count; i++) {
16971696
handles[i] = sys_le16_to_cpu(cp->handles[i]);
16981697
}
16991698

@@ -1708,7 +1707,7 @@ static uint8_t read_multiple_var(const void *cmd, uint16_t cmd_len,
17081707
}
17091708

17101709
read_params.func = read_cb;
1711-
read_params.handle_count = i;
1710+
read_params.handle_count = cp->handles_count;
17121711
read_params.multiple.handles = handles; /* not used in read func */
17131712
read_params.multiple.variable = true;
17141713
#if defined(CONFIG_BT_EATT)

0 commit comments

Comments
 (0)