Updated types for noble advertisement data

This commit is contained in:
Rob Moran
2018-04-03 15:18:48 +01:00
parent 14cdba72e6
commit 64981bc0fa
2 changed files with 9 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
// Luke Libraro <https://github.com/lukel99>
// Dan Chao <https://github.com/bioball>
// Michal Lower <https://github.com/keton>
// Rob Moran <https://github.com/thegecko>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -63,7 +64,10 @@ export declare class Peripheral extends events.EventEmitter {
export interface Advertisement {
localName: string;
serviceData: Buffer;
serviceData: {
uuid: string,
data: Buffer
};
txPowerLevel: number;
manufacturerData: Buffer;
serviceUuids: string[];

View File

@@ -39,7 +39,10 @@ var peripheral: noble.Peripheral = new noble.Peripheral();
peripheral.uuid = "12ad4e81";
peripheral.advertisement = {
localName: "device",
serviceData: new Buffer(1),
serviceData: {
uuid: "180a",
data: new Buffer(1)
},
txPowerLevel: 1,
manufacturerData: new Buffer(1),
serviceUuids: ["0x180a", "0x180d"]