Skip to content

BLE: subscribe reason named correctly; no wrap in manufacturer data - #10

Merged
robdobsn merged 2 commits into
mainfrom
fix/ble-subscribe-log-and-mfg-data
Oct 25, 2026
Merged

robdobsn merged 2 commits into
mainfrom
fix/ble-subscribe-log-and-mfg-data

Conversation

@robdobsn

@robdobsn robdobsn commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two small BLE fixes.

  1. Subscribe event reason. It was formatted with getHSErrorMsg(), as if it were a host error code. So a CCCD write was logged as TryAgain, and the end of a connection as AlreadyInProgress. getSubscribeReasonName() now gives write, term or restore. The DEBUG_RESP_SUBSCRIPTION log line also includes the CCCD details (previous and current notify/indicate), which is what you need when investigating subscriptions.
  2. Manufacturer data. The space left for the serial number was advManufValueBytes minus the bytes already present, an unsigned subtraction. It wrapped when the company ID and advManufData already 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 advManufValueBytes limits, and that 0x004c is Apple's company ID.

Testing

  • Built for the Axiom (with RaftCore PRs #28 and #29), and run: BLE uploads and downloads work as before.
  • The subscribe reason is only seen with DEBUG_RESP_SUBSCRIPTION defined, so it wasn't exercised in this build. The mislabelling was seen in the 2026-10-25 BLE held-link investigation (RaftCore devdocs/ble-held-links-windows.md).

🤖 Generated with Claude Code

robdobsn and others added 2 commits October 25, 2026 15:57
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>
@robdobsn
robdobsn merged commit 4e43126 into main Oct 25, 2026
1 check passed
@robdobsn
robdobsn deleted the fix/ble-subscribe-log-and-mfg-data branch October 25, 2026 16:08
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