Skip to content

Handle RESP_CODE_ERR frames explicitly in connector#182

Merged
zjs81 merged 4 commits into
zjs81:mainfrom
Specter242:feature/protocol-compat
Feb 18, 2026
Merged

Handle RESP_CODE_ERR frames explicitly in connector#182
zjs81 merged 4 commits into
zjs81:mainfrom
Specter242:feature/protocol-compat

Conversation

@Specter242

@Specter242 Specter242 commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Problem

RESP_CODE_ERR (protocol response code 1) was falling through to the generic "unknown frame" path in the connector, which loses structured firmware error detail.

Solution

  • Add an explicit respCodeErr branch in _processFrame
  • Parse optional secondary error byte when present
  • Log firmware error responses via _appDebugLogService?.warn(..., tag: 'Protocol')

Scope

This PR is intentionally limited to connector error-frame handling in:

  • lib/connector/meshcore_connector.dart

Not included in this PR:

  • protocol/version capability getters
  • scope messaging UI
  • charging indicator
  • dependency/package updates

Validation

  • flutter analyze passes
  • flutter test passes

Port from meshcore-open: parse protocol version from byte 1 of device
info frame, expose supportsFloodScope getter (version >= 8), handle
respCodeErr frames with debug logging. Reset on disconnect.

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit a29bb9c)
Comment thread lib/connector/meshcore_connector.dart Outdated
Comment thread lib/connector/meshcore_connector.dart Outdated
@446564 446564 added Invalid This doesn't seem right More Info Needed Further information is requested, the issue is a question or further investigation is required. labels Feb 18, 2026
Comment thread lib/connector/meshcore_connector.dart Outdated
Comment thread lib/connector/meshcore_connector.dart Outdated
Comment thread lib/connector/meshcore_connector.dart
@Specter242 Specter242 changed the title Add protocol version tracking and firmware error-frame handling Handle RESP_CODE_ERR frames explicitly in connector Feb 18, 2026
@Specter242

Copy link
Copy Markdown
Contributor Author

Follow-up update based on review:

I narrowed this PR to one incremental change only: explicit RESP_CODE_ERR handling in MeshCoreConnector with protocol-tagged logging.

Removed from this PR:

  • deviceProtocolVersion getter
  • supportsFloodScope getter
  • any protocol-version aliasing/placeholder fields

Current diff vs main is limited to lib/connector/meshcore_connector.dart and focused on error-frame routing/logging.

Validation rerun after narrowing:

  • flutter analyze passes
  • flutter test passes

@Specter242 Specter242 requested a review from 446564 February 18, 2026 17:52

@446564 446564 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean. In future for changes that do not have an existing issue, can you please open one to discuss what may be needed?

@446564 446564 removed Invalid This doesn't seem right More Info Needed Further information is requested, the issue is a question or further investigation is required. labels Feb 18, 2026
@446564 446564 requested a review from zjs81 February 18, 2026 17:59

@zjs81 zjs81 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zjs81 zjs81 merged commit 9437846 into zjs81:main Feb 18, 2026
6 checks passed
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.

3 participants