npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

kiiroo-ctrl-react-native

v1.0.1

Published

Kiiroo Control SDK

Readme

Kiiroo Control Bluetooth Service for React Native

Overview

This class allows you to interact with Kiiroo Control devices via Bluetooth using the React Native BLE Manager. It provides methods for connecting, disconnecting, flashing firmware, reading sensor data, and retrieving device information.

Features

  • Connect and disconnect from Kiiroo Control devices
  • Read sensor data from x, y, and z axes
  • Retrieve device information such as battery level, firmware version, and hardware version
  • Flash firmware to the device
  • Support for subscribing and unsubscribing to sensor events
  • Compatible with both iOS and Android, with platform-specific handling of MTU size and OTA updates

Installation

This module can be installed using any package manager, such as npm or yarn:

npm install react-native-ble-manager

Or

yarn add kiiroo-control-react-native

Usage

Connecting to the Device

To connect to a Kiiroo Control device, use the connect() method after discovering the device.

import { KiirooControl } from './KiirooControl';

// Create an instance of KiirooControl
const kiirooControl = new KiirooControl();

// Connect to the device
const device = { id: 'device_id' }; // Replace with your Bluetooth device ID
await kiirooControl.connect(device);

Disconnecting from the Device

Ensure to properly disconnect from the device when you're done using it.

await kiirooControl.disconnect();

Reading Sensor Data

To receive real-time sensor data from the x, y, and z axes, the class sets up notifications from the device's characteristics.

kiirooControl.sensor.on('data', (acceleration) => {
  console.log('Acceleration:', acceleration);
});

Retrieving Device Information

You can easily retrieve the battery level, firmware version, and other details from the connected device:

const batteryLevel = await kiirooControl.getBattery();
console.log('Battery Level:', batteryLevel);

const firmwareVersion = await kiirooControl.getFirmwareVersion();
console.log('Firmware Version:', firmwareVersion.version);

Flashing Firmware

The flashFirmware method allows you to update the device firmware. You can also track progress via a callback.

const firmwareData = new ArrayBuffer(); // Load your firmware data here
await kiirooControl.flashFirmware(firmwareData, (progress) => {
  console.log(`Firmware update progress: ${progress}%`);
});

Methods

connect()

Connects to the Bluetooth device and sets up sensor data subscriptions.

  • Returns: Promise<void>

disconnect()

Disconnects from the device and stops all active notifications.

  • Returns: Promise<void>

getFirmwareVersion()

Retrieves the firmware version from the connected device.

  • Returns: Promise<{ code: string, version: string }>

getBattery()

Retrieves the battery level of the connected device.

  • Returns: Promise<number>

flashFirmware(firmware: ArrayBuffer, onProgress?: (percent: number) => void)

Flashes a new firmware to the device.

  • Parameters:
    • firmware: The firmware data to be flashed
    • onProgress: Optional callback to track the progress of the update
  • Returns: Promise<void>

testDevice()

Triggers a test on the device (e.g., blinking LEDs).

  • Returns: Promise<void>

isConnected()

Checks if the device is currently connected.

  • Returns: Promise<boolean>

keepAlive()

Ensures that the connection to the device is still active by reading a characteristic.

  • Returns: Promise<void>

Platform-Specific Considerations

MTU Size

  • iOS: Default MTU size is 185 bytes, no need to request a change.
  • Android: The MTU size can be increased up to 512 bytes (if supported), but defaults to 23 bytes. You can request an increase based on the Android version.

License

This project is licensed under the MIT License.


This class provides a robust interface to Kiiroo Control devices for React Native applications, simplifying Bluetooth communication and device management.