Repository navigation
BLE: subscribe reason named correctly; no wrap in manufacturer data - #10
Merged
Merged
Conversation
The subscribe event's reason was formatted with getHSErrorMsg(), as if it were a host error code, so a CCCD write was logged as "TryAgain" and the end of the connection as "AlreadyInProgress". getSubscribeReasonName() gives "write", "term" or "restore". The DEBUG_RESP_SUBSCRIPTION log line now includes the CCCD details too (previous and current notify/indicate). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The space left for the serial number was advManufValueBytes minus the bytes already in the manufacturer data, an unsigned subtraction that wrapped when the ID and advManufData already filled the limit, so the whole serial number was added and then truncated away. The result was the same, but it now clamps to zero instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small BLE fixes.
getHSErrorMsg(), as if it were a host error code. So a CCCD write was logged asTryAgain, and the end of a connection asAlreadyInProgress.getSubscribeReasonName()now giveswrite,termorrestore. TheDEBUG_RESP_SUBSCRIPTIONlog line also includes the CCCD details (previous and current notify/indicate), which is what you need when investigating subscriptions.advManufValueBytesminus the bytes already present, an unsigned subtraction. It wrapped when the company ID andadvManufDataalready filled the limit; the final truncation hid it, so the output was right. It now clamps to zero instead.The BLE settings page on the wiki now describes the manufacturer data settings as the code implements them: defaults, what
advManufValueByteslimits, and that0x004cis Apple's company ID.Testing
DEBUG_RESP_SUBSCRIPTIONdefined, so it wasn't exercised in this build. The mislabelling was seen in the 2026-10-25 BLE held-link investigation (RaftCoredevdocs/ble-held-links-windows.md).🤖 Generated with Claude Code