Bluetooth Remote GATT Service class

Hierarchy

  • EventDispatcher<ServiceEvents>
    • BluetoothRemoteGATTServiceImpl

Implements

  • BluetoothRemoteGATTService

Constructors

Properties

device: BluetoothDeviceImpl = undefined

The device the service is related to

emitter: EventEmitter<DefaultEventMap> = ...
isPrimary: boolean = false

Whether the service is a primary one

uuid: string = undefined

The unique identifier of the service

Accessors

  • set oncharacteristicvaluechanged(fn): void
  • Parameters

    • fn: ((ev: Event) => void)
        • (ev): void
        • Parameters

          • ev: Event

          Returns void

    Returns void

  • set onserviceadded(fn): void
  • Parameters

    • fn: ((ev: Event) => void)
        • (ev): void
        • Parameters

          • ev: Event

          Returns void

    Returns void

  • set onservicechanged(fn): void
  • Parameters

    • fn: ((ev: Event) => void)
        • (ev): void
        • Parameters

          • ev: Event

          Returns void

    Returns void

  • set onserviceremoved(fn): void
  • Parameters

    • fn: ((ev: Event) => void)
        • (ev): void
        • Parameters

          • ev: Event

          Returns void

    Returns void

Methods

  • Type Parameters

    • K extends keyof ServiceEvents

    Parameters

    • type: K
    • listener: ((this: this, ev: ServiceEvents[K]) => void)
        • (this, ev): void
        • Parameters

          • this: this
          • ev: ServiceEvents[K]

          Returns void

    Returns void

  • Type Parameters

    • K extends keyof ServiceEvents

    Parameters

    • type: K
    • listener: EventListener

    Returns void

  • Parameters

    • event: Event

    Returns boolean

  • Gets a single characteristic contained in the service

    Parameters

    • characteristic: BluetoothCharacteristicUUID

      characteristic UUID

    Returns Promise<BluetoothRemoteGATTCharacteristic>

    Promise containing the characteristic

  • Gets a list of characteristics contained in the service

    Parameters

    • Optionalcharacteristic: BluetoothCharacteristicUUID

      characteristic UUID

    Returns Promise<BluetoothRemoteGATTCharacteristic[]>

    Promise containing an array of characteristics

  • Gets a single service included in the service

    Parameters

    • service: BluetoothServiceUUID

      service UUID

    Returns Promise<BluetoothRemoteGATTService>

    Promise containing the service

  • Gets a list of services included in the service

    Parameters

    • Optionalservice: BluetoothServiceUUID

      service UUID

    Returns Promise<BluetoothRemoteGATTService[]>

    Promise containing an array of services

  • Type Parameters

    • K extends keyof ServiceEvents

    Parameters

    • type: K
    • callback: ((this: this, ev: ServiceEvents[K]) => void)
        • (this, ev): void
        • Parameters

          • this: this
          • ev: ServiceEvents[K]

          Returns void

    Returns void

  • Type Parameters

    • K extends keyof ServiceEvents

    Parameters

    • type: K
    • callback: EventListener

    Returns void