Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Device

Hierarchy

  • Device

Implements

Index

Constructors

constructor

  • new Device(id: string, address: string, peripheral: Peripheral): Device

Properties

Private _connected

_connected: boolean

Private _listeners

_listeners: Array<function>

Private _peripheral

_peripheral: Peripheral

Private _read

_read: Characteristic

Private _write

_write: Characteristic

address

address: string

id

id: string

Methods

connect

  • connect(read?: undefined | string, write?: undefined | string): Promise<IDevice>

disconnect

Private enableDataListener

  • enableDataListener(): void

Private initCharacteristics

  • initCharacteristics(read?: undefined | string, write?: undefined | string): Promise<void>
  • Parameters

    • Optional read: undefined | string
    • Optional write: undefined | string

    Returns Promise<void>

read

  • read(listener: function): void
  • Parameters

    • listener: function
        • (data: Buffer): any
        • Parameters

          • data: Buffer

          Returns any

    Returns void

Private removeRead

  • removeRead(): void

Private removeWrite

  • removeWrite(): void

write

  • write(data: Buffer): Promise<void>

Generated using TypeDoc