Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MESH_100GP

MESH_100GP management class

Hierarchy

Index

Constructors

constructor

Properties

DigitalPins

DigitalPins: GPIO["DigitalPins"] = (this.meshBlock as GPIO).DigitalPins

address

address: string

beaconData

beaconData: number[] | null

beaconDataInScanResponse

beaconDataInScanResponse: number[] | null

onAnalogInputEvent

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

onBatteryLevel

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

onDigitalInputEvent

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

onStatusButtonPressed

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

onWriteResponse

onWriteResponse: ((response: boolean) => void) | null = null

Optional ondisconnect

ondisconnect: undefined | ((reason: unknown) => void | Promise<void>)

onDisconnect callback function.

切断された時に呼ばれるコールバック関数

param

Reason for being disconnected 切断された理由

peripheral

serviceData

serviceData: number[] | null

Static Optional Address

Address: ObnizPartsBleCompare<RegExp> = undefined

Used as a condition of isDevice() by default.

標準でisDevice()の条件として使用

Static AnalogInputEventCondition

AnalogInputEventCondition: { ABOVE_THRESHOLD: 17; BELOW_THRESHOLD: 34; NOT_NOTIFY: 0 } = GPIO.AnalogInputEventCondition

Type declaration

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

Static AnalogInputNotifyMode

AnalogInputNotifyMode: { ALWAYS: 2; ONCE: 1; STOP: 0 } = GPIO.AnalogInputNotifyMode

Type declaration

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

Static AvailableBleMode

AvailableBleMode: "Connectable" = 'Connectable' as const

Static Optional BeaconDataLength

BeaconDataLength: ObnizPartsBleCompare<number | null> = undefined

Used as a condition of isDevice() by default.

標準でisDevice()の条件として使用

Static Optional BeaconDataLength_ScanResponse

BeaconDataLength_ScanResponse: ObnizPartsBleCompare<number | null> = undefined

Used as a condition of isDevice() by default.

標準でisDevice()の条件として使用

Static Optional BeaconDataStruct

BeaconDataStruct: ObnizPartsBleCompare<ObnizBleBeaconStruct<unknown> | null>

Used as a condition of isDevice() by default. Compare with data after Company ID.

標準でisDevice()の条件として使用 CompanyID以降のデータと比較

Static Optional CompanyID

CompanyID: ObnizPartsBleCompare<number[] | null> = undefined

Used as a condition of isDevice() by default.

標準でisDevice()の条件として使用

Static Optional CompanyID_ScanResponse

CompanyID_ScanResponse: ObnizPartsBleCompare<number[] | null> = undefined

Used as a condition of isDevice() by default.

標準でisDevice()の条件として使用

Static DigitalInputState

DigitalInputState: { HIGH: 0; LOW: 1 } = GPIO.DigitalInputState

Type declaration

  • HIGH: 0
  • LOW: 1

Static LocalName

LocalName: RegExp = /^MESH-100GP/

Static PartsName

PartsName: "MESH_100GP" = "MESH_100GP"

Static Pin

Pin: { P1: 0; P2: 1; P3: 2 } = GPIO.Pin

Type declaration

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

Static Optional ServiceDataLength

ServiceDataLength: ObnizPartsBleCompare<number | null> = undefined

Used as a condition of isDevice() by default.

標準でisDevice()の条件として使用

Static Optional ServiceDataStruct

ServiceDataStruct: ObnizPartsBleCompare<ObnizBleBeaconStruct<unknown> | null>

Used as a condition of isDevice() by default. Compare with data after Service UUID.

標準でisDevice()の条件として使用 ServiceUUID以降のデータと比較

Static Optional ServiceDataUUID

ServiceDataUUID: ObnizPartsBleCompare<number[] | null> = undefined

Used as a condition of isDevice() by default.

標準でisDevice()の条件として使用

Static Optional ServiceUuids

ServiceUuids: ObnizPartsBleCompare<string | string[] | null> = undefined

Used as a condition of isDevice() by default.

標準でisDevice()の条件として使用

Static State

State: { HIGH_2_LOW: 2; LOW_2_HIGH: 1 } = GPIO.State

Type declaration

  • HIGH_2_LOW: 2
  • LOW_2_HIGH: 1

Static Vcc

Vcc: { OFF: 2; ON: 1 } = GPIO.Vcc

Type declaration

  • OFF: 2
  • ON: 1

Static VccState

VccState: { OFF: 0; ON: 1 } = GPIO.VccState

Type declaration

  • OFF: 0
  • ON: 1

Accessors

mode

Methods

checkMode

connectWait

  • connectWait(): Promise<void>

disconnectWait

  • disconnectWait(): Promise<void>
  • Disconnect from peripheral.

    ペリフェラルから切断

    Returns Promise<void>

getAnalogInputDataWait

  • getAnalogInputDataWait(opt_timeoutMsec?: 5000): Promise<number>
  • getAnalogInputDataWait

    Parameters

    • Default value opt_timeoutMsec: 5000 = this.TIMEOUT_MSEC

    Returns Promise<number>

getData

  • getData(): null
  • アドバタイジングデータを連想配列に成形 利用可能なモード: Beacon, Connectable(一部のみ) Form advertising data into an associative array Available modes: Beacon, Connectable(only part)

    Returns null

getDataWait

  • getDataWait(): Promise<{ address: string; name: string }>
  • getDataWait

    Returns Promise<{ address: string; name: string }>

getDigitalInputDataWait

  • getDigitalInputDataWait(pin: number, opt_timeoutMsec?: 5000): Promise<number>
  • getDigitalInputDataWait

    Parameters

    • pin: number
    • Default value opt_timeoutMsec: 5000 = this.TIMEOUT_MSEC

    Returns Promise<number>

getDigitalOutputDataWait

  • getDigitalOutputDataWait(pin: number, opt_timeoutMsec?: 5000): Promise<number>
  • getDigitalOutputDataWait

    Parameters

    • pin: number
    • Default value opt_timeoutMsec: 5000 = this.TIMEOUT_MSEC

    Returns Promise<number>

getPwmDataWait

  • getPwmDataWait(opt_timeoutMsec?: 5000): Promise<number>
  • getPwmDataWait

    Parameters

    • Default value opt_timeoutMsec: 5000 = this.TIMEOUT_MSEC

    Returns Promise<number>

getVOutputDataWait

  • getVOutputDataWait(opt_timeoutMsec?: 5000): Promise<number>
  • getVOutputDataWait

    Parameters

    • Default value opt_timeoutMsec: 5000 = this.TIMEOUT_MSEC

    Returns Promise<number>

setDigitalOutput

  • setDigitalOutput(digitalOutput: MESH_100GP["DigitalPins"]): void
  • setDigitalOutput

    Parameters

    • digitalOutput: MESH_100GP["DigitalPins"]

    Returns void

setMode

  • setMode(digitalInputLow2High: MESH_100GP["DigitalPins"], digitalInputHigh2Low: MESH_100GP["DigitalPins"], digitalOutput: MESH_100GP["DigitalPins"], pwmRatio: number, vcc: number, analogInputRangeUpper: number, analogInputRangeLower: number, analogInputCondition: number): void
  • setMode

    Parameters

    • digitalInputLow2High: MESH_100GP["DigitalPins"]
    • digitalInputHigh2Low: MESH_100GP["DigitalPins"]
    • digitalOutput: MESH_100GP["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])

    • analogInputCondition: number

      AnalogInputEventCondition.NOT_NOTIFY or AnalogInputEventCondition.ABOVE_THRESHOLD or AnalogInputEventCondition.BELOW_THRESHOLD

    Returns void

setModeAnalogInput

  • setModeAnalogInput(analogInputRangeUpper: number, analogInputRangeLower: number, analogInputCondition: number): void
  • setModeAnalogInput

    Parameters

    • analogInputRangeUpper: number

      0-255(0.00-3.00[V])

    • analogInputRangeLower: number

      0-255(0.00-3.00[V])

    • analogInputCondition: number

      AnalogInputEventCondition.NOT_NOTIFY or AnalogInputEventCondition.ABOVE_THRESHOLD or AnalogInputEventCondition.BELOW_THRESHOLD

    Returns void

setModeDigitalInput

  • setModeDigitalInput(digitalInputLow2High: MESH_100GP["DigitalPins"], digitalInputHigh2Low: MESH_100GP["DigitalPins"]): void
  • setModeDigitalInput

    Parameters

    • digitalInputLow2High: MESH_100GP["DigitalPins"]
    • digitalInputHigh2Low: MESH_100GP["DigitalPins"]

    Returns void

setPwmOutput

  • setPwmOutput(pwmRatio: number): void
  • setPwmOutput

    Parameters

    • pwmRatio: number

      0-255

    Returns void

setStatusbarLed

  • setStatusbarLed(power: boolean, red: boolean, green: boolean, blue: boolean): void
  • Control statusbar LED

    Parameters

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

    Returns void

setVOutput

  • setVOutput(vcc: number): void
  • setVOutput

    Parameters

    • vcc: number

      Vcc.ON or Vcc.OFF

    Returns void

Static getAvailableBleMode

  • Available BLE modes (Beacon | Connectable | Pairing)

    利用可能なBLEのモード (Beacon | Connectable | Pairing)

    Returns ObnizPartsBleMode[]

Static getData

  • Form advertising data into an associative array.

    アドバタイジングデータを連想配列に成形

    deprecated

    Parameters

    Returns unknown | null

Static getDeviceMode

  • Get Peripheral Mode.

    ペリフェラルのモードを取得

    Parameters

    Returns ObnizPartsBleMode | null

    If the corresponding device is that mode, it must be null if not applicable 該当するデバイスならばそのモード、該当しなければnull

Static getServiceUuids

Static info

  • Information of parts. name: PartsName

    Returns ObnizPartsInfo

Static isDevice

Static isDeviceWithMode

  • Check if peripherals and modes match the library.

    ペリフェラルとモードがライブラリと合致するかチェック

    Parameters

    Returns boolean

    Whether to match 合致するかどうか

Static isMESHblock

  • Check MESH block

    Parameters

    Returns boolean

Generated using TypeDoc