ukBaz / python-bluezero

A simple Python interface to Bluez
MIT License
387 stars 112 forks source link

Adds support for setting characteristic MTU #347

Closed p30arena closed 2 years ago

p30arena commented 2 years ago

fix #346

ukBaz commented 2 years ago

Glad you found the right place to insert this into Bluezero to get your project using a different MTU. And thanks for the PR.

bluezero has a primary goal of offering users a more gentle learning curve to using Bluetooth functionality on Linux. Setting the MTU is pretty low-level and requires a knowledge of Bluetooth that most shouldn't need to know to create a simple peripheral. My initial thought is it should be an optional parameter when people add a characteristic.

It would also be easier to accept this PR if the Characteristic.__init__ and def add_characteristic signatures were not breaking changes for existing code.

p30arena commented 2 years ago

@ukBaz unfortunately having iOS connecting to the peripheral, needs a bit more low level access.

so I made the MTU optional.

p30arena commented 2 years ago

I checked and saw that MTU is 182 so BlueZ does that automatically on a Bluetooth v5

p30arena commented 2 years ago

so this PR might be not needed