forked from Blendman974/faceclaw
Another developer reports Samsung devices truncating inbound notifications larger than 64 bytes, and the missing-settings-reply issue indeed reproduces only on the Samsung tablet. Every frame the tablet DID deliver was <=55 bytes; a reply would only trip a 64-byte limit if it were bigger -- e.g. a fuller first-reply snapshot, or a reply coalesced into one notification value with one of the lens's own sid-0x80 notifies (11+55 = 66 bytes). The coalescing case also exposed a latent app-side bug: parseFrame only ever read the FIRST envelope in a notification value, so a second frame packed into the same value was silently dropped even on healthy devices. - BleProtocol.splitFrames(): split a notification value into its individual aa21/aa12 envelope frames (self-describing via the length byte), returning a trailing partial frame as-is so callers can log stack truncation. - Device-info probe, flash-prompt communicator, and flasher control channel now process every frame in a value. The probe additionally logs multi-frame values (with the raw value size) and marks frames whose actual length falls short of the declared length as TRUNCATED, so the next tablet run can confirm whether the stack truncates or drops oversized values. The existing first-request retries remain the workaround for replies the Samsung stack drops outright. Known residual exposure, not addressed here: the custom firmware's settings reply carries the capability string and is well over 64 bytes in a single frame, so on affected Samsung devices the main communicator would never see CFW capabilities; the durable fix is firmware-side (chunk lens-to-phone notifications at <=64 bytes), since an app cannot recover bytes the stack never delivers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ZqzwmRQ3HQxasBz5rYyZV