Skip to content

fix(windows): emit error callback when GetCharacteristic/GetDescripto…#60

Merged
stoprocent merged 1 commit into
stoprocent:mainfrom
wabicai:fix/windows-ble-callback-on-characteristic-error
Jan 15, 2026
Merged

fix(windows): emit error callback when GetCharacteristic/GetDescripto…#60
stoprocent merged 1 commit into
stoprocent:mainfrom
wabicai:fix/windows-ble-callback-on-characteristic-error

Conversation

@wabicai
Copy link
Copy Markdown

@wabicai wabicai commented Jan 12, 2026

…r fails

When GetCharacteristic or GetDescriptor fails (e.g., user cancels Windows BLE pairing dialog), the code was only logging the error but not calling the emit callback to notify JavaScript. This caused the Promise/callback to hang indefinitely.

Fixed functions:

  • Read: now calls mEmit.Read() on GetCharacteristic failure
  • Write: now calls mEmit.Write() on GetCharacteristic failure
  • Notify: now calls mEmit.Notify() on GetCharacteristic failure
  • DiscoverDescriptors: now calls mEmit.DescriptorsDiscovered() on failure
  • ReadValue: now calls mEmit.ReadValue() on GetDescriptor failure
  • WriteValue: now calls mEmit.WriteValue() on GetDescriptor failure

This ensures JavaScript always receives a callback (success or error), preventing hangs when BLE operations fail due to pairing issues.

…r fails

When GetCharacteristic or GetDescriptor fails (e.g., user cancels Windows
BLE pairing dialog), the code was only logging the error but not calling
the emit callback to notify JavaScript. This caused the Promise/callback
to hang indefinitely.

Fixed functions:
- Read: now calls mEmit.Read() on GetCharacteristic failure
- Write: now calls mEmit.Write() on GetCharacteristic failure
- Notify: now calls mEmit.Notify() on GetCharacteristic failure
- DiscoverDescriptors: now calls mEmit.DescriptorsDiscovered() on failure
- ReadValue: now calls mEmit.ReadValue() on GetDescriptor failure
- WriteValue: now calls mEmit.WriteValue() on GetDescriptor failure

This ensures JavaScript always receives a callback (success or error),
preventing hangs when BLE operations fail due to pairing issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@stoprocent stoprocent merged commit 37fcef4 into stoprocent:main Jan 15, 2026
15 checks passed
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.

2 participants