INNER CODE UNIT · TypeScript

BleManager

innoveit/react-native-ble-manager · src/index.ts:37

class BleManager {
  constructor() {
    if (!BleManagerModule) {
      throw new Error('BleManagerModule not found');
    }
    this.isPeripheralConnected = this.isPeripheralConnected.bind(this);
  }

  /**
   * Read the current value of the specified characteristic, you need to call `retrieveServices` method before.
   * 
   * @param peripheralId The id/mac address of the peripheral.
   * @param serviceUUID The UUID of the service.
   * @param characteristicUUID The UUID of the characteristic.
   * @returns Data as an array of numbers (which can be converted back to a Uint8Array (ByteArray) using something like [Buffer.from()](https://github.com/feross/buffer))
   */
  read(peripheralId: string, serviceUUID: string, characteristicUUID: string) {
    return new Promise<number[]>((fulfill, reject) => {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…