Skip to content

Commit dd5119f

Browse files
erbr-otcarlescufi
authored andcommitted
Bluetooth: controller: check for instant on reception of CONN_UPD_IND
Instead of waiting one connection interval, as a result of the state change, perform the check for instant already on reception of CONNECTION_UPDATE_IND Signed-off-by: Erik Brockhoff <[email protected]>
1 parent 26f6941 commit dd5119f

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -944,31 +944,6 @@ static void rp_cu_st_wait_tx_conn_update_ind(struct ll_conn *conn, struct proc_c
944944
}
945945
}
946946

947-
static void rp_cu_st_wait_rx_conn_update_ind(struct ll_conn *conn, struct proc_ctx *ctx,
948-
uint8_t evt, void *param)
949-
{
950-
switch (evt) {
951-
case RP_CU_EVT_CONN_UPDATE_IND:
952-
switch (conn->lll.role) {
953-
case BT_HCI_ROLE_CENTRAL:
954-
ctx->unknown_response.type = PDU_DATA_LLCTRL_TYPE_CONN_UPDATE_IND;
955-
rp_cu_send_unknown_rsp(conn, ctx, evt, param);
956-
break;
957-
case BT_HCI_ROLE_PERIPHERAL:
958-
llcp_pdu_decode_conn_update_ind(ctx, param);
959-
/* TODO(tosk): skip/terminate if instant passed? */
960-
ctx->state = RP_CU_STATE_WAIT_INSTANT;
961-
break;
962-
default:
963-
/* Unknown role */
964-
LL_ASSERT(0);
965-
}
966-
default:
967-
/* Ignore other evts */
968-
break;
969-
}
970-
}
971-
972947
static void rp_cu_check_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
973948
void *param)
974949
{
@@ -1000,6 +975,32 @@ static void rp_cu_check_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint
1000975
}
1001976
}
1002977

978+
static void rp_cu_st_wait_rx_conn_update_ind(struct ll_conn *conn, struct proc_ctx *ctx,
979+
uint8_t evt, void *param)
980+
{
981+
switch (evt) {
982+
case RP_CU_EVT_CONN_UPDATE_IND:
983+
switch (conn->lll.role) {
984+
case BT_HCI_ROLE_CENTRAL:
985+
ctx->unknown_response.type = PDU_DATA_LLCTRL_TYPE_CONN_UPDATE_IND;
986+
rp_cu_send_unknown_rsp(conn, ctx, evt, param);
987+
break;
988+
case BT_HCI_ROLE_PERIPHERAL:
989+
llcp_pdu_decode_conn_update_ind(ctx, param);
990+
ctx->state = RP_CU_STATE_WAIT_INSTANT;
991+
/* In case we only just received it in time */
992+
rp_cu_check_instant(conn, ctx, evt, param);
993+
break;
994+
default:
995+
/* Unknown role */
996+
LL_ASSERT(0);
997+
}
998+
default:
999+
/* Ignore other evts */
1000+
break;
1001+
}
1002+
}
1003+
10031004
static void rp_cu_st_wait_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
10041005
void *param)
10051006
{

0 commit comments

Comments
 (0)