Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Logtta_Accel

Logtta_Accel management class Logtta_Accelを管理するクラス

Only support in beacon mode

ビーコンモードのときのみ動作します

Hierarchy

Index

Constructors

constructor

Properties

address

address: string

Optional batteryService

batteryService: BleBatteryService

beaconData

beaconData: number[] | null

beaconDataInScanResponse

beaconDataInScanResponse: number[] | null

Optional genericAccess

genericAccess: BleGenericAccess

Optional onNotify

onNotify: undefined | ((data: unknown) => void)

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: "Beacon" = "Beacon"

Static PartsName

PartsName: "Logtta_Accel" = "Logtta_Accel"

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

Accessors

mode

Methods

authPinCodeWait

  • authPinCodeWait(code: string | number): Promise<boolean>
  • Authorize PIN code

    ピンコードを認証

    Parameters

    • code: string | number

      PIN code ピンコード

    Returns Promise<boolean>

    Whether authentication was/is passed 認証が通った/通っているかどうか

checkMode

connectWait

  • connectWait(keys?: undefined | string): Promise<void>
  • Connect to the services of a device

    デバイスのサービスに接続

    Parameters

    • Optional keys: undefined | string

      Key acquired when pairing previously 以前にペアリングしたときに取得されたキー

    Returns Promise<void>

disconnectWait

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

    ペリフェラルから切断

    Returns Promise<void>

getData

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

    Returns Logtta_Accel_Data

getDataWait

  • getDataWait(): Promise<unknown>
  • Get data with connected state

    接続状態でデータを取得

    Returns Promise<unknown>

    received value from each sensor それぞれのセンサから取得した値

setBeaconModeWait

  • setBeaconModeWait(enable: boolean): Promise<boolean>
  • Set / unset to Beacon Mode

    ビーコンモードに設定/解除

    Parameters

    • enable: boolean

      enable / disable 有効 / 無効

    Returns Promise<boolean>

    data write result

startNotifyWait

  • startNotifyWait(callback: (data: unknown) => void): Promise<void>
  • Notify when the data have got from the device with connected state

    接続状態でデータを取得したとき通知

    Parameters

    • callback: (data: unknown) => void

      callback function コールバック関数

        • (data: unknown): void
        • Parameters

          • data: unknown

          Returns void

    Returns Promise<void>

Static getAccelData

  • deprecated

    Get a acceleration data from the Logtta_Accel

    Note: work only in beacon mode

    Logtta_Accelから加速度データを取得

    注: ビーコンモードのときのみ動作

    Parameters

    • peripheral: BleRemotePeripheral

      instance of BleRemotePeripheral BleRemotePeripheralのインスタンス

    Returns Logtta_Accel_AccelData | null

    acceleration data from Logtta_Accel

    Logtta_Accelから受け取った加速度データ

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 getScanData

  • deprecated

    Get a scan data from the Logtta_Accel

    Note: work only in beacon mode

    Logtta_Accelからスキャンデータを取得

    注: ビーコンモードのときのみ動作

    Parameters

    • peripheral: BleRemotePeripheral

      instance of BleRemotePeripheral BleRemotePeripheralのインスタンス

    Returns Logtta_Accel_ScanData | null

    scan data from Logtta_Accel

    Logtta_Accelから受け取ったスキャンデータ

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 合致するかどうか

Object literals

Static BeaconDataLength

BeaconDataLength: object

Beacon

Beacon: number = 30

Connectable

Connectable: undefined = undefined

Static BeaconDataLength_ScanResponse

BeaconDataLength_ScanResponse: object

Beacon

Beacon: number = 30

Connectable

Connectable: undefined = undefined

Static BeaconDataStruct

BeaconDataStruct: object

Connectable

Connectable: null = null

Beacon

Beacon: object

accel_peak

accel_peak: object

index

index: number = 0

length

length: number = 24

scanResponse

scanResponse: true = true

type

type: "custom" = "custom"

func

  • Parameters

    Returns { x: number; y: number; z: number }

    • x: number
    • y: number
    • z: number

accel_rms

accel_rms: object

index

index: number = 0

length

length: number = 24

scanResponse

scanResponse: true = true

type

type: "custom" = "custom"

func

  • Parameters

    Returns { x: number; y: number; z: number }

    • x: number
    • y: number
    • z: number

alert

alert: object

index

index: number = 22

length

length: number = 2

type

type: "custom" = "custom"

func

  • func(data: number[]): number[]
  • Parameters

    • data: number[]

    Returns number[]

appearance

appearance: object

data

data: number = 5

index

index: number = 0

type

type: "check" = "check"

appearance_sr

appearance_sr: object

data

data: number = 5

index

index: number = 0

scanResponse

scanResponse: true = true

type

type: "check" = "check"

battery

battery: object

index

index: number = 3

type

type: "unsignedNumLE" = "unsignedNumLE"

humidity

humidity: object

index

index: number = 20

length

length: number = 2

type

type: "custom" = "custom"

func

  • func(data: number[]): number
  • Parameters

    • data: number[]

    Returns number

name

name: object

index

index: number = 4

length

length: number = 8

type

type: "string" = "string"

revision

revision: object

index

index: number = 1

type

type: "unsignedNumLE" = "unsignedNumLE"

sequence

sequence: object

index

index: number = 2

type

type: "unsignedNumLE" = "unsignedNumLE"

setting

setting: object

index

index: number = 12

length

length: number = 6

type

type: "custom" = "custom"

func

  • func(data: number[]): { accel_axis: ("x" | "y" | "z")[]; accel_range: number; accel_resolution: number; accel_sampling: number; hpf: boolean; temp_cycle: number }
  • Parameters

    • data: number[]

    Returns { accel_axis: ("x" | "y" | "z")[]; accel_range: number; accel_resolution: number; accel_sampling: number; hpf: boolean; temp_cycle: number }

    • accel_axis: ("x" | "y" | "z")[]
    • accel_range: number
    • accel_resolution: number
    • accel_sampling: number
    • hpf: boolean
    • temp_cycle: number

temperature

temperature: object

index

index: number = 18

length

length: number = 2

type

type: "custom" = "custom"

func

  • func(data: number[]): number
  • Parameters

    • data: number[]

    Returns number

Static CompanyID

CompanyID: object

Beacon

Beacon: number[] = [0x10, 0x05]

Connectable

Connectable: undefined = undefined

Static CompanyID_ScanResponse

CompanyID_ScanResponse: object

Beacon

Beacon: number[] = [0x10, 0x05]

Connectable

Connectable: undefined = undefined

Static LocalName

LocalName: object

Beacon

Beacon: RegExp = /null/

Connectable

Connectable: undefined = undefined

Static ServiceUuids

ServiceUuids: object

Beacon

Beacon: null = null

Connectable

Connectable: string = "c2de0000-a6c7-437f-8538-54e07f7845df"

Generated using TypeDoc