Skip to main content

CubeConfigChar

Hierarchy​

Implements​

Index​

Constructors​

Properties​

Methods​

Constructors​

constructor​

+ new CubeConfigChar(service: BluetoothRemoteGATTService): CubeConfigChar

Inherited from CubeChar.constructor

Defined in cube/char/char.ts:19

Parameters:

NameType
serviceBluetoothRemoteGATTService

Returns: CubeConfigChar

Properties​

Protected characteristic​

• characteristic: BluetoothRemoteGATTCharacteristic

Inherited from CubeChar.characteristic

Defined in cube/char/char.ts:10


Protected errStrInProgress​

• errStrInProgress: string = "GATT operation already in progress."

Inherited from CubeChar.errStrInProgress

Defined in cube/char/char.ts:12


Readonly uuid​

• uuid: string = "10b201ff-5b3b-4571-9508-cf3efcd7bbae"

Overrides CubeChar.uuid

Defined in cube/char/configChar.ts:11

Methods​

addEventListener​

▸ addEventListener(type: string, listener: CubeConfigCharListner): void

Defined in cube/char/configChar.ts:123

Register callback.

Parameters:

NameTypeDescription
typestringSpecify the type from 'protocolversion'.
listenerCubeConfigCharListner-

Returns: void


disableMagnet​

▸ disableMagnet(): void

Defined in cube/char/configChar.ts:144

Disable magnet function.

Returns: void


enableMagnet​

▸ enableMagnet(): void

Defined in cube/char/configChar.ts:135

Enable magnet function.

Returns: void


getProtocolVersion​

▸ getProtocolVersion(): string

Defined in cube/char/configChar.ts:75

Get BLE protocol version.

Returns: string

string id of BLE protocol version.


prepare​

▸ prepare(): Promise‹string | Error›

Implementation of CubeCharIF

Overrides CubeChar.prepare

Defined in cube/char/configChar.ts:40

Prepare for using configuration characteristic function.

Returns: Promise‹string | Error›

Promise. resolve handler says that methods are available in this class.


readValue​

▸ readValue(): Promise‹DataView›

Implementation of CubeCharIF

Inherited from CubeChar.readValue

Defined in cube/char/char.ts:110

Read value from remote GATT Characteristics.

Returns: Promise‹DataView›

Promise. resolve handler include data.


setFrameRate​

▸ setFrameRate(fps: number): void

Implementation of CubeCharIF

Inherited from CubeChar.setFrameRate

Defined in cube/char/char.ts:134

Set framerate.

Parameters:

NameType
fpsnumber

Returns: void


writeValue​

▸ writeValue(buf: ArrayBuffer): Promise‹string | Error›

Implementation of CubeCharIF

Inherited from CubeChar.writeValue

Defined in cube/char/char.ts:55

Write value to remote GATT Characteristics.

Parameters:

NameTypeDescription
bufArrayBufferdata buffer including command for Cube.

Returns: Promise‹string | Error›

Promise. resolve handler says that write command executed correctly.


writeValueCore​

▸ writeValueCore(buf: ArrayBuffer, countRetry: number): Promise‹string | Error›

Inherited from CubeChar.writeValueCore

Defined in cube/char/char.ts:78

Write value to remote GATT Characteristics. Core function.

Parameters:

NameTypeDescription
bufArrayBufferdata buffer including command for Cube.
countRetrynumberCounter for retry.

Returns: Promise‹string | Error›

Promise. resolve handler says that write command executed correctly.