Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MESH_100TH

MESH_100TH 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: ((temperature: number, humidity: 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 EmitCondition

EmitCondition: { ABOVE_UPPER_OR_ABOVE_LOWER: 1; ABOVE_UPPER_OR_BELOW_LOWER: 0; BELOW_UPPER_OR_ABOVE_LOWER: 17; BELOW_UPPER_OR_BELOW_LOWER: 16 } = TempHumid.EmitCondition

Type declaration

  • ABOVE_UPPER_OR_ABOVE_LOWER: 1
  • ABOVE_UPPER_OR_BELOW_LOWER: 0
  • BELOW_UPPER_OR_ABOVE_LOWER: 17
  • BELOW_UPPER_OR_BELOW_LOWER: 16

Static LocalName

LocalName: RegExp = /^MESH-100TH/

Static NotifyMode

NotifyMode: { ALWAYS: 32; EMIT_HUMIDITY: 2; EMIT_TEMPERATURE: 1; ONCE: 16; STOP: 0; UPDATE_HUMIDITY: 8; UPDATE_TEMPERATURE: 4 } = TempHumid.NotifyMode

Type declaration

  • ALWAYS: 32
  • EMIT_HUMIDITY: 2
  • EMIT_TEMPERATURE: 1
  • ONCE: 16
  • STOP: 0
  • UPDATE_HUMIDITY: 8
  • UPDATE_TEMPERATURE: 4

Static PartsName

PartsName: "MESH_100TH" = "MESH_100TH"

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 }>
  • Returns Promise<{ address: string; name: string }>

getSensorDataWait

  • getSensorDataWait(opt_timeoutMsec?: 5000): Promise<{ humidity: number; temperature: number }>
  • getSensorDataWait

    Parameters

    • Default value opt_timeoutMsec: 5000 = this.TIMEOUT_MSEC

    Returns Promise<{ humidity: number; temperature: number }>

setMode

  • setMode(temperatureUpper: number, temperatureLower: number, humidityUpper: number, humidityLower: number, temperatureCondition: number, humidityCondition: number, notifyMode: number): void
  • setMode

    Parameters

    • temperatureUpper: number
    • temperatureLower: number
    • humidityUpper: number
    • humidityLower: number
    • temperatureCondition: number
    • humidityCondition: number
    • 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