const bleno = require('bleno') const config = require('./config.json') class TimeCharacteristic extends bleno.Characteristic { constructor() { super({ uuid: config.uuid.service.func.time, properties: ['read'], descriptors: [ new bleno.Descriptor({ uuid: '88ff', value: 'Now Time' }) ] }) } onReadRequest(offset, callback) { console.log(`offset :: ${offset}`) callback(this.RESULT_SUCCESS, new Buffer(`${Date.now()}`)) } } module.exports = TimeCharacteristic