Class Peripheral

Hierarchy

Index

Properties

Methods

Properties

public advertisement: Advertisement

public rssi: number

public services: Array<string>

public uuid: string

Methods

public addListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public connect(callback?: (error: string) => void)

Parameters

  • callback?: (error: string) => void optional

public disconnect(callback?: () => void)

Parameters

  • callback?: () => void optional

public discoverAllServicesAndCharacteristics(callback?: (error: string, services: "noble".Service[], characteristics: "noble".Characteristic[]) => void)

Parameters

  • callback?: (error: string, services: "noble".Service[], characteristics: "noble".Characteristic[]) => void optional

public discoverServices(serviceUUIDs: Array<string>, callback?: (error: string, services: "noble".Service[]) => void)

Parameters

  • serviceUUIDs: Array<string>
  • callback?: (error: string, services: "noble".Service[]) => void optional

public discoverSomeServicesAndCharacteristics(serviceUUIDs: Array<string>, characteristicUUIDs: Array<string>, callback?: (error: string, services: "noble".Service[], characteristics: "noble".Characteristic[]) => void)

Parameters

  • serviceUUIDs: Array<string>
  • characteristicUUIDs: Array<string>
  • callback?: (error: string, services: "noble".Service[], characteristics: "noble".Characteristic[]) => void optional

public emit(event: string, args?: Array<any>): boolean

Parameters

  • event: string
  • args?: Array<any> optional

Returns

boolean

public listeners(event: string): Array<Function>

Parameters

  • event: string

Returns

Array<Function>

public on(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public on(event: ""connect"", listener: (error: string) => void): EventEmitter

Parameters

  • event: ""connect""
  • listener: (error: string) => void

Returns

EventEmitter

public on(event: ""disconnect"", listener: (error: string) => void): EventEmitter

Parameters

  • event: ""disconnect""
  • listener: (error: string) => void

Returns

EventEmitter

public on(event: ""rssiUpdate"", listener: (rssi: number) => void): EventEmitter

Parameters

  • event: ""rssiUpdate""
  • listener: (rssi: number) => void

Returns

EventEmitter

public on(event: ""servicesDiscover"", listener: (services: "noble".Service[]) => void): EventEmitter

Parameters

  • event: ""servicesDiscover""
  • listener: (services: "noble".Service[]) => void

Returns

EventEmitter

public once(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public readHandle(handle: NodeBuffer, callback: (error: string, data: NodeBuffer) => void)

Parameters

  • handle: NodeBuffer
  • callback: (error: string, data: NodeBuffer) => void

public removeAllListeners(event?: string): EventEmitter

Parameters

  • event?: string optional

Returns

EventEmitter

public removeListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public setMaxListeners(n: number)

Parameters

  • n: number

public toString(): string

Returns

string

public updateRssi(callback?: (error: string, rssi: number) => void)

Parameters

  • callback?: (error: string, rssi: number) => void optional

public writeHandle(handle: NodeBuffer, data: NodeBuffer, withoutResponse: boolean, callback: (error: string) => void)

Parameters