Skip to content

Fix BLE characteristic property mapping for writeWithoutResponse - #473

Merged
gdoumen merged 3 commits into
mainfrom
feat/bkool-smartpro-trainer-support
Oct 11, 2026
Merged

gdoumen merged 3 commits into
mainfrom
feat/bkool-smartpro-trainer-support

Conversation

@gdoumen

@gdoumen gdoumen commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • mapProperties() in the BLE binding collapsed a discovered characteristic's WriteWithoutResponse GATT property into 'write', losing the distinction from an actual (response-expecting) 'write' property. Found while tracing the write path end to end while debugging Bkool trainer support (incyclist/devices).
  • Not the cause of that specific bug (write() in the same file branches on an explicit caller-supplied boolean and never consults .properties, and nothing else in this repo reads .properties either) - but it's objectively wrong now that 'writeWithoutResponse' is a real, distinct value in incyclist-devices' BleProperty type.

What changed

  • src/bindings/ble/characteristics.ts - mapProperties() now pushes 'writeWithoutResponse' instead of 'write' for that property

Test plan

  • One-line, low-risk change; no behavior depends on this today (confirmed via repo-wide search - nothing reads .properties to gate behavior)
  • No dedicated test exists for mapProperties() - worth adding if this file gets touched again

Found while tracing the Bkool trainer control-write path end to end:
this collapsed two genuinely different GATT properties into one string,
losing information about a real device's actual write capability. Not
the cause of the write-silently-dropped bug that prompted this (write()
in the same file branches on an explicit caller-supplied boolean, never
consults .properties, and nothing else in this repo reads .properties
either) - but it's objectively wrong now that 'writeWithoutResponse' is
a real, distinct value, so fixing it while here.
mapProperties()'s fix (previous commit) pushes 'writeWithoutResponse'
into a BleProperty[], but this repo keeps its own local copy of that
type (src/bindings/ble/types.ts) rather than importing it from
incyclist-devices - so widening the devices-repo type wasn't enough,
this one needed the same change. CI's type check caught it.
@sonarqubecloud

Copy link
Copy Markdown

@gdoumen
gdoumen marked this pull request as ready for review October 11, 2026 11:34
@gdoumen
gdoumen merged commit 524b358 into main Oct 11, 2026
3 checks passed
@gdoumen
gdoumen deleted the feat/bkool-smartpro-trainer-support branch October 11, 2026 11:35
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