node-ble
Version:
Bluetooth Low Energy (BLE) library written with pure Node.js (no bindings) - baked by Bluez via DBus
29 lines (21 loc) • 625 B
JavaScript
const {Variant, interface: {Interface, property, method, ACCESS_READWRITE}} = require('dbus-next');
class TestInterface extends Interface {
SimpleProperty = 'bar';
_VirtualProperty = 'foo'
get VirtualProperty() {
return this._VirtualProperty;
}
set VirtualProperty(value) {
this._VirtualProperty = value;
Interface.emitPropertiesChanged(this, {
VirtualProperty: value
})
}
Echo(what) {
return `>>${what}`;
}
}
module.exports = TestInterface