DevelopersDocumentation

BleManager — Web Bluetooth transport (fallback)

Keon WiFi SDK → BleManager

BleManager drives the motor directly over Bluetooth LE, with no server involved. It is a fallback for local control when a server connection is not an option. Device setup (writing WiFi credentials) stays with the FeelConnect app and is out of scope for the SDK.

When to choose it

Requirements

The Web Bluetooth API only works:

Quick start

import { BleManager } from '@feelrobotics/keon-wifi-sdk';

// Must run from a user gesture (e.g. a click handler).
const ble = await BleManager.connect({
  onPosition: (p) => console.log('position', p.position),
});
try {
  await ble.moveTo(50, 90);
  await ble.movementBetween(60, 0, 100);
  console.log('battery', await ble.getBattery());
} finally {
  await ble.disconnect();
}

connect() opens the browser device-picker, connects over GATT, reads device information and subscribes to motor position notifications.

Supported devices

The device generation is resolved automatically by a pluggable driver, so consumer code never branches on the model:

Device Matched by
KEON WIFI Advertised Bluetooth name
KEON2 Advertised Bluetooth name
ONYX ULTRA Advertised Bluetooth name

requestDeviceOptions(), matchDriver(device) and the DRIVERS array are exported for advanced use.

API

BleManager.connect({ onPosition? }) returns a BleController, which adds to the common KeonController interface:

Member Description
getBattery() Battery level 0–100, or -1 when unavailable.
testDevice() Short movement to confirm the device responds.
onPosition(cb) Subscribe to motor position notifications.
deviceInfo { id, name, firmwareVersion, manufacturerName, serialNumber }.
driverName Name of the driver that matched the connected device.

Throws KeonBLEError on selection/connection failure or an unsupported device.


← WifiManager — Socket.IO · Next: React hook