Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BleRemoteValueAttributeAbstract<ParentClass, ChildrenClass>

Type parameters

  • ParentClass

  • ChildrenClass

Hierarchy

Index

Constructors

constructor

Properties

Optional onread

onread: undefined | ((data: any) => void)

Callback function when read value.

Optional onwrite

onwrite: undefined | ((result: any) => void)

Callback function when write value finished.

uuid

uuid: UUID

It is uuid as string.

console.log(attr.uuid); // => '4C84'

Methods

readNumberWait

  • readNumberWait(): Promise<number | null>
  • Wrapper for writeWait with data converting from number. It writes data as 1byte.

    It throws an error when failed.

    Returns Promise<number | null>

    val

readTextWait

  • readTextWait(): Promise<string | null>
  • Wrapper for readWait with data converting to text. It convert UTF-8 and write binary array to string.

    It throws an error when failed.

    Returns Promise<string | null>

writeNumberWait

  • writeNumberWait(val: number, needResponse?: undefined | false | true): Promise<boolean>
  • Wrapper for writeWait with data converting from number. It writes data as 1byte.

    It throws an error when failed.

    Parameters

    • val: number
    • Optional needResponse: undefined | false | true

    Returns Promise<boolean>

writeTextWait

  • writeTextWait(str: string, needResponse?: undefined | false | true): Promise<boolean>
  • Wrapper for writeWait with data converting from text. It convert string to UTF-8 and write binary array.

    It throws an error when failed.

    Parameters

    • str: string
    • Optional needResponse: undefined | false | true

    Returns Promise<boolean>

Generated using TypeDoc