Using default MTU value warning when using client.mtu_size() #1166
-
DescriptionWhen I call What I Didimport asyncio
import sys
from bleak import BleakScanner, BleakClient
from bleak.backends.winrt.client import logger as bleak_log
DEFAULT_MAC = "05:55:F5:73:C5:E7"
async def main(ble_address: str):
print("Connecting")
device = await BleakScanner.find_device_by_address(ble_address, timeout=20.0)
async with BleakClient(device) as client:
print(client.mtu_size)
if __name__ == "__main__":
asyncio.run(main(sys.argv[1] if len(sys.argv) == 2 else DEFAULT_MAC)) I´m using this Script to connect to a ble device and print out the MTU. On Linux I ´m getting the above mentioned warning. I was not able to call the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
If possible, you should use BleakGATTCharacteristic.max_write_without_response_size instead of To avoid the warning, call |
Beta Was this translation helpful? Give feedback.
-
is Apple macOS able to get MTU from |
Beta Was this translation helpful? Give feedback.
If possible, you should use BleakGATTCharacteristic.max_write_without_response_size instead of
BleakClient.mtu_size
.To avoid the warning, call
client._backend._mtu_size = EXPECTED_MTU
before readingclient.mtu_size
.