Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UC421BLE

Class for managing UC421BLE.

UC421BLEを管理するクラス

Hierarchy

  • UC421BLE

Implements

Index

Constructors

constructor

Properties

_peripheral

_peripheral: BleRemotePeripheral | null

Optional ondisconnect

ondisconnect: undefined | ((reason: any) => void)

Methods

aquireNewUserNoWait

  • aquireNewUserNoWait(cc: number): Promise<UserNo>
  • Aquire a new user No

    新規ユーザNoを取得

    Parameters

    • cc: number

      cc is short for 'consent code' and used along with the user No when authorizing a user. It should be a range from 0 to 9999. ccは'consent code'の略でユーザ認証の際にuser Noと一緒に使う。0 ~ 9999で指定する。

    Returns Promise<UserNo>

    user No ranging from 1 to 5. 1 ~ 5のユーザNo

authorizeUserWait

  • Authorize a user

    ユーザ認証

    Parameters

    • userNo: UserNo | GuestUserNo

      User No aquired from the aquireNewUserNoWait function. But when you authorizing a guest user, pass in 99. aquireNewUserNoWait関数で取得したユーザNo。ただしゲストユーザの認証を行う場合は99を指定。

    • cc: number

      cc that you have passed in as an argument when calling the aquireNewUserNoWait function. But when you authorizing a guest user, pass in 9999. aquireNewUserNoWait関数で引数に指定したcc。ただしゲストユーザの認証を行う際は9999を指定。

    Returns Promise<void>

changeRunningModeWait

  • changeRunningModeWait(mode: "measurement" | "setting"): Promise<void>
  • Change the runnning mode. By default it's 'measurement' mode, and if you want to do some setting, call this function with an argument 'setting' and go into 'setting' mode. After 180 seconds passed since this function called, it gets back to its normal 'measurement' mode from 'setting' mode.

    動作モード変更。デフォルトでは'measurement'(測定)モードだが、本体設定を行いたい時はこの関数を呼んで'setting'(設定)モードに変更する。 この関数を呼んでから180秒後に、通常の'measurement'(測定)モードに戻る。

    Parameters

    • mode: "measurement" | "setting"

      Target mode you want the peripheral to go into. 'measurement' or 'setting'. 変更したいモード。'measurement'または'setting'。

    Returns Promise<void>

connectWait

  • connectWait(): Promise<void>
  • Connect to the peripheral without a pairing

    ペアリングせずにペリフェラルに接続する

    Returns Promise<void>

disconnectWait

  • disconnectWait(): Promise<void>
  • Send disconnect request to peripheral.

    切断要求をペリフェラルに送信。

    Returns Promise<void>

getBodyCompositionDataWait

  • Get a list of measured body composition data. To use this function, you first need to authorize a user by calling authorizeUserWait function. After that, you can get the data attached to the user. If the multiple body composition data are stored in memory, multiple data will be returned.

    体組成情報取得。この関数を使うにはまずauthorizeUserWait関数でユーザ認証を行う必要がある。 認証後、そのユーザの体組成データを取得できるようになる。データがメモリに複数保存されている場合はデータが複数返ってくる。

    Returns Promise<UC421BLEBodyCompositionResult[]>

    List of UC421BLEBodyCompositionResult object. UC421BLEBodyCompositionResultオブジェクトの配列。

getUserInfoDataWait

  • Get a user info. To use this function, you first need to authorize a user by calling authorizeUserWait function. Then you can get a personal info of the user.

    ユーザ情報取得。この関数を使うにはまずauthorizeUserWait関数でユーザ認証を行う必要がある。 認証後、そのユーザのユーザ情報を取得できるようになる。

    Returns Promise<UC421BLEUserInfoData>

    UC421BLEUserInfoData object. UC421BLEUserInfoDataオブジェクト。

getWeightDataWait

  • Get a list of measured weight data. To use this function, you first need to authorize a user by calling authorizeUserWait function. After that, you can get the data attached to the user. If the multiple weight data are stored in memory, multiple data will be returned.

    体重情報取得。この関数を使うにはまずauthorizeUserWait関数でユーザ認証を行う必要がある。 認証後、そのユーザの体重データを取得できるようになる。データがメモリに複数保存されている場合はデータが複数返ってくる。

    Returns Promise<UC421BLEWeightResult[]>

    List of UC421BLEWeightResult object. UC421BLEWeightResultオブジェクトの配列。

isMedicalExamModeOnWait

  • isMedicalExamModeOnWait(): Promise<boolean>
  • Get if the medical exam mode is on or off.

    検診モード設定状況取得。

    Returns Promise<boolean>

    true for medical exam mode on and false for off

pairingWait

  • pairingWait(): Promise<string | null>
  • Do the pairing with the peripheral

    ペリフェラルとペアリングする

    Returns Promise<string | null>

    pairing key ペアリングキー

setMedicalExamModeWait

  • setMedicalExamModeWait(mode: "on" | "off"): Promise<void>
  • Set medical exam mode. To use this function, you first need to have the peripheral go into 'setting' mode by calling changeRunningModeWait function. Medical exam mode does not require normal users(No: 1 ~ 5 and cc: 0 ~ 9999), it only uses a guest user(No: 99 and cc: 9999) and no data is saved in memory. This mode supports two situations. 'measurementWithApp' and 'measurementWithoutApp' both indicated in an advertisement. Currently, obniz.js only supports the 'measurementWithoutApp' situation, so you can only get the weight data with this mode.

    検診モード設定。この関数を使うには、まずchangeRunningModeWait関数を呼んで動作モードを'setting'にする必要がある。 検診モードは通常のユーザではなくゲストユーザを使用し、測定値はメモリに保存されない。 このモードは2つのシチュエーションに対応している。('アプリ有り計測'と'アプリ無し計測'。アドバタイズメントの中で確認できる) obniz.jsでは現在'アプリ無し計測'のみ対応しており、この場合は体重データのみ取得可能。

    Parameters

    • mode: "on" | "off"

      'on' or 'off'

    Returns Promise<void>

updateUserInfoDataWait

  • Update a user info. After aquiring a new user No, it's recommended to register an initial user info attached to it. To use this function, you first need to authorize a user by calling authorizeUserWait function. After that, you can update a personal info of the user.

    ユーザ情報更新。新規ユーザNoを取得した後は、この関数でユーザ情報を登録することを推奨。 この関数を使うにはまずauthorizeUserWait関数を使ってユーザ認証を行う必要がある。 認証後、そのユーザのユーザ情報を更新できるようになる。

    Parameters

    • userInfo: UC421BLEUserInfoData

      UC421BLEUserInfoData object. UC421BLEUserInfoDataオブジェクト

    Returns Promise<void>

Static getManufacturerSpecificDataFromAdv

  • Extract a manufacturer specific data from an advertisement sent from UC421BLE.

    UC421BLEから送られたアドバタイズメントからmanufacturer specific dataを取得する

    Parameters

    • peripheral: BleRemotePeripheral

      instance of BleRemotePeripheral BleRemotePeripheralのインスタンス

    Returns UC421BLEManufacturerSpecificData

    manufacturer specific data

Static info

Static isDevice

  • Judge if the peripheral is UC421BLE or not

    ペリフェラルがUC421BLEかどうかを確認する

    Parameters

    • peripheral: BleRemotePeripheral

      instance of BleRemotePeripheral BleRemotePeripheralのインスタンス

    Returns boolean

    Judgement if the peripheral is UC421BLE or not ペリフェラルがUC421BLEかどうかの判定

Generated using TypeDoc