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')

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
NameTypeAttributesDescription
urlstring | Array<optional>
portnumber<optional>
forceLoginboolean<optional>
enableLogboolean<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:

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

loggerOption :object

Logger configuration

Type:
  • object
Properties
NameTypeAttributesDescription
showLogboolean<optional>
reportLogboolean<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.

logfunction<optional>
errorfunction<optional>
warnfunction<optional>
infofunction<optional>
debugfunction<optional>

customMessageOption :object

Custom-message (onControlData) options

Type:
  • object
Properties
NameTypeAttributesDescription
preferArrayBufferboolean<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.