aioble/l2cap: Fix psm variable name.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pull/540/head
Andrew Leech 2022-09-16 11:27:58 +10:00 zatwierdzone przez Jim Mussared
rodzic 7602843209
commit 0c5880d2e4
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -178,14 +178,14 @@ class L2CAPChannel:
# Use connection.l2cap_accept() instead of calling this directly. # Use connection.l2cap_accept() instead of calling this directly.
async def accept(connection, psn, mtu, timeout_ms): async def accept(connection, psm, mtu, timeout_ms):
global _listening global _listening
channel = L2CAPChannel(connection) channel = L2CAPChannel(connection)
# Start the stack listening if necessary. # Start the stack listening if necessary.
if not _listening: if not _listening:
ble.l2cap_listen(psn, mtu) ble.l2cap_listen(psm, mtu)
_listening = True _listening = True
# Wait for the connect irq from the remote connection. # Wait for the connect irq from the remote connection.
@ -195,14 +195,14 @@ async def accept(connection, psn, mtu, timeout_ms):
# Use connection.l2cap_connect() instead of calling this directly. # Use connection.l2cap_connect() instead of calling this directly.
async def connect(connection, psn, mtu, timeout_ms): async def connect(connection, psm, mtu, timeout_ms):
if _listening: if _listening:
raise ValueError("Can't connect while listening") raise ValueError("Can't connect while listening")
channel = L2CAPChannel(connection) channel = L2CAPChannel(connection)
with connection.timeout(timeout_ms): with connection.timeout(timeout_ms):
ble.l2cap_connect(connection._conn_handle, psn, mtu) ble.l2cap_connect(connection._conn_handle, psm, mtu)
# Wait for the connect irq from the remote connection. # Wait for the connect irq from the remote connection.
# If the connection fails, we get a disconnect event (with status) instead. # If the connection fails, we get a disconnect event (with status) instead.