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

[Bug] Cannot access rotate functionality #278

Open
xenorio opened this issue Nov 4, 2024 · 0 comments
Open

[Bug] Cannot access rotate functionality #278

xenorio opened this issue Nov 4, 2024 · 0 comments
Labels

Comments

@xenorio
Copy link

xenorio commented Nov 4, 2024

Describe the bug
My JoyHub Pearlconch device supports rotation. This is reflected in its properties. However, calling device.rotate() errors out, telling me rotation is not supported. I am able to use rotation manually via IntiFace GUI. Vibration works fine.

Logging out device.rotateAttributes results in an empty array. The device object itself clearly shows the rotation function tho. Seems like the library is misinterpreting feature data, but that's just an educated guess.

Expected behavior
The device should rotate.

Additional context
Example Code (TypeScript):

import Buttplug from "buttplug";
import type { ButtplugClientDevice } from "buttplug";

const connector = new Buttplug.ButtplugBrowserWebsocketClientConnector(
    "ws://127.0.0.1:12345",
);
const client = new Buttplug.ButtplugClient("ButtplugControl");

client.addListener("deviceadded", async (device: ButtplugClientDevice) => {
    console.log(`+ ${device.name}`);

    await device.rotate(1);
    await new Promise((r) => setTimeout(r, 10000));
    await device.stop();
});

await client.connect(connector);
await client.startScanning();

Resulting Error:

error: Uncaught (in promise) Error: Device JoyHub Pearlconch has no Rotate capabilities

Device object, clearly showing rotate capability:

{
    "_events": {},
    "_eventsCount": 0,
    "_deviceInfo": {
      "DeviceIndex": 0,
      "DeviceName": "JoyHub Pearlconch",
      "DeviceMessages": {
        "ScalarCmd": [
          {
            "FeatureDescriptor": "",
            "ActuatorType": "Rotate",
            "StepCount": 255,
            "Index": 0
          },
          {
            "FeatureDescriptor": "",
            "ActuatorType": "Vibrate",
            "StepCount": 255,
            "Index": 1
          }
        ],
        "StopDeviceCmd": {}
      }
    },
    "allowedMsgs": {}
  }
@xenorio xenorio added the bug label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant