Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to call start() on socket:bluetooth Bluetooth constructor gives "Error: failed to start service" #975

Open
doot0 opened this issue Apr 25, 2024 · 0 comments

Comments

@doot0
Copy link

doot0 commented Apr 25, 2024

What OS are you using (uname -a, or Windows version)?

Darwin ip-10-35-28-143.eu-west-2.compute.internal 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64

What version Socket Runtime are you using?

zsh: command not found: ssc
"@socketsupply/socket": "^0.5.4" is in my package.json, though

What programming language are you using (C/C++/Go/Rust)?

gcc --version and clang --version have the same output as below. go and rustc not installed.

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

What did you expect to see and what you saw instead?

I created a new vue project using create-socket-app, have the following (reduced test case) code:

<script setup>
[...]
import { Bluetooth } from "socket:bluetooth";
[...]
const ble = new Bluetooth(<36-char-uuid>); 
const startBluetooth = async () => {
  try {
    await ble.start();
  } catch (e) {
    console.error(e);
  }
};
</script>
<template>
  <button @click="startBluetooth()">Toggle Bluetooth</button>
</template>

When I click the button with the startBluetooth method bound to it, I receive this error:

Error: Failed to start service
    at maybeMakeError (socket:ipc:345:20)
    at from (socket:ipc:892:31)
    at onresolve (socket:ipc:1183:33)
    at dispatchEvent [native code]
    at global code {
  serviceId: '<36-char-uuid>'
}

I expected this action to work, but it does not. This action fails regardless of whether or not Bluetooth is currently turned on on the device.

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

No branches or pull requests

1 participant