Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

UUIDS

UUIDS: { CHARACTERISTICS: { INDICATE: "72c90005-57a9-4d40-b746-534e22ec9f9e"; NOTIFY: "72c90003-57a9-4d40-b746-534e22ec9f9e"; WRITE: "72c90004-57a9-4d40-b746-534e22ec9f9e"; WRITE_WO_RESPONSE: "72c90002-57a9-4d40-b746-534e22ec9f9e" }; SERVICE_ID: "72c90001-57a9-4d40-b746-534e22ec9f9e" } = {SERVICE_ID: '72c90001-57a9-4d40-b746-534e22ec9f9e' as const,CHARACTERISTICS: {INDICATE: '72c90005-57a9-4d40-b746-534e22ec9f9e' as const,NOTIFY: '72c90003-57a9-4d40-b746-534e22ec9f9e' as const,WRITE: '72c90004-57a9-4d40-b746-534e22ec9f9e' as const,WRITE_WO_RESPONSE: '72c90002-57a9-4d40-b746-534e22ec9f9e' as const,} as const,} as const

Type declaration

  • CHARACTERISTICS: { INDICATE: "72c90005-57a9-4d40-b746-534e22ec9f9e"; NOTIFY: "72c90003-57a9-4d40-b746-534e22ec9f9e"; WRITE: "72c90004-57a9-4d40-b746-534e22ec9f9e"; WRITE_WO_RESPONSE: "72c90002-57a9-4d40-b746-534e22ec9f9e" }
    • INDICATE: "72c90005-57a9-4d40-b746-534e22ec9f9e"
    • NOTIFY: "72c90003-57a9-4d40-b746-534e22ec9f9e"
    • WRITE: "72c90004-57a9-4d40-b746-534e22ec9f9e"
    • WRITE_WO_RESPONSE: "72c90002-57a9-4d40-b746-534e22ec9f9e"
  • SERVICE_ID: "72c90001-57a9-4d40-b746-534e22ec9f9e"

onAnalogInput

onAnalogInput: ((requestId: number, level: number, analogInputNotifyMode: number) => void) | null = null

Analog input

onAnalogInputEvent

onAnalogInputEvent: ((level: number) => void) | null = null

Analog input event

onBatteryLevel

onBatteryLevel: ((battery: number) => void) | null = null

Battery level event

onDigitalInput

onDigitalInput: ((requestId: number, pin: number, state: number) => void) | null = null

Digital input

onDigitalInputEvent

onDigitalInputEvent: ((pin: number, state: number) => void) | null = null

Digital input event

onDigitalOutput

onDigitalOutput: ((requestId: number, pin: number, state: number) => void) | null = null

Digital output

onPwm

onPwm: ((requestId: number, level: number) => void) | null = null

PWM output

onStatusButtonPressed

onStatusButtonPressed: (() => void) | null = null

Status button pressed event

onVOutput

onVOutput: ((requestId: number, vccState: number) => void) | null = null

VCC output

Static AnalogInputEventCondition

AnalogInputEventCondition: { ABOVE_THRESHOLD: 17; BELOW_THRESHOLD: 34; NOT_NOTIFY: 0 } = {NOT_NOTIFY: 0 as const,ABOVE_THRESHOLD: 17 as const,BELOW_THRESHOLD: 34 as const,} as const

Type declaration

  • ABOVE_THRESHOLD: 17
  • BELOW_THRESHOLD: 34
  • NOT_NOTIFY: 0

Static AnalogInputNotifyMode

AnalogInputNotifyMode: { ALWAYS: 2; ONCE: 1; STOP: 0 } = {STOP: 0 as const,ONCE: 1 as const,ALWAYS: 2 as const,} as const

Type declaration

  • ALWAYS: 2
  • ONCE: 1
  • STOP: 0

Static Pin

Pin: { P1: 0; P2: 1; P3: 2 } = {P1: 0 as const,P2: 1 as const,P3: 2 as const,} as const

Type declaration

  • P1: 0
  • P2: 1
  • P3: 2

Static State

State: { HIGH_2_LOW: 2; LOW_2_HIGH: 1 } = {LOW_2_HIGH: 1 as const,HIGH_2_LOW: 2 as const,} as const

Type declaration

  • HIGH_2_LOW: 2
  • LOW_2_HIGH: 1

Static Vcc

Vcc: { OFF: 2; ON: 1 } = {ON: 1 as const,OFF: 2 as const,} as const

Type declaration

  • OFF: 2
  • ON: 1

Static VccState

VccState: { OFF: 0; ON: 1 } = {OFF: 0 as const,ON: 1 as const,} as const

Type declaration

  • OFF: 0
  • ON: 1

Accessors

battery

  • get battery(): number
  • Get battery level

    Returns number

featureCommand

  • get featureCommand(): number[]
  • Get command of feature behavior

    Returns number[]

Methods

checkVersion

  • checkVersion(): boolean
  • Check software version of MESH block

    Returns boolean

createAnalogInputCommand

  • createAnalogInputCommand(analogInputNotifyMode: number, opt_requestId?: number): number[]
  • Create command of analog-input

    Parameters

    • analogInputNotifyMode: number
    • Default value opt_requestId: number = 0

    Returns number[]

    command

createDigitalInputCommand

  • createDigitalInputCommand(pin: number, opt_requestId?: number): number[]
  • Create command of digital-input

    Parameters

    • pin: number
    • Default value opt_requestId: number = 0

    Returns number[]

    command

createDigitalOutputCommand

  • createDigitalOutputCommand(pin: number, opt_requestId?: number): number[]
  • Create command of digital-output

    Parameters

    • pin: number
    • Default value opt_requestId: number = 0

    Returns number[]

    command

createPwmCommand

  • createPwmCommand(opt_requestId?: number): number[]
  • Create command of PWM

    Parameters

    • Default value opt_requestId: number = 0

    Returns number[]

    command

createSetmodeCommand

  • createSetmodeCommand(digitalInputLow2High: GPIO["DigitalPins"], digitalInputHigh2Low: GPIO["DigitalPins"], digitalOutput: GPIO["DigitalPins"], pwmRatio: number, vcc: number, analogInputRangeUpper: number, analogInputRangeLower: number, analogInputNotify: number): number[]
  • Create command of set-mode

    Parameters

    • digitalInputLow2High: GPIO["DigitalPins"]
    • digitalInputHigh2Low: GPIO["DigitalPins"]
    • digitalOutput: GPIO["DigitalPins"]
    • pwmRatio: number

      0-255

    • vcc: number

      Vcc.ON or Vcc.OFF

    • analogInputRangeUpper: number

      0-255(0.00-3.00[V])

    • analogInputRangeLower: number

      0-255(0.00-3.00[V])

    • analogInputNotify: number

      AnalogInputEventCondition.NOT_NOTIFY or AnalogInputEventCondition.ABOVE_THRESHOLD or AnalogInputEventCondition.BELOW_THRESHOLD

    Returns number[]

    command

createStatusbarLedCommand

  • createStatusbarLedCommand(power: boolean, red: boolean, green: boolean, blue: boolean): number[]
  • Create command of statusbar LED

    Parameters

    • power: boolean
    • red: boolean
    • green: boolean
    • blue: boolean

    Returns number[]

    command

createVOutputCommand

  • createVOutputCommand(opt_requestId?: number): number[]
  • Create command of v-output

    Parameters

    • Default value opt_requestId: number = 0

    Returns number[]

    command

indicate

  • indicate(data: number[]): void
  • Set result of indicate

    Parameters

    • data: number[]

    Returns void

    void

notify

  • notify(data: number[]): void
  • Parse data that received from MESH block, and emit event

    const

    Parameters

    • data: number[]

    Returns void

    void

Static isMESHblock

  • isMESHblock(name: string | null, opt_serialnumber?: string): boolean
  • Verify that the device is MESH block

    Parameters

    • name: string | null
    • Default value opt_serialnumber: string = ""

    Returns boolean

Object literals

DigitalPins

DigitalPins: object

p1

p1: boolean = false

p2

p2: boolean = false

p3

p3: boolean = false

Static DigitalInputState

DigitalInputState: object

HIGH

HIGH: 0 = 0 as const

LOW

LOW: 1 = 1 as const

Generated using TypeDoc