On this page

# TRROConfig

TRROSDK initialization options.

Top-level config including cloud mode, signaling endpoint, device credentials, event observer, logger, and custom-message options. See each field below for details.

## Members

### cloudMode :CloudMode

Cloud mode (default: 'private')

Type:

- CloudMode

### serverIp :string|Array

Signaling server IP/domain (required for private cloud)

Type:

- string | Array

### port :number

Signaling server port (default: 3000/443 for private cloud)

Type:

- number

### targetIp :string

Type:

- string

Deprecated
  - Yes

### targetPort :number

Type:

- number

Deprecated
  - Yes

### https :boolean

Enable HTTPS (forced for public cloud)

Type:

- boolean

### mqttOptions :object

MQTT configuration

Type:

- object

Properties

Name | Type | Attributes | Description
--- | --- | --- | ---
`url` | string | Array | <optional> |
`port` | number | <optional> |
`forceLogin` | boolean | <optional> |
`enableLog` | boolean | <optional> | Enable MQTT low-level logging When `loggerOption.showLog` is false, logs won't be printed even if this is true When `loggerOption.reportLog` is true and this is true, MQTT logs will be reported along with other SDK logs

### sdkMode :SDKMode

Service mode (default: server2 for public cloud)

Type:

- SDKMode

### projectId :number|string

Project ID

Type:

- number | string

### remoteDeviceId :string

Remote device ID

Type:

- string

### password :string

Device password

Type:

- string

### observer :TRROMediaObserver

Event observer

Type:

- TRROMediaObserver

### loggerOption :object

Logger configuration

Type:

- object

Properties

Name | Type | Attributes | Description
--- | --- | --- | ---
`showLog` | boolean | <optional> |
`reportLog` | boolean | <optional> |
`logLevel` | 'DEBUG' | 'LOG' | 'INFO' | 'WARN' | 'ERROR' | <optional> | Minimum log level (inclusive) to print to console. Logs below this level are not printed. Order from low to high: 'DEBUG' < 'LOG' < 'INFO' < 'WARN' < 'ERROR'. Requires `showLog` to be true.
`reportLevel` | 'DEBUG' | 'LOG' | 'INFO' | 'WARN' | 'ERROR' | <optional> | Minimum log level (inclusive) to report. Logs below this level are not reported. Order from low to high: 'DEBUG' < 'LOG' < 'INFO' < 'WARN' < 'ERROR'. Requires `reportLog` to be true.
`log` | function | <optional> |
`error` | function | <optional> |
`warn` | function | <optional> |
`info` | function | <optional> |
`debug` | function | <optional> |

### customMessageOption :object

Custom-message (onControlData) options

Type:

- object

Properties

Name | Type | Attributes | Description
--- | --- | --- | ---
`preferArrayBuffer` | boolean | <optional> | Whether to unify the `data` field of the `onControlData` callback as `ArrayBuffer`. `true`: `dataType` is always `'arrayBuffer'` and `data` is always an `ArrayBuffer`. Consumers can parse the payload as bytes without branching on `dataType`. `false` (default): consumers must branch on `dataType` to determine the type of `data`. Only affects the SCTP DataChannel path (`channelType: 'sctp'`); the MQTT path (`channelType: 'mqtt'`) picks the type from the actual content and is not influenced by this flag.

Type anything to view search result