Skip to content

Commit a61bfc1

Browse files
jimmodpgeorge
authored andcommitted
aioble/README.md: Add l2cap example.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy