Reedyuk / blue-falcon

A Bluetooth kotlin multiplatform "Cross-Platform" library for iOS and Android
https://bluefalcon.dev
Apache License 2.0
340 stars 45 forks source link

changeMTU() method does not work as expected #63

Open davidlepilote opened 3 years ago

davidlepilote commented 3 years ago

When requesting a change of the MTU, the peripheral returned by the callback does not contain services and characteristics. Yet, if you keep a reference of previous characteristics, one cannot write or read on it anymore.

The problem seems to lie in the fact that the MTU change request should appear between the connection and the discovery of services. Yet BlueFalcon abstracts this layer by calling directly the discovery of services as soon as the peripheral is connected.

It could be interesting to add an MTU request within the connect method for instance.

Reedyuk commented 3 years ago

Hi @davidlepilote - do you want to put a PR in for it and try it?

davidlepilote commented 3 years ago

I could try yes