Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MESH_100PA

MESH_100PA management class

Hierarchy

Index

Constructors

constructor

Properties

address

address: string

beaconData

beaconData: number[] | null

beaconDataInScanResponse

beaconDataInScanResponse: number[] | null

onBatteryLevel

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

onSensorEvent

onSensorEvent: ((proximity: number, brightness: 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 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 LocalName

LocalName: RegExp = /^MESH-100PA/

Static NotifyMode

NotifyMode: { ALWAYS: 32; ONCE: 16; STOP: 0; UPDATE_BRIGHTNESS: 8; UPDATE_PROXIMITY: 4 } = Brightness.NotifyMode

Type declaration

  • ALWAYS: 32
  • ONCE: 16
  • STOP: 0
  • UPDATE_BRIGHTNESS: 8
  • UPDATE_PROXIMITY: 4

Static PartsName

PartsName: "MESH_100PA" = "MESH_100PA"

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()の条件として使用

Accessors

mode

Methods

checkMode

connectWait

  • connectWait(): Promise<void>

disconnectWait

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

    ペリフェラルから切断

    Returns Promise<void>

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 }>

getSensorDataWait

  • getSensorDataWait(opt_timeoutMsec?: 5000): Promise<{ brightness: number; proximity: number }>
  • getSensorDataWait

    Parameters

    • Default value opt_timeoutMsec: 5000 = this.TIMEOUT_MSEC

    Returns Promise<{ brightness: number; proximity: number }>

setMode

  • setMode(notifyMode: number): void
  • setMode

    Parameters

    • notifyMode: number

    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

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