Gemini gate found a real defect that would have shipped: the Linux MTU stream
would have attached to nothing and reported an MTU for a device never.
`devicesChanged` fires only on deviceAdded / deviceRemoved. At the moment a
device is added BlueZ has not finished service discovery, so `gattServices` is
still empty; this plugin waits on `while (!device.servicesResolved)` elsewhere
for exactly that reason. The original patch built its per-characteristic
subscriptions inside that one event, found no characteristics, and had nothing
to re-trigger it when discovery later completed. Verified in the vendored
source, not taken on the reviewer's word.
Now nested: for each device, rebuild the characteristic subscriptions on every
`device.propertiesChanged`, which includes ServicesResolved flipping true. Same
shape the plugin's own `_initFlutterBluePlus` already uses for its logging, so
this is the file's existing idiom rather than a new one.
Also emits once per rebuild (`startWith(device)`), so an MTU already negotiated
before we were listening is reported rather than waiting on a change that may
never arrive. Safe when unknown: 0 is filtered downstream.
Two other findings reviewed and accepted as clean, recorded so they are not
re-litigated: "max across characteristics" is right because the ATT MTU is
per-connection, not per-characteristic; and the web exemption is sound because
the browser owns fragmentation and 172 is far inside the spec's 512-byte
writeValue limit.
analyze clean, format clean, 981 tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This package is endorsed, which means you can simply use flutter_blue_plus
normally. This package will be automatically included in your app when you do,
so you do not need to add it to your pubspec.yaml.
However, if you import this package to use any of its APIs directly, you
should add it to your pubspec.yaml as usual.