Skip to content

Conversation

@wabicai
Copy link

@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>
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