Skip to content

Commit a61bfc1

Browse files
jimmodpgeorge
authored andcommitted
aioble/README.md: Add l2cap example.
Signed-off-by: Jim Mussared <[email protected]>
1 parent 3ea7486 commit a61bfc1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

micropython/bluetooth/aioble/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,25 @@ while True:
123123
data = await temp_char.notified()
124124
```
125125

126+
Open L2CAP channels: (Listener)
127+
128+
```py
129+
channel = await connection.l2cap_accept(_L2CAP_PSN, _L2CAP_MTU)
130+
buf = bytearray(64)
131+
n = channel.recvinto(buf)
132+
channel.send(b'response')
133+
```
134+
135+
Open L2CAP channels: (Initiator)
136+
137+
```py
138+
channel = await connection.l2cap_connect(_L2CAP_PSN, _L2CAP_MTU)
139+
channel.send(b'request')
140+
buf = bytearray(64)
141+
n = channel.recvinto(buf)
142+
```
143+
144+
126145
Examples
127146
--------
128147

0 commit comments

Comments
 (0)