Skip to content

Fix print timeout for P15 single-byte success response#8

Merged
tomLadder merged 1 commit intomainfrom
fix/single-byte-print-response
Apr 6, 2026
Merged

Fix print timeout for P15 single-byte success response#8
tomLadder merged 1 commit intomainfrom
fix/single-byte-print-response

Conversation

@tomLadder
Copy link
Copy Markdown
Owner

Summary

  • Fix parseResponse() dropping single-byte BLE success responses (0xAA, 0x4F, 0x4B) due to a data.length < 2 guard — the Android app only requires length >= 1
  • Handle unexpected BLE disconnect in waitForPrintResult() as implicit success (printer powered off after processing), avoiding a 30s timeout
  • Add optional onDisconnect callback to BleConnection interface for link-loss detection

The L11 protocol parseResponse() required data.length >= 2, silently
discarding single-byte printer success confirmations (0xAA). The
original Android app only requires length >= 1. This caused
waitForPrintResult() to never resolve, leading to a 30s timeout.

- Move success byte check before the length < 2 guard in parseResponse
- Handle unexpected BLE disconnect as implicit print success
- Add optional onDisconnect to BleConnection interface
- Clean up dead ternary in buildPrintSequence
@tomLadder tomLadder merged commit 4d12dce into main Apr 6, 2026
2 checks passed
@tomLadder tomLadder deleted the fix/single-byte-print-response branch April 6, 2026 13:14
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