obniz Parts Library

iBS01

GitHub
iBS01
Usable Devices :
obniz_board
m5stickc
obnizble
esp32
esp32gateway
m5stackbasic
ak-030
obnizble_lte
obniz_plc

iBS01

beacon by INGICS.

Support device

  • iBS01

getPartsClass(name)

// Javascript Example
const IBS01 = Obniz.getPartsClass('iBS01');

isDevice(BleRemotePeripheral)

Returns true if a device was found.

// Javascript Example
let IBS01 = Obniz.getPartsClass('iBS01');
await obniz.ble.initWait();
obniz.ble.scan.onfind = (p) => {
    if (IBS01.isDevice(p)) {
        let data = IBS01.getData(p);
        console.log(data);
    }
};
await obniz.ble.scan.startWait(null, { duplicate: true, duration: null });

getData(BleRemotePeripheral)

Returns device information if found. Returns Null if not found.

  • battery : Battery voltage
  • button : True when button is pressed
// Javascript Example
let IBS01 = Obniz.getPartsClass('iBS01');
await obniz.ble.initWait();
obniz.ble.scan.onfind = (p) => {
    if (IBS01.isDevice(p)) {
        let data = IBS01.getData(p);
        console.log(data);
    }
};
await obniz.ble.scan.startWait(null, { duplicate: true, duration: null });

Supported from: obniz.js 3.5.0