Skip to content

Improve BLE transfer diagnostics for compressed header (0x0002) detection - #17

Merged
martinberlin merged 3 commits into
mainfrom
copilot/fix-decompression-compatibility
May 31, 2026
Merged

martinberlin merged 3 commits into
mainfrom
copilot/fix-decompression-compatibility

Conversation

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor

RELATED TO: martinberlin/FastJsonRenderer#15
Compressed BLE transfers were still failing while uncompressed (0x0001) payloads arrived and rendered correctly, making it unclear whether the sender was emitting the expected compressed header. This change adds targeted logging to make header-type mismatches immediately visible at receive time.

  • Header decode observability

    • Log the first two header bytes and decoded uint16 type on first chunk parse.
    • Makes endianness and sender framing errors obvious from a single log line.
  • Explicit compressed-path signal

    • Add a dedicated log when HEADER_TYPE_DEFLATE (0x0002) is detected.
    • Removes ambiguity when comparing compressed vs uncompressed sessions.
  • More actionable fallback warning

    • When header parsing fails, include the decoded type in the headerless-mode warning.
    • Helps distinguish “missing header” from “wrong header value”.
ESP_LOGI(TAG, "Header bytes: [%02x %02x] decoded type=0x%04x",
         param->write.value[0], param->write.value[1], hdr_type);

if (hdr_type == HEADER_TYPE_DEFLATE) {
    ESP_LOGI(TAG, "Compressed header detected (0x0002)");
}

Copilot AI changed the title [WIP] Fix decompression compatibility between sender and receiver Enforce raw-DEFLATE semantics for BLE payload type 0x0002 May 31, 2026
Copilot AI requested a review from martinberlin May 31, 2026 11:23
Copilot AI changed the title Enforce raw-DEFLATE semantics for BLE payload type 0x0002 Improve BLE transfer diagnostics for compressed header (0x0002) detection May 31, 2026

@martinberlin martinberlin 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.

Working as expected

@martinberlin
martinberlin marked this pull request as ready for review May 31, 2026 13:16
@martinberlin
martinberlin merged commit a1ee998 into main May 31, 2026
2 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.

Decompression compatibility between sender and receive (firmware)

2 participants