The device manager is responsible for tracking devices that appear on the prolink network, providing an API to react to devices livecycle events as they connect and disconnect form the network.

Hierarchy

  • DeviceManager

Constructors

Properties

#config: Required<Config>

Device manager configuration

#deviceTimeouts: Map<number, Timeout> = ...

Tracks device timeout handlers, as devices announce themselves these timeouts will be updated.

#devices: Map<number, Device> = ...

The map of all active devices currently available on the network.

#emitter: Emitter = ...

The EventEmitter which will be used to trigger device lifecycle events

off: ((eventName: string | symbol, listener: ((...args: any[]) => void)) => EventEmitter) = ...

Type declaration

    • (eventName: string | symbol, listener: ((...args: any[]) => void)): EventEmitter
    • Alias for emitter.removeListener().

      Since

      v10.0.0

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns EventEmitter

on: {
    <P, T>(this: T, event: P, listener: ((...args: ListenerType<DeviceEvents[P]>) => void)): T;
    (event: typeof assignmentCompatibilityHack, listener: ((...args: any[]) => any)): void;
} = ...

Type declaration

once: {
    <P, T>(this: T, event: P, listener: ((...args: ListenerType<DeviceEvents[P]>) => void)): T;
    (event: typeof assignmentCompatibilityHack, listener: ((...args: any[]) => any)): void;
} = ...

Type declaration

Accessors

  • get devices(): Map<number, Device>
  • Get active devices on the network.

    Returns Map<number, Device>

Methods

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Waits for a specific device ID to appear on the network, with a configurable timeout, in which case it will resolve with null.

    Parameters

    • id: number
    • timeout: number = ENSURED_TIMEOUT

    Returns Promise<null | Device>

Generated using TypeDoc