Skip to content

Commit 2f630e3

Browse files
lylezhu2012henrikbrixandersen
authored andcommitted
doc: Bluetooth: shell: Add document for Classic RFCOMM
Add a document to show how to use the Classic RFCOMM shell commands. Signed-off-by: Lyle Zhu <[email protected]>
1 parent 78fffbe commit 2f630e3

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

doc/connectivity/bluetooth/bluetooth-shell.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ For specific Bluetooth functionality see also the following shell documentation
2525
shell/classic/a2dp.rst
2626
shell/classic/hfp.rst
2727
shell/classic/l2cap.rst
28+
shell/classic/rfcomm.rst
2829
shell/host/gap.rst
2930
shell/host/gatt.rst
3031
shell/host/iso.rst
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
Bluetooth: Classic: RFCOMM Shell
2+
################################
3+
4+
This document describes how to run the Bluetooth Classic RFCOMM functionality.
5+
The :code:`rfcomm` command exposes the Bluetooth Classic RFCOMM Shell commands.
6+
7+
Commands
8+
********
9+
10+
The :code:`rfcomm` commands:
11+
12+
.. code-block:: console
13+
14+
uart:~$ rfcomm
15+
rfcomm - Bluetooth RFCOMM shell commands
16+
Subcommands:
17+
register : [none]
18+
connect : <channel>
19+
disconnect : [none]
20+
send : <number of packets>
21+
rpn : Send RPN command with default settings
22+
23+
Connect
24+
*******
25+
26+
The ACL connection should be established before creating the RFCOMM connection.
27+
28+
.. tabs::
29+
30+
.. group-tab:: Non-initializing device
31+
32+
.. code-block:: console
33+
34+
uart:~$ rfcomm register
35+
RFCOMM channel 5 registered
36+
Security changed: XX:XX:XX:XX:XX:XX level 2
37+
Incoming RFCOMM conn 0x20004dc8
38+
Dlc 0x20000d20 connected
39+
40+
.. group-tab:: Initializing device
41+
42+
.. code-block:: console
43+
44+
uart:~$ rfcomm connect 5
45+
RFCOMM connection pending
46+
Security changed: XX:XX:XX:XX:XX:XX level 2
47+
Dlc 0x20000d20 connected
48+
49+
Send Data
50+
*********
51+
52+
.. tabs::
53+
54+
.. group-tab:: Non-initializing device
55+
56+
.. code-block:: console
57+
58+
Incoming data dlc 0x20000d20 len 30
59+
uart:~$ rfcomm send 1
60+
uart:~$
61+
62+
.. group-tab:: Initializing device
63+
64+
.. code-block:: console
65+
66+
uart:~$ rfcomm send 1
67+
Incoming data dlc 0x20000d20 len 30
68+
69+
Disconnect
70+
**********
71+
72+
Create disconnect request from non-initializing device:
73+
74+
.. tabs::
75+
76+
.. group-tab:: Non-initializing device
77+
78+
.. code-block:: console
79+
80+
uart:~$ rfcomm disconnect
81+
Dlc 0x20000d20 disconnected
82+
uart:~$
83+
84+
.. group-tab:: Initializing device
85+
86+
.. code-block:: console
87+
88+
Dlc 0x20000d20 disconnected
89+
uart:~$
90+
91+
Create disconnect request from initializing device:
92+
93+
.. tabs::
94+
95+
.. group-tab:: Non-initializing device
96+
97+
.. code-block:: console
98+
99+
Dlc 0x20000d20 disconnected
100+
uart:~$
101+
102+
.. group-tab:: Initializing device
103+
104+
.. code-block:: console
105+
106+
uart:~$ rfcomm disconnect
107+
Dlc 0x20000d20 disconnected
108+
uart:~$

0 commit comments

Comments
 (0)