Skip to content

Commit 623479c

Browse files
jerryyang35kartben
authored andcommitted
Bluetooth: RFCOMM: Fix CR bit in DISC frame
The CR bit in DISC frames should be set as a command rather than a response. This patch fixes the rfcomm_send_disc function to correctly use BT_RFCOMM_CMD_CR instead of BT_RFCOMM_RESP_CR when setting the CR bit in the address field of DISC frames. Signed-off-by: Jiawei Yang <[email protected]>
1 parent f06f6be commit 623479c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/bluetooth/host/classic/rfcomm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int rfcomm_send_disc(struct bt_rfcomm_session *session, uint8_t dlci)
376376
buf = bt_l2cap_create_pdu(NULL, 0);
377377

378378
hdr = net_buf_add(buf, sizeof(*hdr));
379-
cr = BT_RFCOMM_RESP_CR(session->role);
379+
cr = BT_RFCOMM_CMD_CR(session->role);
380380
hdr->address = BT_RFCOMM_SET_ADDR(dlci, cr);
381381
hdr->control = BT_RFCOMM_SET_CTRL(BT_RFCOMM_DISC, BT_RFCOMM_PF_NON_UIH);
382382
hdr->length = BT_RFCOMM_SET_LEN_8(0);

0 commit comments

Comments
 (0)