Members
(static) callback :function
コールバック関数
Type:
- function
(static) debug :boolean
デバッグモードフラグ
Type:
- boolean
(static) internalBuffer :Uint8Array
受信データバッファ (内部用)
Type:
- Uint8Array
(static) port :SerialPort
シリアルポートオブジェクト
Type:
- SerialPort
(static) portConfig :object
Properties:
| Name | Type | Description |
|---|---|---|
path |
string | ポートパス (例: 'COM3') |
baudRate |
number | ボーレート (デフォルト: 115200) |
dataBits |
number | データビット (デフォルト: 8) |
stopBits |
number | ストップビット (デフォルト: 1) |
parity |
string | パリティ (デフォルト: 'none') |
シリアルポートの設定
Type:
- object
Methods
(static) calcCrc16(typed_array_list) → {number}
Parameters:
| Name | Type | Description |
|---|---|---|
typed_array_list |
Array.<TypedArray> | 計算対象のTyped Arrayリスト |
Returns:
計算されたCRC-16値
- Type
- number
(static) concatTypedArrays(typed_array_list) → {Uint8Array}
Parameters:
| Name | Type | Description |
|---|---|---|
typed_array_list |
Array.<TypedArray> | 連結したいTyped Arrayのリスト |
Returns:
連結されたUint8Array
- Type
- Uint8Array
(static) createRequestData() → {Uint8Array}
Returns:
生成されたリクエストデータ
- Type
- Uint8Array
(static) createSettingLED(option) → {Uint8Array}
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
option |
object | LED設定オプション
Properties
|
Returns:
生成された設定データ
- Type
- Uint8Array
(async, static) flashMemoryStatus()
(async, static) getPortList() → {Promise.<Array>}
Returns:
シリアルポート情報の配列
- Type
- Promise.<Array>
(static) isEmpty(obj) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
object | 判定するオブジェクト |
Returns:
空の場合はtrue
- Type
- boolean
(static) parseResponse(recvData) → {SensorData|object|undefined}
Parameters:
| Name | Type | Description |
|---|---|---|
recvData |
Uint8Array | 受信データ (1パケット分) |
Returns:
パースされたセンサーデータオブジェクト、またはundefined
- Type
- SensorData | object | undefined
(static) requestData()
(async, static) settingLED(option)
Parameters:
| Name | Type | Description |
|---|---|---|
option |
object | LED設定オプション |
(async, static) start(callback, optionsopt)
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
callback |
function | データ受信時またはエラー発生時に呼ばれるコールバック関数 (data, err) | ||||||||||||
options |
object |
<optional> |
{}
|
オプション設定
Properties
|