FFBeast Wheel WebHID API
    Preparing search index...

    Class WheelApi

    WebHID-based API for communicating with the wheel controller.

    import { WheelApi } from "@shubham0x13/ffbeast-wheel-webhid-api";

    const wheel = new WheelApi();

    wheel.on("stateReceived", (state) => {
    console.log("Position:", state.position);
    });

    await wheel.connect();

    // ... later

    await wheel.disconnect();
    wheel.destroy();

    Hierarchy

    Index

    Constructors

    Properties

    prefixed: string | boolean

    Accessors

    • get firmwareReleaseType(): number | null

      Current firmware release type.

      Returns number | null

      Release type number, or null if not connected.

    • get firmwareVersion(): string | null

      Current firmware version string.

      Returns string | null

      Version string (e.g., "1.2.3"), or null if not connected.

    • get isConnected(): boolean

      Device connection status.

      Returns boolean

      true if connected and opened.

    • get positionDegrees(): number | null

      Current wheel position in degrees.

      Returns number | null

      Position in degrees, or null if not connected.

    • get torqueNormalized(): number | null

      Current torque normalized to [-100, 100] range.

      Returns number | null

      Normalized torque, or null if not connected.

    Methods

    • Type Parameters

      Parameters

      Returns this

    • Opens the browser's device picker to connect to a wheel.

      Returns Promise<boolean>

      true if connection was successful.

    • Cleans up all resources and event listeners. Must be called when the API instance is no longer needed.

      Returns Promise<void>

    • Disconnects from the current device.

      Returns Promise<void>

    • Calls each of the listeners registered for a given event.

      Type Parameters

      Parameters

      Returns boolean

    • Return an array listing the events for which the emitter has registered listeners.

      Returns (keyof WheelEvents)[]

    • Return the number of listeners listening to a given event.

      Parameters

      Returns number

    • Return the listeners registered for a given event.

      Type Parameters

      Parameters

      • event: T

      Returns ((...args: ArgumentMap<WheelEvents>[Extract<T, keyof WheelEvents>]) => void)[]

    • Type Parameters

      Parameters

      • event: T
      • Optionalfn: (...args: ArgumentMap<WheelEvents>[Extract<T, keyof WheelEvents>]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Add a listener for a given event.

      Type Parameters

      Parameters

      Returns this

    • Add a one-time listener for a given event.

      Type Parameters

      Parameters

      Returns this

    • Reboots the controller without saving settings.

      Returns Promise<void>

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: keyof WheelEvents

      Returns this

    • Remove the listeners of a given event.

      Type Parameters

      Parameters

      • event: T
      • Optionalfn: (...args: ArgumentMap<WheelEvents>[Extract<T, keyof WheelEvents>]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Sets the current wheel position as center.

      Returns Promise<void>

    • Saves current settings to flash and reboots the controller.

      Returns Promise<void>

    • Sends the firmware activation license key to the device. Expected format: "XXXXXXXX-XXXXXXXX-XXXXXXXX" (Hex strings)

      Parameters

      • license: string

        The license key string.

      Returns Promise<boolean>

      true if the format was valid and sent, false otherwise.

    • Writes a single setting value to the device.

      Parameters

      • field: SettingField

        The setting field to write.

      • index: number

        Sub-index for array-based settings.

      • value: number

        The value to write.

      Returns Promise<void>

    • Switches the device to DFU mode for firmware updates.

      Returns Promise<void>

    • Attempts to reconnect to a previously authorized device.

      Returns Promise<boolean>

      true if a device was found and connected.

    • Checks if WebHID is supported in the current browser.

      Returns boolean

      true if supported (Chrome/Edge/Opera).