Skip to content

Conversation

@Benjith
Copy link

@Benjith Benjith commented Jun 11, 2025

This update enhances the ConnectedThread in the flutter_bluetooth_classic plugin by:

Replacing the small 1024-byte buffer with a larger ByteArray buffer to accommodate bigger payloads.

Using copyOfRange() to safely extract only the received bytes before sending them to Dart.

Adding clear debug logs for received byte count and UTF-8 string representation. (see the commented lines)

Removing the messageBuffer logic, which was unsuitable for binary or large payloads.

This fix resolved issues where fragmented or heavy data (like sensor streams or long messages) were not reliably processed on Android. The previous buffer and message-building logic lost data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant