Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MESH_100MD

MESH_100MD 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: ((motionState: number, nofifyMode: 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-100MD/

Static MotionState

MotionState: { DETECTED: 1; NOT_DETECTED: 2; SETUP: 0 } = Motion.MotionState

Type declaration

  • DETECTED: 1
  • NOT_DETECTED: 2
  • SETUP: 0

Static NotifyMode

NotifyMode: { ALWAYS: 32; DETECTED: 1; NOT_DETECTED: 2; ONCE: 16 } = Motion.NotifyMode

Type declaration

  • ALWAYS: 32
  • DETECTED: 1
  • NOT_DETECTED: 2
  • ONCE: 16

Static PartsName

PartsName: "MESH_100MD" = "MESH_100MD"

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; motionState: number; name: string }>
  • getDataWait

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

getSensorDataWait

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

    Parameters

    • Default value opt_timeoutMsec: 5000 = this.TIMEOUT_MSEC

    Returns Promise<number>

setMode

  • setMode(notifyMode: number, opt_holdingTime?: number, opt_detectionTime?: number): void
  • setMode

    Parameters

    • notifyMode: number
    • Default value opt_holdingTime: number = 500
    • Default value opt_detectionTime: number = 500

    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