Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

peripheral

peripheral: BlePeripheral

Peripheral instance.

This is same as obniz.ble.peripheral

uuid

uuid: UUID

It is uuid as string.

console.log(attr.uuid); // => '4C84'

Accessors

advData

  • get advData(): { flags: string[]; serviceUuids: string[] }
  • advertisment object for BleAdvertisement.setAdvData

    // Javascript Example
    await obniz.ble.initWait();
    var service = new obniz.ble.service({ uuid : "1234" });
    var characteristic = new obniz.ble.characteristic({ uuid : "7777", data: [1, 2, 3]});
    service.addCharacteristic(characteristic);
    obniz.ble.peripheral.addService(service);
    
    obniz.ble.advertisement.setAdvData(service.advData);
    obniz.ble.advertisement.setScanRespData({
       localName : "obniz BLE",
    });
    obniz.ble.advertisement.start();

    Returns { flags: string[]; serviceUuids: string[] }

    • flags: string[]
    • serviceUuids: string[]

characteristics

  • Returns BleCharacteristic[]

Methods

addCharacteristic

end

  • end(): void
  • Terminate created service

    // Javascript Example
    await obniz.ble.initWait();
    var service = new obniz.ble.service({ uuid : "1234" });
    var characteristic = new obniz.ble.characteristic({ uuid : "7777", data: [1, 2, 3]});
    service.addCharacteristic(characteristic);
    obniz.ble.peripheral.addService(service);
    
    service.end();

    Returns void

getCharacteristic

  • Get Characteristic

    Parameters

    Returns BleCharacteristic | null

Generated using TypeDoc