diff --git a/index.d.ts b/index.d.ts index b879be2..0ec7441 100644 --- a/index.d.ts +++ b/index.d.ts @@ -60,6 +60,10 @@ declare module '@stoprocent/bleno' { toString(): string; + getMaxValueSize(handle: ConnectionHandle): number | undefined; + getUpdateValueCallback(handle: ConnectionHandle): UpdateValueCallback | undefined; + notify(data: Buffer, handle?: ConnectionHandle | null): void; + readonly RESULT_ATTR_NOT_LONG: number; readonly RESULT_INVALID_ATTRIBUTE_LENGTH: number; readonly RESULT_INVALID_OFFSET: number; @@ -203,4 +207,4 @@ declare module '@stoprocent/bleno' { // Define a default export const BlenoDefault: Bleno; export default BlenoDefault; -} \ No newline at end of file +} diff --git a/lib/characteristic.js b/lib/characteristic.js index 83bfd8d..fc17bfc 100644 --- a/lib/characteristic.js +++ b/lib/characteristic.js @@ -64,6 +64,10 @@ class Characteristic extends EventEmitter { return this._maxValueSizes.get(connection); } + getUpdateValueCallback (connection) { + return this._updateValueCallbacks.get(connection); + } + onReadRequest (connection, offset, callback) { callback(this.RESULT_UNLIKELY_ERROR, null); }